Skip to content

IDENTIFIER function failing for analytics plugin #383

@aborsato-metco

Description

@aborsato-metco

"@databricks/appkit": "0.24.0"

Issue

When I create a query list_nation.sql:

SELECT * FROM
IDENTIFIER(:target_catalog || '.redacted.nation')

Then I run npm run dev. It fails with message:

[PARSE_SYNTAX_ERROR] Syntax error at or near '.'. SQLSTATE: 42601
== SQL (line 2, position 1) ==
IDENTIFIER('' || '.redacted.nation')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  Describing 3 queries (3/3)

  Typegen Queries (3)
  ──────────────────────────────────────────────────
  cache MISS   hello_world
  ERROR  list_nation   PARSE_SYNTAX_ERROR
  cache MISS   mocked_sales
  ──────────────────────────────────────────────────
  2 new, 0 from cache, 1 error. 1.52s

file:///home/aborsato/dev/minipack/node_modules/@databricks/appkit/dist/type-generator/index.js:48
                throw new Error([
                      ^

Error: Type generation failed: 1 query could not be described: list_nation.
DESCRIBE QUERY failed for these queries — see the error codes above for details.
Common causes: SQL syntax errors, missing tables/views, or warehouse format incompatibilities.
To debug: run the failing query directly in a SQL editor against warehouse 7bd33a82f4e92206.
    at Module.generateFromEntryPoint (file:///home/redacted/dev/minipack/node_modules/@databricks/appkit/dist/type-generator/index.js:48:9)
    at async Command.runGenerateTypes (file:///home/redacted/dev/minipack/node_modules/@databricks/appkit/dist/cli/commands/generate-types.js:19:5)

Workaround

At this time, there is no workaround I can use to solve it because I can't specify a default catalog and making the query with a hardcoded catalog name will make the code unportable to other environments. I considered adding a template script to generate the .sql files before the compilation but it adds accidental complexity to the build process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions