liquibase / liquibase-databricks

Apache License 2.0
26 stars 7 forks source link

[UNSUPPORTED_DATATYPE] Unsupported data type "DATETIME".(line 1, pos 133) #86

Open Jace2019 opened 11 months ago

Jace2019 commented 11 months ago

This tool was very useful for me when I was working on a deployment of Databricks, thank you for this.

VERSION: liquibase=4.25.0 DatabricksJDBC42-2.6.34.1058.zip liquibase-databricks-1.1.1.jar

ACTION:

  1. liquibase init project --project-defaults-file=liquibase.properties --changeLogFile=databricks.sql --format=sql 2.liquibase update --defaults-file=liquibase.properties --changeLogFile=databricks.sql p.s. databricks.sql is empty file

ACTION RESULT:

1. pass

2. throw error as below. Occurs when LIQUIBASE TRACKING TABLES are created.

ERROR: Unexpected error running Liquibase: [Databricks]JDBCDriver ERROR processing query/statement. Error Code: 0, SQL state: 0A000, Query: CREATE TABxxx, Error message from Server: org.apache.hive.service.cli.HiveSQLException: Error running query: [UNSUPPORTED_DATATYPE] org.apache.spark.sql.catalyst.parser.ParseException: [UNSUPPORTED_DATATYPE] Unsupported data type "DATETIME".(line 1, pos 133)

SQL statement: CREATE TABLE DATABASECHANGELOG (ID VARCHAR(255) NOT NULL, AUTHOR VARCHAR(255) NOT NULL, FILENAME VARCHAR(255) NOT NULL, DATEEXECUTED datetime NOT NULL, ORDEREXECUTED INT NOT NULL, EXECTYPE VARCHAR(10) NOT NULL, MD5SUM VARCHAR(35), DESCRIPTION VARCHAR(255), COMMENTS VARCHAR(255), TAG VARCHAR(255), LIQUIBASE VARCHAR(20), CONTEXTS VARCHAR(255), LABELS VARCHAR(255), DEPLOYMENT_ID VARCHAR(10))

Would you help show any advice ? thanks a lot.

Jace2019 commented 11 months ago

I tried with --currentDateTimeFunction as well. Its not working. Can someone guide me how to fix this?thanks a lot

Jace2019 commented 11 months ago

I OK now. --include below 1.FROM liquibase/liquibase (=4.25.0) 2.DatabricksJDBC42-2.6.34.1058.zip 3.liquibase-databricks-1.1.2.jar

BillCM commented 10 months ago

@Jace2019 I'm hitting this same problem. Is your last message saying that this is working or you now?

`ERROR: Exception Primary Reason: [Databricks]DatabricksJDBCDriver ERROR processing query/statement. Error Code: 0, SQL state: org.apache.hive.service.cli.HiveSQLException: Error running query: [UNSUPPORTED_DATATYPE] org.apache.spark.sql.catalyst.parser.ParseException: [UNSUPPORTED_DATATYPE] Unsupported data type "DATETIME".(line 1, pos 133)

== SQL == CREATE TABLE DATABASECHANGELOG (ID VARCHAR(255) NOT NULL, AUTHOR VARCHAR(255) NOT NULL, FILENAME VARCHAR(255) NOT NULL, DATEEXECUTED datetime NOT NULL, ORDEREXECUTED INT NOT NULL, EXECTYPE VARCHAR(10) NOT NULL, MD5SUM VARCHAR(35), DESCRIPTION VARCHAR(255), COMMENTS VARCHAR(255), TAG VARCHAR(255), LIQUIBASE VARCHAR(20), CONTEXTS VARCHAR(255), LABELS VARCHAR(255), DEPLOYMENT_ID VARCHAR(10))`

BillCM commented 10 months ago

I also made it past this. Liquibase wasn't picking up the jar.

Jace2019 commented 10 months ago

FROM liquibase/liquibase:4.25.0

RUN wget https://databricks-bi-artifacts.s3.us-east-2.amazonaws.com/simbaspark-drivers/jdbc/2.6.34/DatabricksJDBC42-2.6.34.1058.zip;\ unzip DatabricksJDBC42-2.6.34.1058.zip;\ mv DatabricksJDBC42-2.6.34.1058\ 2/DatabricksJDBC42.jar /liquibase/lib/;\ rm DatabricksJDBC42-2.6.34.1058.zip;\ wget https://github.com/liquibase/liquibase-databricks/releases/download/v1.1.2/liquibase-databricks-1.1.2.jar;\ mv liquibase-databricks-1.1.2.jar /liquibase/lib/

using the dockerfile(part) can working.

Sophiakorginska commented 10 months ago

Hi @Jace2019 and @BillCM , I am facing a similar issue but related to the configuration URL.

ERROR: Exception Primary Reason: [Databricks][JDBCDriver](500051) ERROR processing query/statement. Error Code: 0, SQL state: null, Query: CREATE TABLE `my_catalog`.liquibase_demo_dev.DATABASECHANGELOG (ID VARCHAR(255) NOT NULL, AUTHOR VARCHAR(255) NOT NULL, FILENAME VARCHAR(255) NOT NULL, DATEEXECUTED TIMESTAMP NOT NULL, ORDEREXECUTED INT NOT NULL, EXECTYPE VARCHAR(10) NOT NULL, MD5SUM VARCHAR(35), DESCRIPTION VARCHAR(255), COMMENTS VARCHAR(255), TAG VARCHAR(255), LIQUIBASE VARCHAR(20), CONTEXTS VARCHAR(255), LABELS VARCHAR(255), DEPLOYMENT_ID VARCHAR(10)), Error message from Server: Configuration URL is not available..
ERROR: Exception Primary Source: SparkSQL 3.1.1