GoogleCloudDataproc/spark-bigquery-connector

Indirect write to existing datetime column not possible

Closed this issue · 2 comments

Hi,

I need to write spark TimestampNTZ column to an BigQuery table. The datetime type would be ideal, but I'm facing below error:
"pyspark.errors.exceptions.captured.IllegalArgumentException: Data type not expected: timestamp_ntz".

image

When casting the column to StringType, the target column type changes to String (even in case of an existing, empty table). In case of non-empty target table there is:
"com.google.cloud.bigquery.connector.common.BigQueryConnectorException$InvalidSchemaException: Destination table's schema is not compatible with dataframe's schema".

image

The prefered method for me is indirect write, but this issue occurs for the direct write as well.

Spark version 3.4.3
com.google.cloud.spark_spark-bigquery-with-dependencies_2.13-0.36.2.jar

Hi @cheare ,

Please use the dsv2 connector for TimestampNTZ support
com.google.cloud.spark:spark-3.4-bigquery:0.36.2

Thank you @isha97, with com.google.cloud.spark:spark-3.4-bigquery:0.36.2 all works fine :)