Skip to content

#fake table throwing an error on DataBricks #79

@anthonysena

Description

@anthonysena

I got the following error when running Characterization on DataBricks:

DBMS:
spark

Error:
java.sql.SQLException: [Databricks][JDBCDriver](500051) ERROR processing query/statement. Error Code: 0, SQL state: 42601, Query: SELECT `co***, Error message from Server: org.apache.hive.service.cli.HiveSQLException: Error running query: [PARSE_SYNTAX_ERROR] org.apache.spark.sql.catalyst.parser.ParseException: 
[PARSE_SYNTAX_ERROR] Syntax error at or near 'into'. SQLSTATE: 42601 (line 1, pos 43)

== SQL ==
SELECT `condition_era_start_date` as cname into scratch.scratch_asena5.nqlhzylbfake

I traced it back to this code:

-- add dummy code with all imputs to stop annoying warnings
IF OBJECT_ID('tempdb..#fake', 'U') IS NOT NULL
DROP TABLE #fake;
SELECT "@domain_end_date" as cname into #fake;

I think changing to use single quotes from the column name would fix this problem. Additionally, no error was surfaced in the logs - I happened to catch it via the console and the sqlErrorReport.txt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions