diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..733537c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: CloudQuery Central Issues Tracker + url: https://github.com/cloudquery/cloudquery/issues + about: Please file any issue with regards to any of CloudQuery repo in the main repository with the right labels. + - name: CloudQuery Discord Support + url: https://cloudquery.io/discord + about: Join our discord to get live support from us and the community. diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c48ce3a..bc20d6c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -18,7 +18,7 @@ jobs: - name: Validate Gradle wrapper uses: gradle/wrapper-validation-action@342dbebe7272035434f9baccc29a816ec6dd2c7b - name: Publish package - uses: gradle/gradle-build-action@62cce3c597efd445cd71ee868887b8b1117703a7 + uses: gradle/gradle-build-action@0bfe00a136db5e61ba3416b372542a65863a9fee with: arguments: publish env: diff --git a/CHANGELOG.md b/CHANGELOG.md index 204b139..c349431 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [0.0.13](https://github.com/cloudquery/plugin-sdk-java/compare/v0.0.12...v0.0.13) (2023-11-26) + + +### Bug Fixes + +* add date types to ArrowHelper ([#141](https://github.com/cloudquery/plugin-sdk-java/issues/141)) ([21e4981](https://github.com/cloudquery/plugin-sdk-java/commit/21e49818c8a3e55f6b0316750cc8026151ea40d1)) +* **deps:** Update dependency com.fasterxml.jackson.core:jackson-annotations to v2.15.3 ([#133](https://github.com/cloudquery/plugin-sdk-java/issues/133)) ([627b49d](https://github.com/cloudquery/plugin-sdk-java/commit/627b49de71ab9e3fa90a3b930970a2b9f1d97a4f)) +* **deps:** Update dependency com.fasterxml.jackson.core:jackson-core to v2.15.3 ([#135](https://github.com/cloudquery/plugin-sdk-java/issues/135)) ([235781d](https://github.com/cloudquery/plugin-sdk-java/commit/235781df38e59ff9ae0257a0827561c9bfc26341)) +* **deps:** Update dependency com.google.guava:guava to v32.1.3-jre ([#136](https://github.com/cloudquery/plugin-sdk-java/issues/136)) ([eb7b853](https://github.com/cloudquery/plugin-sdk-java/commit/eb7b853ee48ca2dacb6f03b4b6f4d6cb1898a92f)) +* **deps:** Update dependency gradle to v8.4 ([#137](https://github.com/cloudquery/plugin-sdk-java/issues/137)) ([8675852](https://github.com/cloudquery/plugin-sdk-java/commit/8675852d77cf6676c1a6d214c4b53ad3ef3112e8)) +* **deps:** Update dependency io.grpc:grpc-protobuf to v1.59.0 ([#138](https://github.com/cloudquery/plugin-sdk-java/issues/138)) ([88d3e71](https://github.com/cloudquery/plugin-sdk-java/commit/88d3e713338339dc9fd0dd1c23f55f7c0e508ac5)) +* **deps:** Update dependency io.grpc:grpc-stub to v1.59.0 ([#140](https://github.com/cloudquery/plugin-sdk-java/issues/140)) ([556b91b](https://github.com/cloudquery/plugin-sdk-java/commit/556b91bf28fc21df9b1e1e7e6b42fe1396f505a8)) + ## [0.0.12](https://github.com/cloudquery/plugin-sdk-java/compare/v0.0.11...v0.0.12) (2023-10-01) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ac72c34..3fa8f86 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 0adc8e1..1aa94a4 100755 --- a/gradlew +++ b/gradlew @@ -145,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -153,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -202,11 +202,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/lib/build.gradle b/lib/build.gradle index 9c61485..664c563 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -11,7 +11,7 @@ ext { group 'io.cloudquery.plugin.sdk' // x-release-please-start-version -version = '0.0.12' +version = '0.0.13' // x-release-please-end repositories { @@ -31,19 +31,19 @@ dependencies { // This dependency is used internally, and not exposed to consumers on their own compile classpath. implementation 'org.jooq:joou:0.9.4' - implementation 'com.google.guava:guava:32.1.2-jre' + implementation 'com.google.guava:guava:32.1.3-jre' implementation 'info.picocli:picocli:4.7.5' - implementation 'com.google.guava:guava:32.1.2-jre' - implementation "io.grpc:grpc-protobuf:1.58.0" - implementation "io.grpc:grpc-stub:1.57.2" + implementation 'com.google.guava:guava:32.1.3-jre' + implementation "io.grpc:grpc-protobuf:1.59.0" + implementation "io.grpc:grpc-stub:1.59.0" implementation "io.grpc:grpc-services:1.57.2" implementation "io.grpc:grpc-testing:1.57.2" implementation "io.cloudquery:plugin-pb-java:0.0.7" implementation "org.apache.arrow:arrow-memory-core:12.0.1" implementation "org.apache.arrow:arrow-vector:12.0.1" - implementation "com.fasterxml.jackson.core:jackson-core:2.15.2" - implementation "com.fasterxml.jackson.core:jackson-annotations:2.15.2" + implementation "com.fasterxml.jackson.core:jackson-core:2.15.3" + implementation "com.fasterxml.jackson.core:jackson-annotations:2.15.3" implementation 'org.apache.logging.log4j:log4j-api:2.20.0' implementation 'org.apache.logging.log4j:log4j-core:2.20.0' diff --git a/lib/src/main/java/io/cloudquery/helper/ArrowHelper.java b/lib/src/main/java/io/cloudquery/helper/ArrowHelper.java index e3a3a9e..7c99307 100644 --- a/lib/src/main/java/io/cloudquery/helper/ArrowHelper.java +++ b/lib/src/main/java/io/cloudquery/helper/ArrowHelper.java @@ -22,6 +22,7 @@ import org.apache.arrow.memory.RootAllocator; import org.apache.arrow.vector.BigIntVector; import org.apache.arrow.vector.BitVector; +import org.apache.arrow.vector.DateDayVector; import org.apache.arrow.vector.FieldVector; import org.apache.arrow.vector.FixedSizeBinaryVector; import org.apache.arrow.vector.Float4Vector; @@ -139,6 +140,10 @@ private static void setVectorData(FieldVector vector, Object data) { jsonVector.setSafe(0, (byte[]) data); return; } + if (vector instanceof DateDayVector dayDateVector) { + dayDateVector.set(0, (int) data); + return; + } throw new IllegalArgumentException("Unsupported vector type: " + vector.getClass()); } diff --git a/lib/src/test/java/io/cloudquery/helper/ArrowHelperTest.java b/lib/src/test/java/io/cloudquery/helper/ArrowHelperTest.java index ff52029..4a63eb3 100644 --- a/lib/src/test/java/io/cloudquery/helper/ArrowHelperTest.java +++ b/lib/src/test/java/io/cloudquery/helper/ArrowHelperTest.java @@ -15,8 +15,10 @@ import io.cloudquery.schema.Resource; import io.cloudquery.schema.Table; import java.io.IOException; +import java.time.LocalDate; import java.util.List; import java.util.Map; +import org.apache.arrow.vector.types.DateUnit; import org.apache.arrow.vector.types.pojo.ArrowType; import org.apache.arrow.vector.types.pojo.Field; import org.apache.arrow.vector.types.pojo.Schema; @@ -41,7 +43,11 @@ public class ArrowHelperTest { .primaryKey(true) .build(), Column.builder().name("string_column2").type(ArrowType.Utf8.INSTANCE).build(), - Column.builder().name("boolean_column").type(ArrowType.Bool.INSTANCE).build())) + Column.builder().name("boolean_column").type(ArrowType.Bool.INSTANCE).build(), + Column.builder() + .name("date_days_column") + .type(new ArrowType.Date(DateUnit.DAY)) + .build())) .build(); @Test @@ -69,6 +75,9 @@ public void testToArrowSchema() { CQ_EXTENSION_PRIMARY_KEY, "false")); + assertEquals(arrowSchema.getFields().get(2).getName(), "boolean_column"); + assertEquals(arrowSchema.getFields().get(3).getName(), "date_days_column"); + assertEquals( arrowSchema.getCustomMetadata(), Map.of( @@ -84,7 +93,8 @@ public void testFromArrowSchema() { List fields = List.of( Field.nullable("string_column1", ArrowType.Utf8.INSTANCE), - Field.nullable("string_column2", ArrowType.Utf8.INSTANCE)); + Field.nullable("string_column2", ArrowType.Utf8.INSTANCE), + Field.nullable("date_days_column", new ArrowType.Date(DateUnit.DAY))); Schema schema = new Schema(fields, Map.of(CQ_TABLE_NAME, "table1")); @@ -120,6 +130,7 @@ public void testRoundTripResourceEncoding() throws Exception { Resource resource = Resource.builder().table(TEST_TABLE).build(); resource.set("string_column1", "test_data"); resource.set("string_column2", "test_data2"); + resource.set("date_days_column", (int) LocalDate.parse("2023-11-24").toEpochDay()); resource.set("boolean_column", true); Assertions.assertDoesNotThrow(