Skip to content

Commit 4e2973b

Browse files
authored
Metadata info protobuf version (#11)
* adding support to metadata info protobuf version * bump up protobuf version * parse metadata infos * unmarshall protobuf metadata info to specific structures * cleanup * propagate sdk version using revision * proto spec update * support proto metadata * fix loadCSV tests * adding metadata proto test * fix path * using resources class path * cleanup * adding metadata.pb.txt
1 parent 64f44a7 commit 4e2973b

File tree

17 files changed

+11545
-89
lines changed

17 files changed

+11545
-89
lines changed

pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,19 @@
2727

2828
<modules>
2929
<module>rai-sdk</module>
30+
<module>rai-sdk-protos</module>
3031
<module>rai-sdk-examples</module>
3132
</modules>
3233

3334
<properties>
35+
<revision>0.2.2-alpha</revision>
3436
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3537
<maven.compiler.source>11</maven.compiler.source>
3638
<maven.compiler.target>11</maven.compiler.target>
39+
<jsoniter.version>0.9.19</jsoniter.version>
40+
<apache.arrow.version>7.0.0</apache.arrow.version>
41+
<protobuf.version>3.21.1</protobuf.version>
42+
<protobuf-java-format.version>1.4</protobuf-java-format.version>
3743
</properties>
3844

3945
<build>

rai-sdk-examples/src/main/java/com/relationalai/examples/ExecuteAsync.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public void run(String[] args) throws HttpError, InterruptedException, IOExcepti
6666
if (source == null)
6767
return; // nothing to execute
6868
var rsp = client.executeAsync(database, engine, source, readonly);
69-
Json.print(rsp);
69+
//Json.print(rsp);
70+
System.out.println(rsp);
7071
}
7172
}

rai-sdk-examples/src/main/java/com/relationalai/examples/ExecuteV1.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,6 @@ public void run(String[] args) throws HttpError, InterruptedException, IOExcepti
6565
if (source == null)
6666
return; // nothing to execute
6767
var rsp = client.executeV1(database, engine, source, readonly);
68-
Json.print(rsp, 4);
68+
System.out.println(rsp);
6969
}
7070
}

rai-sdk-examples/src/main/java/com/relationalai/examples/GetTransactionMetadata.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class GetTransactionMetadata implements Runnable {
2727
String id, profile;
2828

2929
public void parseArgs(String[] args) {
30-
var c = Command.create("GetTransactionMetadata")
30+
var c = Command.create("GetTransactionMetadataInfo")
3131
.addArgument("id")
3232
.addOption("profile", "config profile (default: default)")
3333
.parseArgs(args);
@@ -41,6 +41,6 @@ public void run(String[] args) throws HttpError, InterruptedException, IOExcepti
4141
var client = new Client(cfg);
4242

4343
var rsp = client.getTransactionMetadata(id);
44-
Json.print(rsp);
44+
System.out.println(rsp);
4545
}
4646
}

rai-sdk-protos/pom.xml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
<!--
2+
Copyright 2022 RelationalAI, Inc.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-->
16+
17+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
18+
<modelVersion>4.0.0</modelVersion>
19+
20+
<parent>
21+
<groupId>com.relationalai</groupId>
22+
<artifactId>rai-sdk-pom</artifactId>
23+
<version>0.4.0-alpha</version>
24+
</parent>
25+
26+
<name>RelationalAI SDK Protobuf for Java</name>
27+
<description>The RelationalAI Software Development Kit (SDK) for Java</description>
28+
<artifactId>rai-sdk-proto</artifactId>
29+
<packaging>jar</packaging>
30+
31+
<dependencies>
32+
<dependency>
33+
<groupId>com.google.protobuf</groupId>
34+
<artifactId>protobuf-java</artifactId>
35+
<version>${protobuf.version}</version>
36+
</dependency>
37+
<dependency>
38+
<groupId>com.google.protobuf</groupId>
39+
<artifactId>protobuf-java-util</artifactId>
40+
<version>${protobuf.version}</version>
41+
</dependency>
42+
<dependency>
43+
<groupId>com.googlecode.protobuf-java-format</groupId>
44+
<artifactId>protobuf-java-format</artifactId>
45+
<version>${protobuf-java-format.version}</version>
46+
</dependency>
47+
<dependency>
48+
<groupId>com.jsoniter</groupId>
49+
<artifactId>jsoniter</artifactId>
50+
<version>${jsoniter.version}</version>
51+
</dependency>
52+
</dependencies>
53+
54+
<build>
55+
<defaultGoal>install</defaultGoal>
56+
<extensions>
57+
<extension>
58+
<groupId>kr.motd.maven</groupId>
59+
<artifactId>os-maven-plugin</artifactId>
60+
<version>1.6.2</version>
61+
</extension>
62+
</extensions>
63+
<plugins>
64+
<plugin>
65+
<groupId>org.apache.maven.plugins</groupId>
66+
<artifactId>maven-jar-plugin</artifactId>
67+
<version>3.2.2</version>
68+
<configuration>
69+
<archive>
70+
<manifest>
71+
<addClasspath>true</addClasspath>
72+
</manifest>
73+
</archive>
74+
</configuration>
75+
</plugin>
76+
<plugin>
77+
<groupId>org.apache.maven.plugins</groupId>
78+
<artifactId>maven-surefire-plugin</artifactId>
79+
<version>2.22.0</version>
80+
</plugin>
81+
<plugin>
82+
<groupId>org.apache.maven.plugins</groupId>
83+
<artifactId>maven-dependency-plugin</artifactId>
84+
</plugin>
85+
86+
<plugin>
87+
<groupId>org.xolstice.maven.plugins</groupId>
88+
<artifactId>protobuf-maven-plugin</artifactId>
89+
<version>0.6.1</version>
90+
<configuration>
91+
<protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}</protocArtifact>
92+
<pluginId>grpc-java</pluginId>
93+
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.24.0:exe:${os.detected.classifier}</pluginArtifact>
94+
<outputDirectory>${basedir}/src/main/java/</outputDirectory>
95+
<clearOutputDirectory>false</clearOutputDirectory>
96+
</configuration>
97+
<executions>
98+
<execution>
99+
<goals>
100+
<goal>compile</goal>
101+
<goal>test-compile</goal>
102+
</goals>
103+
</execution>
104+
</executions>
105+
</plugin>
106+
</plugins>
107+
<resources>
108+
<resource>
109+
<directory>src/main/resources</directory>
110+
<filtering>true</filtering>
111+
</resource>
112+
</resources>
113+
</build>
114+
</project>

0 commit comments

Comments
 (0)