Skip to content

[BUG]: Teradata conversion - getting error after making changes in base config #2228

@soumyadhasharath

Description

@soumyadhasharath

Is there an existing issue for this?

  • I have searched the existing issues

Category of Bug / Issue

Application crashed

Current Behavior

After making few changes in base config file - base_teradata2databricks_sql.json, transpiler is failing with errors.

Logs:
ERROR [d.l.bladebridge.transpiler] RUN ERROR: Unmatched ( in regex; marked by <-- HERE in m/^(\s*?).\bcatch\s\( <-- HERE / at PERL2EXE_STORAGE/DBCatalog/SQLParser.pm line 2371.
08:43:33 DEBUG [d.l.l.t.lsp.lsp_engine] 08:43:33 ERROR [d.l.bladebridge.transpiler] at PERL2EXE_STORAGE/DBCatalog/SQLParser.pm line 2371.
08:43:33 DEBUG [d.l.l.t.lsp.lsp_engine] 08:43:33 ERROR [d.l.bladebridge.transpiler] DBCatalog::SQLParser::categorize_statement(DBCatalog::SQLParser=HASH(0xc44a908), "MERGE INTO employees_td tgt\x{a}USING employees_stage src\x{a}ON tgt."...) called at PERL2EXE_STORAGE/DBCatalog/SQLParser.pm line 1766
08:43:33 DEBUG [d.l.l.t.lsp.lsp_engine] 08:43:33 ERROR [d.l.bladebridge.transpiler] DBCatalog::SQLParser::analyze_statement(DBCatalog::SQLParser=HASH(0xc44a908), "MERGE INTO employees_td tgt\x{a}USING employees_stage src\x{a}ON tgt."..., 0) called at PERL2EXE_STORAGE/DBCatalog/SQLParser.pm line 1634
08:43:33 DEBUG [d.l.l.t.lsp.lsp_engine] 08:43:33 ERROR [d.l.bladebridge.transpiler] DBCatalog::SQLParser::analyze_file(DBCatalog::SQLParser=HASH(0xc44a908), "C:/Users/user~1.user/AppData/Local/Temp/bladerunner_dfw11k91"...) called at PERL2EXE_STORAGE/DBCatalog/SQLParser.pm line 666
08:43:33 DEBUG [d.l.l.t.lsp.lsp_engine] 08:43:33 ERROR [d.l.bladebridge.transpiler] DBCatalog::SQLParser::normalize_import(DBCatalog::SQLParser=HASH(0xc44a908)) called at (eval 25) line 393
08:43:33 DEBUG [d.l.l.t.lsp.lsp_engine] 08:43:33 ERROR [d.l.bladebridge.transpiler] main::run_converter() called at (eval 26) line 1
08:43:33 DEBUG [d.l.l.t.lsp.lsp_engine] 08:43:33 ERROR [d.l.bladebridge.transpiler] eval 'run_converter()' called at C:\Users\user.user.databricks\labs\remorph-transpilers\bladebridge\lib.venv\Lib\site-packages\databricks\labs\bladebridge\Converter\bin\Windows\dbxconv.exe line 365
08:43:33 DEBUG [d.l.l.t.lsp.lsp_engine] 08:43:33 ERROR [d.l.bladebridge.transpiler]
08:43:33 DEBUG [d.l.l.t.lsp.lsp_engine] 08:43:33 ERROR [d.l.bladebridge.transpiler]
08:43:33 DEBUG [d.l.l.t.lsp.lsp_engine] 08:43:33 ERROR [d.l.bladebridge.transpiler] Conversion failed

Expected Behavior

Conversion should be successful without any error

Steps To Reproduce

  1. Make config changes to comment some of the Teradata commands like BT, ET etc.

  2. Added this regular expression to handle some patterns in line_subst & removed all comments.
    {
    "from": "(?i)Save_Env_Var",
    "to": "-- Save environment variable using Databricks widgets or Python variables"
    },
    {
    "from": "(?i)Create_Timestamped_File",
    "to": "-- Create timestamped file in Databricks (manual handling required)"
    },
    {
    "from": "(?i)(\w+)\s*=\s*date\\s*\\+\"%Y%m%d%H%M%S\"",
    "to": "SET $1 = date_format(current_timestamp(), 'yyyyMMddHHmmss')"
    },

  3. Run the transipler after making changes in base file.

lsp-server.log

Relevant log output or Exception details

Logs Confirmation

  • I ran the command line with --debug
  • I have attached the lsp-server.log under USER_HOME/.databricks/labs/remorph-transpilers/<converter_name>/lib/lsp-server.log

Sample Query

Operating System

Windows

Version

latest via Databricks CLI

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions