Skip to content

Commit

Permalink
Merge pull request #206 from tigergraph/jdbc-dev-sync
Browse files Browse the repository at this point in the history
[Automated]JDBC Driver Release 1.3.11
  • Loading branch information
chengjie-qin committed Oct 20, 2023
2 parents eb3da5d + 4ef681c commit f5fe532
Show file tree
Hide file tree
Showing 8 changed files with 220 additions and 177 deletions.
10 changes: 9 additions & 1 deletion tools/etl/tg-jdbc-driver/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
## Release 1.3.11
* Supported TG Version: 2.4.1+
* Bugfixes:
1. Refine the retry mechanism for connection errors.
2. Set default array element type to string for Spark query.
* Features:
2. Provide release package with separated dependency jars.

## Release 1.3.10
* Supported TG Version: 2.4.1+
* Bugfixes:
1. Remove single quote from Spark query string
1. Remove single quote from Spark query string.

## Release 1.3.9
* Supported TG Version: 2.4.1+
Expand Down
6 changes: 5 additions & 1 deletion tools/etl/tg-jdbc-driver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Please refer to [Versions](#versions) to find the **suitable version**.
* Use the jar file directly (e.g. include the JDBC driver for Spark):

Go to [maven.org](https://search.maven.org/artifact/com.tigergraph/tigergraph-jdbc-driver) to get the jar file.
The `tigergraph-jdbc-driver-<version>.jar` is the uber jar containing all the runtime dependencies, and the `tigergraph-jdbc-driver-<version>.tar.gz` packs all jars together separately.

## Minimum viable snippet

Expand Down Expand Up @@ -554,7 +555,8 @@ df.write.mode("append").format("jdbc").options(
"sep" -> "|", // separator between columns
"eol" -> "\n", // End Of Line
"batchsize" -> "10000",
"debug" -> "0")).save()
"debug" -> "0",
"logFilePattern" -> "/tmp/jdbc.log")).save()
```
**If your TG version is 3.9.0 or higher, please use the following new features:**
Expand Down Expand Up @@ -872,6 +874,7 @@ Tigergraph JDBC Driver supports 4 logging levels: 0 -> ERROR, 1 -> WARN, 2 -> IN
It supports two logging frameworks:
- java.util.logging (JUL)
- To use logger, only need to pass in logging level by `properties.put("debug", "0|1|2|3");`, it will initialize with default logging handler and formatter, which only print logs to console.
- To print logs to file, need to explicitly specify the log file path by `properties.put("logFilePattern", "/path/to/log/file");`
- To customize the JUL configuration, please provide your logging configuration file `logging.properties` and specify the JVM system property **explicitly**: `-Djava.util.logging.config.file=path_to_logging.properties`. Reference: [JUL Documentation](https://docs.oracle.com/javase/7/docs/api/java/util/logging/package-summary.html).

For example, create a logging configuration file `logging.properties` with following contents:
Expand Down Expand Up @@ -972,6 +975,7 @@ It could be insecure to type in some sensitive properties like `password`, `toke
| `filename` | (none) | The filename defined in the loading job. | Yes | loading job |
| `sep` | (none) | Column separator. E.g., `,`. | Yes | loading job |
| `eol` | (none) | Line separator. E.g., `\n`. | Yes | loading job |
| `maxRetryCount` | 10 | Max retry count for transient loading failures | Yes | loading job |
| `dbtable` | (none) | The specification of the operation of the form: `operation_type operation_object`. For loading job: `job JOB_NAME`; E.g. for querying loading statistics: `jobid JOB_ID`. | Yes | Spark |
| `batchsize` | 1000 | Maximum number of lines per POST request. | Yes | Spark loading job |
| `partitionColumn` | (none) | The column used for partitioning, it has to be numeric or date or timestamp column. | No | Spark partitioning query |
Expand Down
19 changes: 18 additions & 1 deletion tools/etl/tg-jdbc-driver/tg-jdbc-driver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.tigergraph</groupId>
<artifactId>tigergraph-jdbc-driver</artifactId>
<version>1.3.10</version>
<version>1.3.11</version>
<packaging>jar</packaging>

<name>TigerGraph JDBC Driver Parent</name>
Expand Down Expand Up @@ -206,6 +206,23 @@
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/assembly/package.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
Expand Down
26 changes: 26 additions & 0 deletions tools/etl/tg-jdbc-driver/tg-jdbc-driver/src/assembly/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>release</id>
<includeBaseDirectory>false</includeBaseDirectory>

<formats>
<format>tar.gz</format>
</formats>
<files>
<file>
<source>${project.build.directory}/original-${project.artifactId}-${project.version}.jar</source>
<destName>${project.artifactId}-${project.version}.jar</destName>
<outputDirectory>/</outputDirectory>
</file>
</files>
<dependencySets>
<dependencySet>
<outputDirectory>/lib</outputDirectory>
<excludes>
<exclude>${project.groupId}:${project.artifactId}:jar:*</exclude>
</excludes>
</dependencySet>
</dependencySets>
</assembly>
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public Option<DataType> getCatalystType(
int sqlType, String typeName, int size, MetadataBuilder md) {
if (sqlType == Types.ARRAY) {
// LIST.ELEMENT_TYPE => ELEMENT_TYPE
Option<DataType> elementType = toCatalystType(typeName.split("\\.")[1]);
String[] tokens = typeName.split("\\.");
Option<DataType> elementType = toCatalystType(tokens.length > 1 ? tokens[1] : "");
if (!elementType.isEmpty()) {
return Option.apply(new ArrayType(elementType.get(), false));
}
Expand Down
Loading

0 comments on commit f5fe532

Please sign in to comment.