vertica / spark-connector

This component acts as a bridge between Spark and Vertica, allowing the user to either retrieve data from Vertica for processing in Spark, or store processed data from Spark into Vertica.
Apache License 2.0
20 stars 23 forks source link

[BUG] Connector fails to build with Java 8 due to unsupported method #534

Closed ai-bq closed 1 year ago

ai-bq commented 1 year ago

Environment

Problem Description

  1. Steps to reproduce: Download Java 8 that is at least update 92 or higher and switch to it to build the connector.
  2. Expected behaviour: Should compile fine.
  3. Actual behaviour: Compilation error.
  4. Error message/stack trace:
    [error] /Volumes/Extended/Projects/Vertica/spark-connector/connector/src/main/scala/com/vertica/spark/util/schema/SchemaTools.scala:681:27: value isBlank is not a member of String
    [error]           if (column.name.isBlank) {
    [error]                           ^
    [error] one error found
    [error] (Compile / compileIncremental) Compilation failed

It seems isBlank is not supported by Java 8. We should use an external library such as Apache Common's StringUtil so that both Java 11 and Java 8 can run isBlank.

In the future Java 8 should be tested or at least have the Java 11 compilation run a backwards compatibility build on Java 8 as well.