spark-sql-language-server 0.0.1-beta.6 → 0.2.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/sparksql-server-worker.js +1 -1
- package/out/sparksql-server-worker.js.map +1 -1
- package/out-tsc/assets/built-in-functions.d.ts +2 -0
- package/out-tsc/assets/built-in-functions.d.ts.map +1 -0
- package/out-tsc/assets/built-in-functions.js +4 -2
- package/out-tsc/assets/built-in-functions.js.map +1 -1
- package/out-tsc/completion-parser.d.ts +11 -0
- package/out-tsc/completion-parser.d.ts.map +1 -0
- package/out-tsc/completion-parser.js +148 -0
- package/out-tsc/completion-parser.js.map +1 -0
- package/out-tsc/constants.d.ts +9 -0
- package/out-tsc/constants.d.ts.map +1 -0
- package/out-tsc/constants.js +12 -0
- package/out-tsc/constants.js.map +1 -0
- package/out-tsc/cursor.d.ts +10 -0
- package/out-tsc/cursor.d.ts.map +1 -0
- package/out-tsc/cursor.js +3 -0
- package/out-tsc/cursor.js.map +1 -1
- package/out-tsc/execute-command.d.ts +7 -0
- package/out-tsc/execute-command.d.ts.map +1 -0
- package/out-tsc/execute-command.js +78 -0
- package/out-tsc/execute-command.js.map +1 -0
- package/out-tsc/execute-commands.d.ts +1 -0
- package/out-tsc/execute-commands.d.ts.map +1 -0
- package/out-tsc/execute-commands.js +3 -4
- package/out-tsc/execute-commands.js.map +1 -1
- package/out-tsc/formatter/boundary-writer.d.ts +30 -0
- package/out-tsc/formatter/boundary-writer.d.ts.map +1 -0
- package/out-tsc/formatter/boundary-writer.js +47 -0
- package/out-tsc/formatter/boundary-writer.js.map +1 -0
- package/out-tsc/formatter/core/comment-helper.d.ts +11 -0
- package/out-tsc/formatter/core/comment-helper.d.ts.map +1 -0
- package/out-tsc/formatter/core/comment-helper.js +139 -0
- package/out-tsc/formatter/core/comment-helper.js.map +1 -0
- package/out-tsc/formatter/core/edit-collector.d.ts +110 -0
- package/out-tsc/formatter/core/edit-collector.d.ts.map +1 -0
- package/out-tsc/formatter/core/edit-collector.js +159 -0
- package/out-tsc/formatter/core/edit-collector.js.map +1 -0
- package/out-tsc/formatter/core/formatting-context.d.ts +183 -0
- package/out-tsc/formatter/core/formatting-context.d.ts.map +1 -0
- package/out-tsc/formatter/core/formatting-context.js +294 -0
- package/out-tsc/formatter/core/formatting-context.js.map +1 -0
- package/out-tsc/formatter/core/index.d.ts +25 -0
- package/out-tsc/formatter/core/index.d.ts.map +1 -0
- package/out-tsc/formatter/core/index.js +57 -0
- package/out-tsc/formatter/core/index.js.map +1 -0
- package/out-tsc/formatter/core/pipeline/formatting-pipeline.d.ts +116 -0
- package/out-tsc/formatter/core/pipeline/formatting-pipeline.d.ts.map +1 -0
- package/out-tsc/formatter/core/pipeline/formatting-pipeline.js +237 -0
- package/out-tsc/formatter/core/pipeline/formatting-pipeline.js.map +1 -0
- package/out-tsc/formatter/core/pipeline/index.d.ts +12 -0
- package/out-tsc/formatter/core/pipeline/index.d.ts.map +1 -0
- package/out-tsc/formatter/core/pipeline/index.js +19 -0
- package/out-tsc/formatter/core/pipeline/index.js.map +1 -0
- package/out-tsc/formatter/core/pipeline/statement-separation.d.ts +5 -0
- package/out-tsc/formatter/core/pipeline/statement-separation.d.ts.map +1 -0
- package/out-tsc/formatter/core/pipeline/statement-separation.js +149 -0
- package/out-tsc/formatter/core/pipeline/statement-separation.js.map +1 -0
- package/out-tsc/formatter/core/rules/index.d.ts +11 -0
- package/out-tsc/formatter/core/rules/index.d.ts.map +1 -0
- package/out-tsc/formatter/core/rules/index.js +29 -0
- package/out-tsc/formatter/core/rules/index.js.map +1 -0
- package/out-tsc/formatter/core/rules/newline-rules.d.ts +169 -0
- package/out-tsc/formatter/core/rules/newline-rules.d.ts.map +1 -0
- package/out-tsc/formatter/core/rules/newline-rules.js +246 -0
- package/out-tsc/formatter/core/rules/newline-rules.js.map +1 -0
- package/out-tsc/formatter/core/rules/spacing-rules.d.ts +150 -0
- package/out-tsc/formatter/core/rules/spacing-rules.d.ts.map +1 -0
- package/out-tsc/formatter/core/rules/spacing-rules.js +219 -0
- package/out-tsc/formatter/core/rules/spacing-rules.js.map +1 -0
- package/out-tsc/formatter/core/strategy-bridge.d.ts +56 -0
- package/out-tsc/formatter/core/strategy-bridge.d.ts.map +1 -0
- package/out-tsc/formatter/core/strategy-bridge.js +159 -0
- package/out-tsc/formatter/core/strategy-bridge.js.map +1 -0
- package/out-tsc/formatter/core/strategy-interface.d.ts +123 -0
- package/out-tsc/formatter/core/strategy-interface.d.ts.map +1 -0
- package/out-tsc/formatter/core/strategy-interface.js +83 -0
- package/out-tsc/formatter/core/strategy-interface.js.map +1 -0
- package/out-tsc/formatter/core/token-helper.d.ts +12 -0
- package/out-tsc/formatter/core/token-helper.d.ts.map +1 -0
- package/out-tsc/formatter/core/token-helper.js +79 -0
- package/out-tsc/formatter/core/token-helper.js.map +1 -0
- package/out-tsc/formatter/core/unicode-utils.d.ts +107 -0
- package/out-tsc/formatter/core/unicode-utils.d.ts.map +1 -0
- package/out-tsc/formatter/core/unicode-utils.js +181 -0
- package/out-tsc/formatter/core/unicode-utils.js.map +1 -0
- package/out-tsc/formatter/core/whitespace-writer.d.ts +20 -0
- package/out-tsc/formatter/core/whitespace-writer.d.ts.map +1 -0
- package/out-tsc/formatter/core/whitespace-writer.js +86 -0
- package/out-tsc/formatter/core/whitespace-writer.js.map +1 -0
- package/out-tsc/formatter/formatter-adapter.d.ts +56 -0
- package/out-tsc/formatter/formatter-adapter.d.ts.map +1 -0
- package/out-tsc/formatter/formatter-adapter.js +719 -0
- package/out-tsc/formatter/formatter-adapter.js.map +1 -0
- package/out-tsc/formatter/index.d.ts +16 -0
- package/out-tsc/formatter/index.d.ts.map +1 -0
- package/out-tsc/formatter/index.js +43 -0
- package/out-tsc/formatter/index.js.map +1 -0
- package/out-tsc/formatter/pipe-step-classifier.d.ts +9 -0
- package/out-tsc/formatter/pipe-step-classifier.d.ts.map +1 -0
- package/out-tsc/formatter/pipe-step-classifier.js +49 -0
- package/out-tsc/formatter/pipe-step-classifier.js.map +1 -0
- package/out-tsc/formatter/state.d.ts +10 -0
- package/out-tsc/formatter/state.d.ts.map +1 -0
- package/out-tsc/formatter/state.js +12 -0
- package/out-tsc/formatter/state.js.map +1 -0
- package/out-tsc/formatter/strategies/block.strategy.d.ts +191 -0
- package/out-tsc/formatter/strategies/block.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/block.strategy.js +238 -0
- package/out-tsc/formatter/strategies/block.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/clause-head-body.strategy.d.ts +17 -0
- package/out-tsc/formatter/strategies/clause-head-body.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/clause-head-body.strategy.js +13 -0
- package/out-tsc/formatter/strategies/clause-head-body.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/ddl/alter-table-extended.strategy.d.ts +68 -0
- package/out-tsc/formatter/strategies/ddl/alter-table-extended.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/ddl/alter-table-extended.strategy.js +242 -0
- package/out-tsc/formatter/strategies/ddl/alter-table-extended.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/ddl/alter-table.strategy.d.ts +146 -0
- package/out-tsc/formatter/strategies/ddl/alter-table.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/ddl/alter-table.strategy.js +578 -0
- package/out-tsc/formatter/strategies/ddl/alter-table.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/ddl/create-table.strategy.d.ts +103 -0
- package/out-tsc/formatter/strategies/ddl/create-table.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/ddl/create-table.strategy.js +659 -0
- package/out-tsc/formatter/strategies/ddl/create-table.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/ddl/create-view-function.strategy.d.ts +64 -0
- package/out-tsc/formatter/strategies/ddl/create-view-function.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/ddl/create-view-function.strategy.js +402 -0
- package/out-tsc/formatter/strategies/ddl/create-view-function.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/ddl/drop-utility.strategy.d.ts +119 -0
- package/out-tsc/formatter/strategies/ddl/drop-utility.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/ddl/drop-utility.strategy.js +863 -0
- package/out-tsc/formatter/strategies/ddl/drop-utility.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/ddl/index.d.ts +17 -0
- package/out-tsc/formatter/strategies/ddl/index.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/ddl/index.js +57 -0
- package/out-tsc/formatter/strategies/ddl/index.js.map +1 -0
- package/out-tsc/formatter/strategies/ddl/namespace-catalog.strategy.d.ts +26 -0
- package/out-tsc/formatter/strategies/ddl/namespace-catalog.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/ddl/namespace-catalog.strategy.js +77 -0
- package/out-tsc/formatter/strategies/ddl/namespace-catalog.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/ddl/pipeline.strategy.d.ts +99 -0
- package/out-tsc/formatter/strategies/ddl/pipeline.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/ddl/pipeline.strategy.js +385 -0
- package/out-tsc/formatter/strategies/ddl/pipeline.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/ddl/set-reset-config.strategy.d.ts +48 -0
- package/out-tsc/formatter/strategies/ddl/set-reset-config.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/ddl/set-reset-config.strategy.js +145 -0
- package/out-tsc/formatter/strategies/ddl/set-reset-config.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/ddl/show-utility.strategy.d.ts +71 -0
- package/out-tsc/formatter/strategies/ddl/show-utility.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/ddl/show-utility.strategy.js +196 -0
- package/out-tsc/formatter/strategies/ddl/show-utility.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/dml/index.d.ts +10 -0
- package/out-tsc/formatter/strategies/dml/index.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/dml/index.js +35 -0
- package/out-tsc/formatter/strategies/dml/index.js.map +1 -0
- package/out-tsc/formatter/strategies/dml/insert-update-delete.strategy.d.ts +113 -0
- package/out-tsc/formatter/strategies/dml/insert-update-delete.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/dml/insert-update-delete.strategy.js +438 -0
- package/out-tsc/formatter/strategies/dml/insert-update-delete.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/dml/select-clause.strategy.d.ts +76 -0
- package/out-tsc/formatter/strategies/dml/select-clause.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/dml/select-clause.strategy.js +480 -0
- package/out-tsc/formatter/strategies/dml/select-clause.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/expression/function-call.strategy.d.ts +50 -0
- package/out-tsc/formatter/strategies/expression/function-call.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/expression/function-call.strategy.js +319 -0
- package/out-tsc/formatter/strategies/expression/function-call.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/expression/index.d.ts +18 -0
- package/out-tsc/formatter/strategies/expression/index.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/expression/index.js +51 -0
- package/out-tsc/formatter/strategies/expression/index.js.map +1 -0
- package/out-tsc/formatter/strategies/expression/logical-comparison.strategy.d.ts +55 -0
- package/out-tsc/formatter/strategies/expression/logical-comparison.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/expression/logical-comparison.strategy.js +266 -0
- package/out-tsc/formatter/strategies/expression/logical-comparison.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/expression/subquery-parenthesis.strategy.d.ts +38 -0
- package/out-tsc/formatter/strategies/expression/subquery-parenthesis.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/expression/subquery-parenthesis.strategy.js +397 -0
- package/out-tsc/formatter/strategies/expression/subquery-parenthesis.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/function-call.strategy.d.ts +80 -0
- package/out-tsc/formatter/strategies/function-call.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/function-call.strategy.js +136 -0
- package/out-tsc/formatter/strategies/function-call.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/index.d.ts +87 -0
- package/out-tsc/formatter/strategies/index.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/index.js +121 -0
- package/out-tsc/formatter/strategies/index.js.map +1 -0
- package/out-tsc/formatter/strategies/join.strategy.d.ts +31 -0
- package/out-tsc/formatter/strategies/join.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/join.strategy.js +29 -0
- package/out-tsc/formatter/strategies/join.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/keyword.strategy.d.ts +82 -0
- package/out-tsc/formatter/strategies/keyword.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/keyword.strategy.js +129 -0
- package/out-tsc/formatter/strategies/keyword.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/list.strategy.d.ts +159 -0
- package/out-tsc/formatter/strategies/list.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/list.strategy.js +193 -0
- package/out-tsc/formatter/strategies/list.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/pipe-aggregate.strategy.d.ts +24 -0
- package/out-tsc/formatter/strategies/pipe-aggregate.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/pipe-aggregate.strategy.js +47 -0
- package/out-tsc/formatter/strategies/pipe-aggregate.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/pipe-drop.strategy.d.ts +21 -0
- package/out-tsc/formatter/strategies/pipe-drop.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/pipe-drop.strategy.js +52 -0
- package/out-tsc/formatter/strategies/pipe-drop.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/pipe-extend.strategy.d.ts +21 -0
- package/out-tsc/formatter/strategies/pipe-extend.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/pipe-extend.strategy.js +45 -0
- package/out-tsc/formatter/strategies/pipe-extend.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/pipe-join.strategy.d.ts +22 -0
- package/out-tsc/formatter/strategies/pipe-join.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/pipe-join.strategy.js +42 -0
- package/out-tsc/formatter/strategies/pipe-join.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/pipe-pivot.strategy.d.ts +7 -0
- package/out-tsc/formatter/strategies/pipe-pivot.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/pipe-pivot.strategy.js +34 -0
- package/out-tsc/formatter/strategies/pipe-pivot.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/pipe-query-organization.strategy.d.ts +7 -0
- package/out-tsc/formatter/strategies/pipe-query-organization.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/pipe-query-organization.strategy.js +14 -0
- package/out-tsc/formatter/strategies/pipe-query-organization.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/pipe-sample.strategy.d.ts +7 -0
- package/out-tsc/formatter/strategies/pipe-sample.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/pipe-sample.strategy.js +18 -0
- package/out-tsc/formatter/strategies/pipe-sample.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/pipe-select.strategy.d.ts +22 -0
- package/out-tsc/formatter/strategies/pipe-select.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/pipe-select.strategy.js +51 -0
- package/out-tsc/formatter/strategies/pipe-select.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/pipe-set-operation.strategy.d.ts +7 -0
- package/out-tsc/formatter/strategies/pipe-set-operation.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/pipe-set-operation.strategy.js +30 -0
- package/out-tsc/formatter/strategies/pipe-set-operation.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/pipe-set.strategy.d.ts +21 -0
- package/out-tsc/formatter/strategies/pipe-set.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/pipe-set.strategy.js +52 -0
- package/out-tsc/formatter/strategies/pipe-set.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/pipe-step.strategy.d.ts +25 -0
- package/out-tsc/formatter/strategies/pipe-step.strategy.d.ts.map +1 -0
- package/out-tsc/{lib/SparkSqlParserVisitor.js → formatter/strategies/pipe-step.strategy.js} +1 -1
- package/out-tsc/formatter/strategies/pipe-step.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/pipe-unpivot.strategy.d.ts +7 -0
- package/out-tsc/formatter/strategies/pipe-unpivot.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/pipe-unpivot.strategy.js +33 -0
- package/out-tsc/formatter/strategies/pipe-unpivot.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/pipe-where.strategy.d.ts +21 -0
- package/out-tsc/formatter/strategies/pipe-where.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/pipe-where.strategy.js +44 -0
- package/out-tsc/formatter/strategies/pipe-where.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/procedure/case-statement.strategy.d.ts +20 -0
- package/out-tsc/formatter/strategies/procedure/case-statement.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/procedure/case-statement.strategy.js +132 -0
- package/out-tsc/formatter/strategies/procedure/case-statement.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/procedure/compound-statement.strategy.d.ts +43 -0
- package/out-tsc/formatter/strategies/procedure/compound-statement.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/procedure/compound-statement.strategy.js +174 -0
- package/out-tsc/formatter/strategies/procedure/compound-statement.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/procedure/handler.strategy.d.ts +23 -0
- package/out-tsc/formatter/strategies/procedure/handler.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/procedure/handler.strategy.js +81 -0
- package/out-tsc/formatter/strategies/procedure/handler.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/procedure/if-else.strategy.d.ts +19 -0
- package/out-tsc/formatter/strategies/procedure/if-else.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/procedure/if-else.strategy.js +80 -0
- package/out-tsc/formatter/strategies/procedure/if-else.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/procedure/index.d.ts +27 -0
- package/out-tsc/formatter/strategies/procedure/index.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/procedure/index.js +63 -0
- package/out-tsc/formatter/strategies/procedure/index.js.map +1 -0
- package/out-tsc/formatter/strategies/procedure/leave-iterate.strategy.d.ts +19 -0
- package/out-tsc/formatter/strategies/procedure/leave-iterate.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/procedure/leave-iterate.strategy.js +54 -0
- package/out-tsc/formatter/strategies/procedure/leave-iterate.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/procedure/loop.strategy.d.ts +71 -0
- package/out-tsc/formatter/strategies/procedure/loop.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/procedure/loop.strategy.js +216 -0
- package/out-tsc/formatter/strategies/procedure/loop.strategy.js.map +1 -0
- package/out-tsc/formatter/strategy-based-formatter.d.ts +329 -0
- package/out-tsc/formatter/strategy-based-formatter.d.ts.map +1 -0
- package/out-tsc/formatter/strategy-based-formatter.js +3808 -0
- package/out-tsc/formatter/strategy-based-formatter.js.map +1 -0
- package/out-tsc/formatter/strategy-dispatcher.d.ts +24 -0
- package/out-tsc/formatter/strategy-dispatcher.d.ts.map +1 -0
- package/out-tsc/formatter/strategy-dispatcher.js +19 -0
- package/out-tsc/formatter/strategy-dispatcher.js.map +1 -0
- package/out-tsc/formatter/types.d.ts +2 -0
- package/out-tsc/formatter/types.d.ts.map +1 -0
- package/out-tsc/{lib/SparkSqlParserListener.js → formatter/types.js} +1 -1
- package/out-tsc/formatter/types.js.map +1 -0
- package/out-tsc/formatter/visitor/ddl/alter-table.d.ts +48 -0
- package/out-tsc/formatter/visitor/ddl/alter-table.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/ddl/alter-table.js +133 -0
- package/out-tsc/formatter/visitor/ddl/alter-table.js.map +1 -0
- package/out-tsc/formatter/visitor/ddl/create-table.d.ts +54 -0
- package/out-tsc/formatter/visitor/ddl/create-table.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/ddl/create-table.js +142 -0
- package/out-tsc/formatter/visitor/ddl/create-table.js.map +1 -0
- package/out-tsc/formatter/visitor/ddl/create-view.d.ts +27 -0
- package/out-tsc/formatter/visitor/ddl/create-view.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/ddl/create-view.js +61 -0
- package/out-tsc/formatter/visitor/ddl/create-view.js.map +1 -0
- package/out-tsc/formatter/visitor/ddl/drop.d.ts +30 -0
- package/out-tsc/formatter/visitor/ddl/drop.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/ddl/drop.js +69 -0
- package/out-tsc/formatter/visitor/ddl/drop.js.map +1 -0
- package/out-tsc/formatter/visitor/ddl/index.d.ts +10 -0
- package/out-tsc/formatter/visitor/ddl/index.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/ddl/index.js +26 -0
- package/out-tsc/formatter/visitor/ddl/index.js.map +1 -0
- package/out-tsc/formatter/visitor/dml/delete.d.ts +26 -0
- package/out-tsc/formatter/visitor/dml/delete.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/dml/delete.js +38 -0
- package/out-tsc/formatter/visitor/dml/delete.js.map +1 -0
- package/out-tsc/formatter/visitor/dml/index.d.ts +10 -0
- package/out-tsc/formatter/visitor/dml/index.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/dml/index.js +26 -0
- package/out-tsc/formatter/visitor/dml/index.js.map +1 -0
- package/out-tsc/formatter/visitor/dml/insert.d.ts +42 -0
- package/out-tsc/formatter/visitor/dml/insert.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/dml/insert.js +112 -0
- package/out-tsc/formatter/visitor/dml/insert.js.map +1 -0
- package/out-tsc/formatter/visitor/dml/merge.d.ts +40 -0
- package/out-tsc/formatter/visitor/dml/merge.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/dml/merge.js +67 -0
- package/out-tsc/formatter/visitor/dml/merge.js.map +1 -0
- package/out-tsc/formatter/visitor/dml/update.d.ts +33 -0
- package/out-tsc/formatter/visitor/dml/update.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/dml/update.js +49 -0
- package/out-tsc/formatter/visitor/dml/update.js.map +1 -0
- package/out-tsc/formatter/visitor/expression/arithmetic.d.ts +20 -0
- package/out-tsc/formatter/visitor/expression/arithmetic.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/expression/arithmetic.js +44 -0
- package/out-tsc/formatter/visitor/expression/arithmetic.js.map +1 -0
- package/out-tsc/formatter/visitor/expression/case-when.d.ts +41 -0
- package/out-tsc/formatter/visitor/expression/case-when.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/expression/case-when.js +94 -0
- package/out-tsc/formatter/visitor/expression/case-when.js.map +1 -0
- package/out-tsc/formatter/visitor/expression/comparison.d.ts +20 -0
- package/out-tsc/formatter/visitor/expression/comparison.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/expression/comparison.js +26 -0
- package/out-tsc/formatter/visitor/expression/comparison.js.map +1 -0
- package/out-tsc/formatter/visitor/expression/function-call.d.ts +20 -0
- package/out-tsc/formatter/visitor/expression/function-call.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/expression/function-call.js +33 -0
- package/out-tsc/formatter/visitor/expression/function-call.js.map +1 -0
- package/out-tsc/formatter/visitor/expression/index.d.ts +11 -0
- package/out-tsc/formatter/visitor/expression/index.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/expression/index.js +27 -0
- package/out-tsc/formatter/visitor/expression/index.js.map +1 -0
- package/out-tsc/formatter/visitor/expression/logical.d.ts +26 -0
- package/out-tsc/formatter/visitor/expression/logical.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/expression/logical.js +46 -0
- package/out-tsc/formatter/visitor/expression/logical.js.map +1 -0
- package/out-tsc/formatter/visitor/formatter-core.d.ts +79 -0
- package/out-tsc/formatter/visitor/formatter-core.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/formatter-core.js +211 -0
- package/out-tsc/formatter/visitor/formatter-core.js.map +1 -0
- package/out-tsc/formatter/visitor/index.d.ts +21 -0
- package/out-tsc/formatter/visitor/index.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/index.js +26 -0
- package/out-tsc/formatter/visitor/index.js.map +1 -0
- package/out-tsc/formatter/visitor/management/cache.d.ts +26 -0
- package/out-tsc/formatter/visitor/management/cache.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/management/cache.js +58 -0
- package/out-tsc/formatter/visitor/management/cache.js.map +1 -0
- package/out-tsc/formatter/visitor/management/index.d.ts +8 -0
- package/out-tsc/formatter/visitor/management/index.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/management/index.js +24 -0
- package/out-tsc/formatter/visitor/management/index.js.map +1 -0
- package/out-tsc/formatter/visitor/management/refresh.d.ts +26 -0
- package/out-tsc/formatter/visitor/management/refresh.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/management/refresh.js +55 -0
- package/out-tsc/formatter/visitor/management/refresh.js.map +1 -0
- package/out-tsc/formatter/visitor/pipeline/delta-live-tables.d.ts +31 -0
- package/out-tsc/formatter/visitor/pipeline/delta-live-tables.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/pipeline/delta-live-tables.js +46 -0
- package/out-tsc/formatter/visitor/pipeline/delta-live-tables.js.map +1 -0
- package/out-tsc/formatter/visitor/pipeline/index.d.ts +7 -0
- package/out-tsc/formatter/visitor/pipeline/index.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/pipeline/index.js +23 -0
- package/out-tsc/formatter/visitor/pipeline/index.js.map +1 -0
- package/out-tsc/formatter/visitor/query/cte.d.ts +34 -0
- package/out-tsc/formatter/visitor/query/cte.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/query/cte.js +54 -0
- package/out-tsc/formatter/visitor/query/cte.js.map +1 -0
- package/out-tsc/formatter/visitor/query/index.d.ts +11 -0
- package/out-tsc/formatter/visitor/query/index.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/query/index.js +27 -0
- package/out-tsc/formatter/visitor/query/index.js.map +1 -0
- package/out-tsc/formatter/visitor/query/query-organization.d.ts +25 -0
- package/out-tsc/formatter/visitor/query/query-organization.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/query/query-organization.js +75 -0
- package/out-tsc/formatter/visitor/query/query-organization.js.map +1 -0
- package/out-tsc/formatter/visitor/query/query.d.ts +22 -0
- package/out-tsc/formatter/visitor/query/query.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/query/query.js +30 -0
- package/out-tsc/formatter/visitor/query/query.js.map +1 -0
- package/out-tsc/formatter/visitor/query/select-clause.d.ts +17 -0
- package/out-tsc/formatter/visitor/query/select-clause.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/query/select-clause.js +35 -0
- package/out-tsc/formatter/visitor/query/select-clause.js.map +1 -0
- package/out-tsc/formatter/visitor/query/set-operation.d.ts +25 -0
- package/out-tsc/formatter/visitor/query/set-operation.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/query/set-operation.js +52 -0
- package/out-tsc/formatter/visitor/query/set-operation.js.map +1 -0
- package/out-tsc/formatter/visitor/statements/index.d.ts +7 -0
- package/out-tsc/formatter/visitor/statements/index.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/statements/index.js +23 -0
- package/out-tsc/formatter/visitor/statements/index.js.map +1 -0
- package/out-tsc/formatter/visitor/statements/program.d.ts +33 -0
- package/out-tsc/formatter/visitor/statements/program.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/statements/program.js +69 -0
- package/out-tsc/formatter/visitor/statements/program.js.map +1 -0
- package/out-tsc/formatter/visitor/types/complex-types.d.ts +24 -0
- package/out-tsc/formatter/visitor/types/complex-types.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/types/complex-types.js +47 -0
- package/out-tsc/formatter/visitor/types/complex-types.js.map +1 -0
- package/out-tsc/formatter/visitor/types/index.d.ts +8 -0
- package/out-tsc/formatter/visitor/types/index.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/types/index.js +24 -0
- package/out-tsc/formatter/visitor/types/index.js.map +1 -0
- package/out-tsc/formatter/visitor/types/primitive-types.d.ts +22 -0
- package/out-tsc/formatter/visitor/types/primitive-types.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/types/primitive-types.js +37 -0
- package/out-tsc/formatter/visitor/types/primitive-types.js.map +1 -0
- package/out-tsc/formatter/visitor/utils/context-helpers.d.ts +32 -0
- package/out-tsc/formatter/visitor/utils/context-helpers.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/utils/context-helpers.js +98 -0
- package/out-tsc/formatter/visitor/utils/context-helpers.js.map +1 -0
- package/out-tsc/formatter/visitor/utils/index.d.ts +11 -0
- package/out-tsc/formatter/visitor/utils/index.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/utils/index.js +45 -0
- package/out-tsc/formatter/visitor/utils/index.js.map +1 -0
- package/out-tsc/formatter/visitor/utils/keyword-formatting.d.ts +57 -0
- package/out-tsc/formatter/visitor/utils/keyword-formatting.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/utils/keyword-formatting.js +87 -0
- package/out-tsc/formatter/visitor/utils/keyword-formatting.js.map +1 -0
- package/out-tsc/formatter/visitor/utils/parenthesis-formatting.d.ts +53 -0
- package/out-tsc/formatter/visitor/utils/parenthesis-formatting.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/utils/parenthesis-formatting.js +88 -0
- package/out-tsc/formatter/visitor/utils/parenthesis-formatting.js.map +1 -0
- package/out-tsc/formatter/visitor/utils/space-compression.d.ts +55 -0
- package/out-tsc/formatter/visitor/utils/space-compression.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/utils/space-compression.js +71 -0
- package/out-tsc/formatter/visitor/utils/space-compression.js.map +1 -0
- package/out-tsc/formatter/visitor/utils/token-helpers.d.ts +64 -0
- package/out-tsc/formatter/visitor/utils/token-helpers.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/utils/token-helpers.js +249 -0
- package/out-tsc/formatter/visitor/utils/token-helpers.js.map +1 -0
- package/out-tsc/index.d.ts +2 -1
- package/out-tsc/index.d.ts.map +1 -0
- package/out-tsc/index.js +3 -1
- package/out-tsc/index.js.map +1 -1
- package/out-tsc/lib/SparkSQLLexer.d.ts +557 -0
- package/out-tsc/lib/SparkSQLLexer.d.ts.map +1 -0
- package/out-tsc/lib/SparkSQLLexer.js +3676 -0
- package/out-tsc/lib/SparkSQLLexer.js.map +1 -0
- package/out-tsc/lib/SparkSQLParser.d.ts +7884 -0
- package/out-tsc/lib/SparkSQLParser.d.ts.map +1 -0
- package/out-tsc/lib/SparkSQLParser.js +45848 -0
- package/out-tsc/lib/SparkSQLParser.js.map +1 -0
- package/out-tsc/lib/SparkSQLParserListener.d.ts +5855 -0
- package/out-tsc/lib/SparkSQLParserListener.d.ts.map +1 -0
- package/out-tsc/lib/SparkSQLParserListener.js +4 -0
- package/out-tsc/lib/SparkSQLParserListener.js.map +1 -0
- package/out-tsc/lib/SparkSQLParserVisitor.d.ts +3674 -0
- package/out-tsc/lib/SparkSQLParserVisitor.d.ts.map +1 -0
- package/out-tsc/lib/SparkSQLParserVisitor.js +4 -0
- package/out-tsc/lib/SparkSQLParserVisitor.js.map +1 -0
- package/out-tsc/lineage.typing.d.ts +64 -0
- package/out-tsc/lineage.typing.d.ts.map +1 -0
- package/out-tsc/lineage.typing.js +3 -0
- package/out-tsc/lineage.typing.js.map +1 -0
- package/out-tsc/listeners/parse-error.listener.d.ts +3 -2
- package/out-tsc/listeners/parse-error.listener.d.ts.map +1 -0
- package/out-tsc/listeners/parse-error.listener.js +4 -4
- package/out-tsc/listeners/parse-error.listener.js.map +1 -1
- package/out-tsc/listeners/schema.listener.d.ts +32 -39
- package/out-tsc/listeners/schema.listener.d.ts.map +1 -0
- package/out-tsc/listeners/schema.listener.js +58 -100
- package/out-tsc/listeners/schema.listener.js.map +1 -1
- package/out-tsc/listeners/statement.listener.d.ts +263 -5
- package/out-tsc/listeners/statement.listener.d.ts.map +1 -0
- package/out-tsc/listeners/statement.listener.js +836 -11
- package/out-tsc/listeners/statement.listener.js.map +1 -1
- package/out-tsc/listeners/structure.listener.d.ts +70 -0
- package/out-tsc/listeners/structure.listener.d.ts.map +1 -0
- package/out-tsc/listeners/structure.listener.js +211 -0
- package/out-tsc/listeners/structure.listener.js.map +1 -0
- package/out-tsc/listeners/tokens-collector.listener.d.ts +27 -0
- package/out-tsc/listeners/tokens-collector.listener.d.ts.map +1 -0
- package/out-tsc/listeners/tokens-collector.listener.js +102 -0
- package/out-tsc/listeners/tokens-collector.listener.js.map +1 -0
- package/out-tsc/lsp-server.d.ts +79 -8
- package/out-tsc/lsp-server.d.ts.map +1 -0
- package/out-tsc/lsp-server.js +672 -237
- package/out-tsc/lsp-server.js.map +1 -1
- package/out-tsc/metadata.typing.d.ts +1 -0
- package/out-tsc/metadata.typing.d.ts.map +1 -0
- package/out-tsc/monaco-config.d.ts +219 -0
- package/out-tsc/monaco-config.d.ts.map +1 -0
- package/out-tsc/monaco-config.js +1032 -0
- package/out-tsc/monaco-config.js.map +1 -0
- package/out-tsc/parsing-warehouse.d.ts +8 -3
- package/out-tsc/parsing-warehouse.d.ts.map +1 -0
- package/out-tsc/parsing-warehouse.js +62 -6
- package/out-tsc/parsing-warehouse.js.map +1 -1
- package/out-tsc/protocol-translation.d.ts +12 -5
- package/out-tsc/protocol-translation.d.ts.map +1 -0
- package/out-tsc/protocol-translation.js +72 -19
- package/out-tsc/protocol-translation.js.map +1 -1
- package/out-tsc/public-apis.d.ts +1 -0
- package/out-tsc/public-apis.d.ts.map +1 -0
- package/out-tsc/schema-registry.d.ts +10 -7
- package/out-tsc/schema-registry.d.ts.map +1 -0
- package/out-tsc/schema-registry.js +87 -106
- package/out-tsc/schema-registry.js.map +1 -1
- package/out-tsc/server-worker.d.ts +1 -0
- package/out-tsc/server-worker.d.ts.map +1 -0
- package/out-tsc/server-worker.js +159 -44
- package/out-tsc/server-worker.js.map +1 -1
- package/out-tsc/tests/folding/block-comment-folding.test.d.ts +7 -0
- package/out-tsc/tests/folding/block-comment-folding.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/block-comment-folding.test.js +268 -0
- package/out-tsc/tests/folding/block-comment-folding.test.js.map +1 -0
- package/out-tsc/tests/folding/caching.test.d.ts +11 -0
- package/out-tsc/tests/folding/caching.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/caching.test.js +141 -0
- package/out-tsc/tests/folding/caching.test.js.map +1 -0
- package/out-tsc/tests/folding/cte-dependency-chain.test.d.ts +15 -0
- package/out-tsc/tests/folding/cte-dependency-chain.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/cte-dependency-chain.test.js +323 -0
- package/out-tsc/tests/folding/cte-dependency-chain.test.js.map +1 -0
- package/out-tsc/tests/folding/debug-format-flow.test.d.ts +2 -0
- package/out-tsc/tests/folding/debug-format-flow.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/debug-format-flow.test.js +114 -0
- package/out-tsc/tests/folding/debug-format-flow.test.js.map +1 -0
- package/out-tsc/tests/folding/debug-formatted.test.d.ts +2 -0
- package/out-tsc/tests/folding/debug-formatted.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/debug-formatted.test.js +175 -0
- package/out-tsc/tests/folding/debug-formatted.test.js.map +1 -0
- package/out-tsc/tests/folding/deduplication.test.d.ts +10 -0
- package/out-tsc/tests/folding/deduplication.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/deduplication.test.js +206 -0
- package/out-tsc/tests/folding/deduplication.test.js.map +1 -0
- package/out-tsc/tests/folding/edge-cases.test.d.ts +8 -0
- package/out-tsc/tests/folding/edge-cases.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/edge-cases.test.js +319 -0
- package/out-tsc/tests/folding/edge-cases.test.js.map +1 -0
- package/out-tsc/tests/folding/folding-level-config.test.d.ts +11 -0
- package/out-tsc/tests/folding/folding-level-config.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/folding-level-config.test.js +313 -0
- package/out-tsc/tests/folding/folding-level-config.test.js.map +1 -0
- package/out-tsc/tests/folding/folding-statistics.test.d.ts +13 -0
- package/out-tsc/tests/folding/folding-statistics.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/folding-statistics.test.js +144 -0
- package/out-tsc/tests/folding/folding-statistics.test.js.map +1 -0
- package/out-tsc/tests/folding/index.d.ts +8 -0
- package/out-tsc/tests/folding/index.d.ts.map +1 -0
- package/out-tsc/tests/folding/index.js +24 -0
- package/out-tsc/tests/folding/index.js.map +1 -0
- package/out-tsc/tests/folding/join-folding.test.d.ts +11 -0
- package/out-tsc/tests/folding/join-folding.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/join-folding.test.js +167 -0
- package/out-tsc/tests/folding/join-folding.test.js.map +1 -0
- package/out-tsc/tests/folding/kind-classification.test.d.ts +11 -0
- package/out-tsc/tests/folding/kind-classification.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/kind-classification.test.js +270 -0
- package/out-tsc/tests/folding/kind-classification.test.js.map +1 -0
- package/out-tsc/tests/folding/level1-statement.test.d.ts +8 -0
- package/out-tsc/tests/folding/level1-statement.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/level1-statement.test.js +278 -0
- package/out-tsc/tests/folding/level1-statement.test.js.map +1 -0
- package/out-tsc/tests/folding/level2-query-block.test.d.ts +8 -0
- package/out-tsc/tests/folding/level2-query-block.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/level2-query-block.test.js +374 -0
- package/out-tsc/tests/folding/level2-query-block.test.js.map +1 -0
- package/out-tsc/tests/folding/level3-expression.test.d.ts +8 -0
- package/out-tsc/tests/folding/level3-expression.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/level3-expression.test.js +361 -0
- package/out-tsc/tests/folding/level3-expression.test.js.map +1 -0
- package/out-tsc/tests/folding/level4-structure.test.d.ts +8 -0
- package/out-tsc/tests/folding/level4-structure.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/level4-structure.test.js +270 -0
- package/out-tsc/tests/folding/level4-structure.test.js.map +1 -0
- package/out-tsc/tests/folding/line-comment-folding.test.d.ts +13 -0
- package/out-tsc/tests/folding/line-comment-folding.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/line-comment-folding.test.js +215 -0
- package/out-tsc/tests/folding/line-comment-folding.test.js.map +1 -0
- package/out-tsc/tests/folding/nested-folding.test.d.ts +8 -0
- package/out-tsc/tests/folding/nested-folding.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/nested-folding.test.js +386 -0
- package/out-tsc/tests/folding/nested-folding.test.js.map +1 -0
- package/out-tsc/tests/folding/performance-benchmark.test.d.ts +11 -0
- package/out-tsc/tests/folding/performance-benchmark.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/performance-benchmark.test.js +256 -0
- package/out-tsc/tests/folding/performance-benchmark.test.js.map +1 -0
- package/out-tsc/tests/folding/region-marker-folding.test.d.ts +11 -0
- package/out-tsc/tests/folding/region-marker-folding.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/region-marker-folding.test.js +245 -0
- package/out-tsc/tests/folding/region-marker-folding.test.js.map +1 -0
- package/out-tsc/tests/folding/select-columns-folding.test.d.ts +10 -0
- package/out-tsc/tests/folding/select-columns-folding.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/select-columns-folding.test.js +139 -0
- package/out-tsc/tests/folding/select-columns-folding.test.js.map +1 -0
- package/out-tsc/tests/folding/test-utils.d.ts +73 -0
- package/out-tsc/tests/folding/test-utils.d.ts.map +1 -0
- package/out-tsc/tests/folding/test-utils.js +98 -0
- package/out-tsc/tests/folding/test-utils.js.map +1 -0
- package/out-tsc/tests/folding/values-folding.test.d.ts +10 -0
- package/out-tsc/tests/folding/values-folding.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/values-folding.test.js +102 -0
- package/out-tsc/tests/folding/values-folding.test.js.map +1 -0
- package/out-tsc/tests/format/ddl/datatype-constraint.test.d.ts +5 -0
- package/out-tsc/tests/format/ddl/datatype-constraint.test.d.ts.map +1 -0
- package/out-tsc/tests/format/ddl/datatype-constraint.test.js +132 -0
- package/out-tsc/tests/format/ddl/datatype-constraint.test.js.map +1 -0
- package/out-tsc/tests/format/ddl/index.test.d.ts +5 -0
- package/out-tsc/tests/format/ddl/index.test.d.ts.map +1 -0
- package/out-tsc/tests/format/ddl/index.test.js +74 -0
- package/out-tsc/tests/format/ddl/index.test.js.map +1 -0
- package/out-tsc/tests/format/ddl/materialized-view.test.d.ts +5 -0
- package/out-tsc/tests/format/ddl/materialized-view.test.d.ts.map +1 -0
- package/out-tsc/tests/format/ddl/materialized-view.test.js +92 -0
- package/out-tsc/tests/format/ddl/materialized-view.test.js.map +1 -0
- package/out-tsc/tests/format/ddl/partition.test.d.ts +5 -0
- package/out-tsc/tests/format/ddl/partition.test.d.ts.map +1 -0
- package/out-tsc/tests/format/ddl/partition.test.js +109 -0
- package/out-tsc/tests/format/ddl/partition.test.js.map +1 -0
- package/out-tsc/tests/format/ddl/variable.test.d.ts +5 -0
- package/out-tsc/tests/format/ddl/variable.test.d.ts.map +1 -0
- package/out-tsc/tests/format/ddl/variable.test.js +58 -0
- package/out-tsc/tests/format/ddl/variable.test.js.map +1 -0
- package/out-tsc/tests/format/dml/select.test.d.ts +5 -0
- package/out-tsc/tests/format/dml/select.test.d.ts.map +1 -0
- package/out-tsc/tests/format/dml/select.test.js +114 -0
- package/out-tsc/tests/format/dml/select.test.js.map +1 -0
- package/out-tsc/tests/format/dml/subquery.test.d.ts +5 -0
- package/out-tsc/tests/format/dml/subquery.test.d.ts.map +1 -0
- package/out-tsc/tests/format/dml/subquery.test.js +221 -0
- package/out-tsc/tests/format/dml/subquery.test.js.map +1 -0
- package/out-tsc/tests/format/dql/comment.test.d.ts +7 -0
- package/out-tsc/tests/format/dql/comment.test.d.ts.map +1 -0
- package/out-tsc/tests/format/dql/comment.test.js +279 -0
- package/out-tsc/tests/format/dql/comment.test.js.map +1 -0
- package/out-tsc/tests/format/dql/cte.test.d.ts +7 -0
- package/out-tsc/tests/format/dql/cte.test.d.ts.map +1 -0
- package/out-tsc/tests/format/dql/cte.test.js +31 -0
- package/out-tsc/tests/format/dql/cte.test.js.map +1 -0
- package/out-tsc/tests/format/dql/dql-detail.test.d.ts +5 -0
- package/out-tsc/tests/format/dql/dql-detail.test.d.ts.map +1 -0
- package/out-tsc/tests/format/dql/dql-detail.test.js +191 -0
- package/out-tsc/tests/format/dql/dql-detail.test.js.map +1 -0
- package/out-tsc/tests/format/dql/lateral-view.test.d.ts +7 -0
- package/out-tsc/tests/format/dql/lateral-view.test.d.ts.map +1 -0
- package/out-tsc/tests/format/dql/lateral-view.test.js +34 -0
- package/out-tsc/tests/format/dql/lateral-view.test.js.map +1 -0
- package/out-tsc/tests/format/dql/pivot.test.d.ts +7 -0
- package/out-tsc/tests/format/dql/pivot.test.d.ts.map +1 -0
- package/out-tsc/tests/format/dql/pivot.test.js +56 -0
- package/out-tsc/tests/format/dql/pivot.test.js.map +1 -0
- package/out-tsc/tests/format/dql/window.test.d.ts +7 -0
- package/out-tsc/tests/format/dql/window.test.d.ts.map +1 -0
- package/out-tsc/tests/format/dql/window.test.js +89 -0
- package/out-tsc/tests/format/dql/window.test.js.map +1 -0
- package/out-tsc/tests/format/expression/expression.test.d.ts +5 -0
- package/out-tsc/tests/format/expression/expression.test.d.ts.map +1 -0
- package/out-tsc/tests/format/expression/expression.test.js +203 -0
- package/out-tsc/tests/format/expression/expression.test.js.map +1 -0
- package/out-tsc/tests/format/pipe/pipe-operator.test.d.ts +5 -0
- package/out-tsc/tests/format/pipe/pipe-operator.test.d.ts.map +1 -0
- package/out-tsc/tests/format/pipe/pipe-operator.test.js +290 -0
- package/out-tsc/tests/format/pipe/pipe-operator.test.js.map +1 -0
- package/out-tsc/tests/format/procedure/compound-statement.test.d.ts +16 -0
- package/out-tsc/tests/format/procedure/compound-statement.test.d.ts.map +1 -0
- package/out-tsc/tests/format/procedure/compound-statement.test.js +254 -0
- package/out-tsc/tests/format/procedure/compound-statement.test.js.map +1 -0
- package/out-tsc/tests/format/resource/resource.test.d.ts +5 -0
- package/out-tsc/tests/format/resource/resource.test.d.ts.map +1 -0
- package/out-tsc/tests/format/resource/resource.test.js +69 -0
- package/out-tsc/tests/format/resource/resource.test.js.map +1 -0
- package/out-tsc/tests/format/test-utils.d.ts +40 -0
- package/out-tsc/tests/format/test-utils.d.ts.map +1 -0
- package/out-tsc/tests/format/test-utils.js +53 -0
- package/out-tsc/tests/format/test-utils.js.map +1 -0
- package/out-tsc/tests/lsp-server.test.d.ts +2 -0
- package/out-tsc/tests/lsp-server.test.d.ts.map +1 -0
- package/out-tsc/tests/lsp-server.test.js +1525 -0
- package/out-tsc/tests/lsp-server.test.js.map +1 -0
- package/out-tsc/tests/spark-sql-inputs.test.d.ts +17 -0
- package/out-tsc/tests/spark-sql-inputs.test.d.ts.map +1 -0
- package/out-tsc/tests/spark-sql-inputs.test.js +570 -0
- package/out-tsc/tests/spark-sql-inputs.test.js.map +1 -0
- package/out-tsc/tests/validation.test.d.ts +2 -0
- package/out-tsc/tests/validation.test.d.ts.map +1 -0
- package/out-tsc/tests/validation.test.js +115 -0
- package/out-tsc/tests/validation.test.js.map +1 -0
- package/out-tsc/typings.d.ts +115 -1
- package/out-tsc/typings.d.ts.map +1 -0
- package/out-tsc/typings.js +28 -0
- package/out-tsc/typings.js.map +1 -1
- package/out-tsc/utils.d.ts +1 -0
- package/out-tsc/utils.d.ts.map +1 -0
- package/out-tsc/utils.js +4 -5
- package/out-tsc/utils.js.map +1 -1
- package/out-tsc/visitors/completion.visitor.d.ts +85 -0
- package/out-tsc/visitors/completion.visitor.d.ts.map +1 -0
- package/out-tsc/visitors/completion.visitor.js +379 -0
- package/out-tsc/visitors/completion.visitor.js.map +1 -0
- package/out-tsc/visitors/lineage.visitor.d.ts +34 -0
- package/out-tsc/visitors/lineage.visitor.d.ts.map +1 -0
- package/out-tsc/visitors/lineage.visitor.js +181 -0
- package/out-tsc/visitors/lineage.visitor.js.map +1 -0
- package/out-tsc/visitors/space-replacer-format.visitor.d.ts +1641 -0
- package/out-tsc/visitors/space-replacer-format.visitor.d.ts.map +1 -0
- package/out-tsc/visitors/space-replacer-format.visitor.js +7529 -0
- package/out-tsc/visitors/space-replacer-format.visitor.js.map +1 -0
- package/out-tsc/visitors/sparksql-relation.visitor.d.ts +154 -0
- package/out-tsc/visitors/sparksql-relation.visitor.d.ts.map +1 -0
- package/out-tsc/visitors/sparksql-relation.visitor.js +749 -0
- package/out-tsc/visitors/sparksql-relation.visitor.js.map +1 -0
- package/package.json +36 -9
- package/out-tsc/constant.d.ts +0 -3
- package/out-tsc/constant.js +0 -7
- package/out-tsc/constant.js.map +0 -1
- package/out-tsc/lib/SparkSqlLexer.d.ts +0 -421
- package/out-tsc/lib/SparkSqlLexer.js +0 -2750
- package/out-tsc/lib/SparkSqlLexer.js.map +0 -1
- package/out-tsc/lib/SparkSqlParser.d.ts +0 -6203
- package/out-tsc/lib/SparkSqlParser.js +0 -34733
- package/out-tsc/lib/SparkSqlParser.js.map +0 -1
- package/out-tsc/lib/SparkSqlParserListener.d.ts +0 -1158
- package/out-tsc/lib/SparkSqlParserListener.js.map +0 -1
- package/out-tsc/lib/SparkSqlParserVisitor.d.ts +0 -773
- package/out-tsc/lib/SparkSqlParserVisitor.js.map +0 -1
|
@@ -0,0 +1,1641 @@
|
|
|
1
|
+
import { CommonTokenStream } from 'antlr4ts';
|
|
2
|
+
import { AbstractParseTreeVisitor } from 'antlr4ts/tree';
|
|
3
|
+
import { TextEdit } from 'vscode-languageserver-textdocument';
|
|
4
|
+
import { MultiInsertQueryContext, MultiInsertQueryBodyContext, QueryPrimaryContext, RelationPrimaryContext, AnalyzeContext, AnalyzeTablesContext, AddTableColumnsContext, AddTablePartitionContext, AggregationClauseContext, AliasedQueryContext, AlterColumnActionContext, AlterTableAlterColumnContext, AlterViewQueryContext, ArithmeticBinaryContext, BucketSpecContext, CacheTableContext, CallContext, CastContext, ClearCacheContext, ColDefinitionContext, CommentSpecContext, ColDefinitionDescriptorWithPositionContext, ColTypeContext, ColTypeListContext, ComparisonContext, ComplexColTypeContext, ComplexColTypeListContext, ComplexDataTypeContext, CreateTableClausesContext, CreateNamespaceContext, CreateFileFormatContext, CreateFunctionContext, CreateIndexContext, CreateTableContext, CreateTableLikeContext, CreateTableHeaderContext, CreateViewContext, CreateMetricViewContext, CreateTempViewUsingContext, CtesContext, DeleteFromTableContext, DereferenceContext, MergeIntoTableContext, MatchedClauseContext, NotMatchedClauseContext, NotMatchedBySourceClauseContext, DropFunctionContext, DropNamespaceContext, DropTableColumnsContext, DropTableContext, DropTablePartitionsContext, DropViewContext, ExistsContext, ExplainContext, ExpressionPropertyListContext, ExpressionPropertyWithKeyAndEqualsContext, FromClauseContext, FromStatementBodyContext, FrameBoundContext, FunctionCallContext, GroupingAnalyticsContext, GroupingSetContext, HavingClauseContext, HiveChangeColumnContext, HiveReplaceColumnsContext, IdentifierCommentContext, IdentifierCommentListContext, IdentifierListContext, IdentifierSeqContext, InlineTableContext, InsertIntoTableContext, InsertOverwriteTableContext, JoinCriteriaContext, JoinRelationContext, JoinTypeContext, LateralViewContext, LoadDataContext, LocationSpecContext, LogicalBinaryContext, LogicalNotContext, MultipartIdentifierListContext, NonTrivialPrimitiveTypeContext, NamedExpressionContext, OperatorPipeStatementContext, OperatorPipeRightSideContext, OperatorPipeSetAssignmentSeqContext, PrimitiveTypeContext, NamedExpressionSeqContext, NamedQueryContext, NamedWindowContext, OrderedIdentifierContext, OrderedIdentifierListContext, ParenthesizedExpressionContext, PartitionFieldListContext, PartitionSpecContext, PartitionValContext, PredicateContext, ProgramContext, PropertyListContext, PropertyWithKeyAndEqualsContext, QueryContext, QualifiedColTypeWithPositionContext, QualifiedColTypeWithPositionListContext, QueryOrganizationContext, RecoverPartitionsContext, RefreshFunctionContext, RefreshTableContext, RegularQuerySpecificationContext, RenameTableColumnContext, RenameTableContext, RenameTablePartitionContext, RepairTableContext, ResourceContext, RowConstructorContext, RowFormatSerdeContext, RowFormatDelimitedContext, SearchedCaseContext, SelectClauseContext, SetClauseContext, SetNamespaceCollationContext, SetNamespaceLocationContext, SetNamespacePropertiesContext, SetOperationContext, SetQuantifierContext, SetTableLocationContext, SetTablePropertiesContext, SetTableSerDeContext, SimpleCaseContext, SingleInsertQueryContext, SortItemContext, StarContext, StatementEndContext, StatementsContext, SubqueryContext, SubqueryExpressionContext, TableAliasContext, TableContext, TableElementListContext, TableFileFormatContext, TableNameContext, TableProviderContext, TrimContext, TruncateTableContext, UncacheTableContext, UnsetNamespacePropertiesContext, UnsetTablePropertiesContext, UpdateTableContext, WhenClauseContext, WhereClauseContext, WindowClauseContext, WindowDefContext, WindowFrameContext, ExecuteImmediateContext, ExceptClauseContext, CommentNamespaceContext, CommentTableContext, DescribeQueryContext, DescribeRelationContext, DescribeNamespaceContext, DescribeProcedureContext, DescribeFunctionContext, PivotClauseContext, UnpivotClauseContext, UnpivotNullClauseContext, UnpivotSingleValueColumnClauseContext, UnpivotMultiValueColumnClauseContext, UnpivotColumnSetContext, Any_valueContext, FirstContext, LastContext, TimestampaddContext, TimestampdiffContext, PositionContext, StructContext, SampleContext, SampleByPercentileContext, CollateContext, CollateClauseContext, IntervalValueContext, UseContext, UseNamespaceContext, SetCatalogContext, ShowNamespacesContext, ShowTablesContext, ShowTableExtendedContext, ShowTblPropertiesContext, ShowColumnsContext, ShowViewsContext, ShowPartitionsContext, ShowFunctionsContext, ShowProceduresContext, ShowCreateTableContext, ShowCurrentNamespaceContext, ShowCatalogsContext, SetTimeZoneContext, SetVariableContext, SetQuotedConfigurationContext, SetConfigurationContext, ResetQuotedConfigurationContext, ResetConfigurationContext, ReplaceTableContext, CreateUserDefinedFunctionContext, CreateVariableContext, DropVariableContext, AlterClusterByContext, AlterTableCollationContext, AddTableConstraintContext, DropTableConstraintContext, AlterViewSchemaBindingContext, CreatePipelineDatasetContext, CreatePipelineInsertIntoFlowContext, CreatePipelineDatasetHeaderContext, CreatePipelineFlowHeaderContext, DropIndexContext, RefreshResourceContext, ManageResourceContext } from '../lib/SparkSQLParser';
|
|
5
|
+
import { SparkSQLParserVisitor } from '../lib/SparkSQLParserVisitor';
|
|
6
|
+
import { SparkSQLFormattingOptions, FormattingError } from '../typings';
|
|
7
|
+
/**
|
|
8
|
+
* Transverse parse tree and replace spaces between terminalNodes or contexts with
|
|
9
|
+
* formatted strings of whitespaces/newlines.
|
|
10
|
+
*/
|
|
11
|
+
export declare class SpaceReplacerFormatVisitor extends AbstractParseTreeVisitor<void> implements SparkSQLParserVisitor<void> {
|
|
12
|
+
private tokens;
|
|
13
|
+
private config;
|
|
14
|
+
textEdits: TextEdit[];
|
|
15
|
+
formattingErrors: FormattingError[];
|
|
16
|
+
private editKeys;
|
|
17
|
+
private indentNumber;
|
|
18
|
+
private indentString;
|
|
19
|
+
private readonly newline;
|
|
20
|
+
private readonly maxParenthesisLength;
|
|
21
|
+
private readonly newlineRegex;
|
|
22
|
+
private inPipeOperatorRightSide;
|
|
23
|
+
private inPipeSubquery;
|
|
24
|
+
private inWindowClause;
|
|
25
|
+
private readonly pipeStepClassifier;
|
|
26
|
+
private readonly pipeSelectStrategy;
|
|
27
|
+
private readonly pipeWhereStrategy;
|
|
28
|
+
private readonly pipeSetStrategy;
|
|
29
|
+
private readonly pipeDropStrategy;
|
|
30
|
+
private readonly pipeExtendStrategy;
|
|
31
|
+
private readonly blockStrategy;
|
|
32
|
+
private readonly listStrategy;
|
|
33
|
+
private readonly clauseHeadBodyStrategy;
|
|
34
|
+
private readonly joinStrategy;
|
|
35
|
+
private readonly pipeJoinStrategy;
|
|
36
|
+
private readonly pipeQueryOrganizationStrategy;
|
|
37
|
+
private readonly pipeAggregateStrategy;
|
|
38
|
+
private readonly pipeSetOperationStrategy;
|
|
39
|
+
private readonly pipeSampleStrategy;
|
|
40
|
+
private readonly pipePivotStrategy;
|
|
41
|
+
private readonly pipeUnpivotStrategy;
|
|
42
|
+
constructor(tokens: CommonTokenStream, config: SparkSQLFormattingOptions);
|
|
43
|
+
/**
|
|
44
|
+
* Add a text edit, allowing later edits to override earlier ones for the same range
|
|
45
|
+
*/
|
|
46
|
+
private addTextEdit;
|
|
47
|
+
/**
|
|
48
|
+
* Get previous non-hidden token (skipping whitespace and comments)
|
|
49
|
+
* HIDDEN channel tokens (WS, comments) are in channel 1 or 2
|
|
50
|
+
* Note: Uses token's stopIndex to find position since tokenIndex may be -1 in browser
|
|
51
|
+
*/
|
|
52
|
+
private getPreviousNonHiddenToken;
|
|
53
|
+
/**
|
|
54
|
+
* Get next non-hidden token (skipping whitespace and comments)
|
|
55
|
+
* Note: Uses token's startIndex to find position since tokenIndex may be -1 in browser
|
|
56
|
+
*/
|
|
57
|
+
private getNextNonHiddenToken;
|
|
58
|
+
/**
|
|
59
|
+
* Find token index by matching startIndex
|
|
60
|
+
* This is used as a fallback when tokenIndex is -1
|
|
61
|
+
*/
|
|
62
|
+
private findTokenIndexByStartIndex;
|
|
63
|
+
/**
|
|
64
|
+
* Get previous non-hidden token by symbol's startIndex
|
|
65
|
+
* Used when tokenIndex is not available (-1 in browser)
|
|
66
|
+
*/
|
|
67
|
+
private getPreviousNonHiddenTokenByStartIndex;
|
|
68
|
+
/**
|
|
69
|
+
* Get next non-hidden token by symbol's stopIndex
|
|
70
|
+
* Used when tokenIndex is not available (-1 in browser)
|
|
71
|
+
*/
|
|
72
|
+
private getNextNonHiddenTokenByStopIndex;
|
|
73
|
+
/**
|
|
74
|
+
* Check if a token is a comment (single-line or multi-line)
|
|
75
|
+
*/
|
|
76
|
+
private isCommentToken;
|
|
77
|
+
/**
|
|
78
|
+
* Find the last comment token before a given start index
|
|
79
|
+
* Returns the comment token if found, undefined otherwise
|
|
80
|
+
*/
|
|
81
|
+
private findLastCommentTokenBefore;
|
|
82
|
+
/**
|
|
83
|
+
* Find comment tokens between two positions (startIndex to endIndex exclusive)
|
|
84
|
+
* Returns array of comment tokens in order
|
|
85
|
+
*/
|
|
86
|
+
private findCommentTokensBetween;
|
|
87
|
+
/**
|
|
88
|
+
* Find all tokens (including hidden) between two positions
|
|
89
|
+
* Returns array of tokens in order
|
|
90
|
+
*/
|
|
91
|
+
private findTokensBetween;
|
|
92
|
+
/**
|
|
93
|
+
* Check if there is a newline in the whitespace before a comment
|
|
94
|
+
* @param startIndex - Start of the range to check
|
|
95
|
+
* @param commentStartIndex - Start index of the comment
|
|
96
|
+
* @returns true if there is a newline before the comment
|
|
97
|
+
*/
|
|
98
|
+
private hasNewlineBeforeComment;
|
|
99
|
+
/**
|
|
100
|
+
* Build text that preserves comments within a range while respecting original positions
|
|
101
|
+
* Used to avoid deleting comments when updating whitespace between tokens
|
|
102
|
+
*
|
|
103
|
+
* Comment position rules:
|
|
104
|
+
* 1. If a comment was on the same line as the previous token (no newline before it),
|
|
105
|
+
* keep it on the same line with a space separator
|
|
106
|
+
* 2. If a comment was on a new line, put it on a new line with proper indentation
|
|
107
|
+
* 3. Always add the requested newText after the last comment
|
|
108
|
+
*
|
|
109
|
+
* @param startIndex - Start index of the range (exclusive, typically end of previous token)
|
|
110
|
+
* @param endIndex - End index of the range (exclusive, typically start of next token)
|
|
111
|
+
* @param newText - The desired whitespace/newline text to use for line breaks
|
|
112
|
+
* @returns Text that includes preserved comments with proper spacing
|
|
113
|
+
*/
|
|
114
|
+
private buildTextWithPreservedComments;
|
|
115
|
+
defaultResult(): void;
|
|
116
|
+
/**
|
|
117
|
+
* Check if the current context is inside a CASE WHEN expression
|
|
118
|
+
* by traversing the parent chain
|
|
119
|
+
*/
|
|
120
|
+
private isInsideCaseWhen;
|
|
121
|
+
/**
|
|
122
|
+
* Check if the current context is inside a function call
|
|
123
|
+
* by traversing the parent chain
|
|
124
|
+
*/
|
|
125
|
+
private isInsideFunctionCall;
|
|
126
|
+
/**
|
|
127
|
+
* Check if the expression contains a subquery that requires newline
|
|
128
|
+
* Only subquery expressions require newline, not simple parenthesized expressions
|
|
129
|
+
*/
|
|
130
|
+
private containsSubquery;
|
|
131
|
+
private get indent();
|
|
132
|
+
private get newlineIndent();
|
|
133
|
+
private get writer();
|
|
134
|
+
private addIndent;
|
|
135
|
+
private minusIndent;
|
|
136
|
+
/**
|
|
137
|
+
* Update text before next token by context
|
|
138
|
+
* Replaces whitespace between context end and next non-hidden token
|
|
139
|
+
*/
|
|
140
|
+
private updateBeforeNextTokenByContext;
|
|
141
|
+
/**
|
|
142
|
+
* Update text after previous token by context
|
|
143
|
+
* Replaces whitespace between previous non-hidden token and context start
|
|
144
|
+
* Preserves any comments that exist between the tokens
|
|
145
|
+
*/
|
|
146
|
+
private updateAfterPreviousTokenByContext;
|
|
147
|
+
/**
|
|
148
|
+
* Update text before next token by node
|
|
149
|
+
* Replaces whitespace between current node and next non-hidden token
|
|
150
|
+
* Preserves any comments that exist between the tokens
|
|
151
|
+
*/
|
|
152
|
+
private updateBeforeNextTokenByNode;
|
|
153
|
+
/**
|
|
154
|
+
* Calculate the end position of a token, handling multi-line tokens correctly
|
|
155
|
+
* For multi-line tokens (like strings with newlines), we need to count the lines
|
|
156
|
+
* and find the character position on the last line
|
|
157
|
+
*/
|
|
158
|
+
private getTokenEndPosition;
|
|
159
|
+
private getFormattingBridgeHelpers;
|
|
160
|
+
private getListFormattingBridge;
|
|
161
|
+
private getClauseHeadBodyBridge;
|
|
162
|
+
private getJoinFormattingBridge;
|
|
163
|
+
private getBlockFormattingBridge;
|
|
164
|
+
/**
|
|
165
|
+
* Update text after previous token by node
|
|
166
|
+
* Replaces whitespace between previous non-hidden token and current node
|
|
167
|
+
* Preserves any comments that exist between the tokens
|
|
168
|
+
*/
|
|
169
|
+
private updateAfterPreviousTokenByNode;
|
|
170
|
+
private normalizeKeywordSpacing;
|
|
171
|
+
/**
|
|
172
|
+
* Normalize spacing for multiple keywords at once
|
|
173
|
+
* Convenience method for consecutive keyword spacing
|
|
174
|
+
*/
|
|
175
|
+
private normalizeKeywordsSpacing;
|
|
176
|
+
private normalizeKeywordSpacingAfterNewline;
|
|
177
|
+
/**
|
|
178
|
+
* Format IF EXISTS clause with proper spacing
|
|
179
|
+
* Handles: IF EXISTS - single space before and after each keyword
|
|
180
|
+
*/
|
|
181
|
+
private formatIfExistsClause;
|
|
182
|
+
/**
|
|
183
|
+
* Format IF NOT EXISTS clause with proper spacing
|
|
184
|
+
* Handles: IF NOT EXISTS - single space before and after each keyword
|
|
185
|
+
*/
|
|
186
|
+
private formatIfNotExistsClause;
|
|
187
|
+
private indentAfterNode;
|
|
188
|
+
/**
|
|
189
|
+
* Add indent and put context on new line with indent
|
|
190
|
+
* Pattern: this.addIndent() + updateBeforeNextTokenByContext(ctx, this.newlineIndent) + this.minusIndent()
|
|
191
|
+
*/
|
|
192
|
+
private indentBeforeContext;
|
|
193
|
+
/**
|
|
194
|
+
* Format a parenthesized block with content on new lines
|
|
195
|
+
* Pattern: ( content ) -> (\n content\n)
|
|
196
|
+
*
|
|
197
|
+
* @param leftParen - The left parenthesis node
|
|
198
|
+
* @param rightParen - The right parenthesis node
|
|
199
|
+
* @param options - Optional configuration
|
|
200
|
+
* @param options.spaceBeforeLeftParen - Whether to add space before left paren (default: true)
|
|
201
|
+
*/
|
|
202
|
+
private formatParenthesizedBlock;
|
|
203
|
+
/**
|
|
204
|
+
* Format compact parentheses (no newlines inside)
|
|
205
|
+
* Used for: PARTITION (a=1, b=2), GROUPING SET (a, b), etc.
|
|
206
|
+
*
|
|
207
|
+
* @param leftParen - The left parenthesis node
|
|
208
|
+
* @param rightParen - The right parenthesis node
|
|
209
|
+
* @param options - Optional configuration
|
|
210
|
+
* @param options.spaceBeforeLeftParen - Whether to add space before left paren (default: false)
|
|
211
|
+
* @param options.commas - Comma nodes to format inline
|
|
212
|
+
*/
|
|
213
|
+
private formatCompactParentheses;
|
|
214
|
+
/**
|
|
215
|
+
* Format equals sign with single space before and after
|
|
216
|
+
* Used for: key = value, pt = 'value', etc.
|
|
217
|
+
*/
|
|
218
|
+
private formatEqualsSign;
|
|
219
|
+
private formatKeywordWithIndentedBody;
|
|
220
|
+
private formatIndentedContextList;
|
|
221
|
+
private addNewlineBeforeContexts;
|
|
222
|
+
/**
|
|
223
|
+
* Add newline before first TerminalNode in array
|
|
224
|
+
* Used for keyword lists like OPTIONS, PARTITIONED, TBLPROPERTIES
|
|
225
|
+
*/
|
|
226
|
+
private addNewlineBeforeFirstNode;
|
|
227
|
+
/**
|
|
228
|
+
* Add newline before each TerminalNode and space after
|
|
229
|
+
* Pattern: keyword on new line, followed by space
|
|
230
|
+
*/
|
|
231
|
+
private addNewlineAndSpaceBeforeNodes;
|
|
232
|
+
private formatIndentedTrailingCommaContextList;
|
|
233
|
+
private formatIndentedTrailingCommaNodes;
|
|
234
|
+
private formatInlineCommaNodes;
|
|
235
|
+
private addNewlineBeforeFirstContext;
|
|
236
|
+
/**
|
|
237
|
+
* Format a simple keyword statement
|
|
238
|
+
* Pattern: KEYWORD rest_of_statement
|
|
239
|
+
* Just adds a space after the keyword
|
|
240
|
+
*/
|
|
241
|
+
private formatSimpleKeywordStatement;
|
|
242
|
+
/**
|
|
243
|
+
* Add space after a node (shorthand for common pattern)
|
|
244
|
+
* Pattern: this.updateBeforeNextTokenByNode(node, ' ')
|
|
245
|
+
*/
|
|
246
|
+
private addSpaceAfterNode;
|
|
247
|
+
/**
|
|
248
|
+
* Add space after a context (shorthand for common pattern)
|
|
249
|
+
* Pattern: this.updateBeforeNextTokenByContext(ctx, ' ')
|
|
250
|
+
*/
|
|
251
|
+
private addSpaceAfterContext;
|
|
252
|
+
/**
|
|
253
|
+
* Add space after multiple nodes (batch operation)
|
|
254
|
+
* Pattern: this.updateBeforeNextTokenByNode(node, ' ') for each node
|
|
255
|
+
*/
|
|
256
|
+
private addSpaceAfterNodes;
|
|
257
|
+
/**
|
|
258
|
+
* Add newline before a node (shorthand for common pattern)
|
|
259
|
+
* Pattern: this.updateAfterPreviousTokenByNode(node, this.newline)
|
|
260
|
+
*/
|
|
261
|
+
private addNewlineBeforeNode;
|
|
262
|
+
/**
|
|
263
|
+
* Add newline after a node
|
|
264
|
+
* Pattern: this.updateBeforeNextTokenByNode(node, this.newline)
|
|
265
|
+
*/
|
|
266
|
+
private addNewlineAfterNode;
|
|
267
|
+
/**
|
|
268
|
+
* Add newline with indent before a node
|
|
269
|
+
* Pattern: this.updateAfterPreviousTokenByNode(node, this.newlineIndent)
|
|
270
|
+
*/
|
|
271
|
+
private addNewlineIndentBeforeNode;
|
|
272
|
+
/**
|
|
273
|
+
* Add newline before a context (shorthand for common pattern)
|
|
274
|
+
* Pattern: this.updateAfterPreviousTokenByContext(ctx, this.newline)
|
|
275
|
+
*/
|
|
276
|
+
private addNewlineBeforeContext;
|
|
277
|
+
/**
|
|
278
|
+
* Add newline with indent before a context
|
|
279
|
+
* Pattern: this.updateAfterPreviousTokenByContext(ctx, this.newlineIndent)
|
|
280
|
+
*/
|
|
281
|
+
private addNewlineIndentBeforeContext;
|
|
282
|
+
/**
|
|
283
|
+
* Recursively clear newlines in a context and all its children (for compact mode)
|
|
284
|
+
* This ensures expressions like "any_value(a)" stay compact even if input has newlines
|
|
285
|
+
* @param ctx - The context to clear newlines from
|
|
286
|
+
*/
|
|
287
|
+
private clearNewlinesRecursive;
|
|
288
|
+
/**
|
|
289
|
+
* Check if a token needs space before it based on its type
|
|
290
|
+
* Used by clearAllNewlines to preserve necessary spaces between tokens
|
|
291
|
+
*/
|
|
292
|
+
private needsSpaceBefore;
|
|
293
|
+
/**
|
|
294
|
+
* Check if token is a keyword (reserved or non-reserved)
|
|
295
|
+
*/
|
|
296
|
+
private isKeywordToken;
|
|
297
|
+
/**
|
|
298
|
+
* Check if token is a number or identifier
|
|
299
|
+
*/
|
|
300
|
+
private isNumberOrIdentifierToken;
|
|
301
|
+
/**
|
|
302
|
+
* Check if token is opening punctuation
|
|
303
|
+
*/
|
|
304
|
+
private isOpeningPunctuationToken;
|
|
305
|
+
/**
|
|
306
|
+
* Check if token is closing punctuation
|
|
307
|
+
*/
|
|
308
|
+
private isClosingPunctuationToken;
|
|
309
|
+
/**
|
|
310
|
+
* Aggressively clear ALL newlines in a context, including between all tokens
|
|
311
|
+
* This is a stronger version of clearNewlinesRecursive for complete compact format
|
|
312
|
+
* Now intelligently preserves spaces between keywords, numbers, and identifiers
|
|
313
|
+
* @param ctx - The context to clear all newlines from
|
|
314
|
+
*/
|
|
315
|
+
private clearAllNewlines;
|
|
316
|
+
/**
|
|
317
|
+
* Get the last terminal token from a context
|
|
318
|
+
*/
|
|
319
|
+
private getLastToken;
|
|
320
|
+
/**
|
|
321
|
+
* Check if a range overlaps with any existing edit
|
|
322
|
+
* Used to avoid overwriting or conflicting with targeted formatting edits
|
|
323
|
+
*/
|
|
324
|
+
private hasOverlappingEdit;
|
|
325
|
+
/**
|
|
326
|
+
* Compress consecutive spaces within a single line to a single space
|
|
327
|
+
* This is a post-processing step that catches any multi-space issues
|
|
328
|
+
* not handled by targeted visitor methods.
|
|
329
|
+
*
|
|
330
|
+
* Rules:
|
|
331
|
+
* 1. Only process tokens on HIDDEN channel (whitespace tokens)
|
|
332
|
+
* 2. Skip tokens that contain newlines (cross-line spaces)
|
|
333
|
+
* 3. Skip tokens that have already been processed by targeted methods
|
|
334
|
+
* 4. Compress multiple spaces to single space
|
|
335
|
+
*
|
|
336
|
+
* Note: String literals are not affected because they are parsed as
|
|
337
|
+
* separate tokens on the default channel, not as whitespace tokens.
|
|
338
|
+
*/
|
|
339
|
+
private compressConsecutiveSpaces;
|
|
340
|
+
/**
|
|
341
|
+
* Format a sequence of keywords with optional line wrapping based on length
|
|
342
|
+
*
|
|
343
|
+
* This is a generic helper method for formatting keyword sequences that may need
|
|
344
|
+
* to wrap to new lines when the content exceeds maxParenthesisLength.
|
|
345
|
+
*
|
|
346
|
+
* @param ctx - The parser context to check length against
|
|
347
|
+
* @param rules - Array of keyword formatting rules
|
|
348
|
+
*
|
|
349
|
+
* Each rule specifies:
|
|
350
|
+
* - node: The TerminalNode to format (if undefined, rule is skipped)
|
|
351
|
+
* - beforeNormal: Separator before the keyword in normal mode (default: no change)
|
|
352
|
+
* - afterNormal: Separator after the keyword in normal mode (default: no change)
|
|
353
|
+
* - beforeWrap: Separator before the keyword when wrapping (used only if isWrapPoint=true)
|
|
354
|
+
* - afterWrap: Separator after the keyword when wrapping
|
|
355
|
+
* - isWrapPoint: If true, this keyword is where line wrapping occurs when content is long
|
|
356
|
+
*
|
|
357
|
+
* Example usage:
|
|
358
|
+
* ```typescript
|
|
359
|
+
* this.formatKeywordsWithLengthCheck(ctx, [
|
|
360
|
+
* { node: ctx.INPUTFORMAT(), afterNormal: ' ', afterWrap: ' ' },
|
|
361
|
+
* { node: ctx.OUTPUTFORMAT(), beforeNormal: ' ', afterNormal: ' ',
|
|
362
|
+
* beforeWrap: this.newlineIndent, afterWrap: ' ', isWrapPoint: true }
|
|
363
|
+
* ]);
|
|
364
|
+
* ```
|
|
365
|
+
*/
|
|
366
|
+
private formatKeywordsWithLengthCheck;
|
|
367
|
+
/**
|
|
368
|
+
* Format parenthesized content with commas (generic helper for all bracket scenarios)
|
|
369
|
+
*
|
|
370
|
+
* This is a reusable method for formatting any parenthesized content such as:
|
|
371
|
+
* - Column definitions: (id INT, name STRING)
|
|
372
|
+
* - Function arguments: func(arg1, arg2)
|
|
373
|
+
* - Property lists: TBLPROPERTIES ('key' = 'value')
|
|
374
|
+
* - Partition specs: PARTITION (pt = 'value')
|
|
375
|
+
* - Row constructors: VALUES (val1, val2)
|
|
376
|
+
* - Grouping analytics: ROLLUP(a, b), CUBE(a, b)
|
|
377
|
+
* - Identifier lists: alias(col1, col2)
|
|
378
|
+
*
|
|
379
|
+
* Handles two modes based on content length:
|
|
380
|
+
* - Compact mode (content <= maxParenthesisLength):
|
|
381
|
+
* (elem1, elem2, elem3) - all on same line
|
|
382
|
+
* - Multiline mode (content > maxParenthesisLength):
|
|
383
|
+
* (
|
|
384
|
+
* elem1,
|
|
385
|
+
* elem2,
|
|
386
|
+
* elem3
|
|
387
|
+
* )
|
|
388
|
+
*
|
|
389
|
+
* @param leftParen - Left parenthesis node
|
|
390
|
+
* @param rightParen - Right parenthesis node
|
|
391
|
+
* @param commas - Array of comma nodes
|
|
392
|
+
* @param contentLength - Total length of content inside parentheses
|
|
393
|
+
* @param options - Configuration options:
|
|
394
|
+
* - spaceBeforeLeftParen: Add space before '(' (default: false)
|
|
395
|
+
* - forceCompact: Always use compact format regardless of length
|
|
396
|
+
* - forceMultiline: Always use multiline format regardless of length
|
|
397
|
+
* - visitChildren: Callback to visit children (default: no-op)
|
|
398
|
+
* - addIndentBeforeFormat: Add indent before formatting (for nested contexts)
|
|
399
|
+
*/
|
|
400
|
+
private formatParenthesizedContent;
|
|
401
|
+
visitProgram(ctx: ProgramContext): void;
|
|
402
|
+
visitStatements(ctx: StatementsContext): void;
|
|
403
|
+
visitStatementEnd(ctx: StatementEndContext): void;
|
|
404
|
+
/**
|
|
405
|
+
* EXPLAIN [LOGICAL|FORMATTED|EXTENDED|CODEGEN|COST] statement
|
|
406
|
+
* Format: EXPLAIN FORMATTED
|
|
407
|
+
* select
|
|
408
|
+
* ...
|
|
409
|
+
* Note: EXPLAIN and mode stay on same line, statement on new line
|
|
410
|
+
*/
|
|
411
|
+
visitExplain(ctx: ExplainContext): void;
|
|
412
|
+
visitCall(ctx: CallContext): void;
|
|
413
|
+
/**
|
|
414
|
+
* Format EXECUTE IMMEDIATE statement
|
|
415
|
+
*
|
|
416
|
+
* Short query (no INTO/USING):
|
|
417
|
+
* EXECUTE IMMEDIATE 'SELECT * FROM users WHERE id = 1';
|
|
418
|
+
*
|
|
419
|
+
* With INTO and USING:
|
|
420
|
+
* EXECUTE IMMEDIATE 'SELECT COUNT(*) FROM t WHERE date >= ?'
|
|
421
|
+
* INTO result_count
|
|
422
|
+
* USING (start_date);
|
|
423
|
+
*
|
|
424
|
+
* Multi-param USING:
|
|
425
|
+
* EXECUTE IMMEDIATE dynamic_query
|
|
426
|
+
* INTO affected_rows
|
|
427
|
+
* USING (
|
|
428
|
+
* source_table => 'temp_data',
|
|
429
|
+
* target_table => 'main_table',
|
|
430
|
+
* batch_size => 1000
|
|
431
|
+
* );
|
|
432
|
+
*
|
|
433
|
+
* Key rules:
|
|
434
|
+
* - EXECUTE IMMEDIATE expression stays on the same line
|
|
435
|
+
* - INTO clause starts on a new line
|
|
436
|
+
* - USING clause starts on a new line
|
|
437
|
+
* - String literal content is never modified (preserves highlighting)
|
|
438
|
+
*/
|
|
439
|
+
visitExecuteImmediate(ctx: ExecuteImmediateContext): void;
|
|
440
|
+
visitCreateTable(ctx: CreateTableContext): void;
|
|
441
|
+
/**
|
|
442
|
+
* Format CREATE TABLE ... LIKE statement
|
|
443
|
+
* Target format:
|
|
444
|
+
* CREATE TABLE target_table
|
|
445
|
+
* LIKE source_table
|
|
446
|
+
* USING CSV
|
|
447
|
+
* LOCATION '/path/to/data';
|
|
448
|
+
*/
|
|
449
|
+
visitCreateTableLike(ctx: CreateTableLikeContext): void;
|
|
450
|
+
/**
|
|
451
|
+
* Format tableProvider: USING provider_name
|
|
452
|
+
* Ensures single space between USING keyword and provider name
|
|
453
|
+
* Format: USING CSV (not: USING CSV)
|
|
454
|
+
*/
|
|
455
|
+
visitTableProvider(ctx: TableProviderContext): void;
|
|
456
|
+
visitCreateTableHeader(ctx: CreateTableHeaderContext): void;
|
|
457
|
+
visitCreateTableClauses(ctx: CreateTableClausesContext): void;
|
|
458
|
+
visitPropertyList(ctx: PropertyListContext): void;
|
|
459
|
+
/**
|
|
460
|
+
* Format expressionPropertyList (used by OPTIONS clause)
|
|
461
|
+
* Format: OPTIONS (
|
|
462
|
+
* 'key' = 'value',
|
|
463
|
+
* 'key2' = 'value2'
|
|
464
|
+
* )
|
|
465
|
+
* This ensures consistent formatting with TBLPROPERTIES
|
|
466
|
+
*/
|
|
467
|
+
visitExpressionPropertyList(ctx: ExpressionPropertyListContext): void;
|
|
468
|
+
/**
|
|
469
|
+
* Format expressionProperty with key = value format (used by OPTIONS clause)
|
|
470
|
+
* Ensures exactly one space before and after the equals sign
|
|
471
|
+
* Format: 'key' = 'value'
|
|
472
|
+
* This ensures consistent formatting with property (used by TBLPROPERTIES)
|
|
473
|
+
*/
|
|
474
|
+
visitExpressionPropertyWithKeyAndEquals(ctx: ExpressionPropertyWithKeyAndEqualsContext): void;
|
|
475
|
+
/**
|
|
476
|
+
* Property with key = value format
|
|
477
|
+
* Ensures exactly one space before and after the equals sign
|
|
478
|
+
* Format: 'key' = 'value'
|
|
479
|
+
*/
|
|
480
|
+
visitPropertyWithKeyAndEquals(ctx: PropertyWithKeyAndEqualsContext): void;
|
|
481
|
+
visitTableElementList(ctx: TableElementListContext): void;
|
|
482
|
+
visitColDefinition(ctx: ColDefinitionContext): void;
|
|
483
|
+
/**
|
|
484
|
+
* Format CREATE VIEW statement
|
|
485
|
+
* Format:
|
|
486
|
+
* CREATE VIEW view_name AS
|
|
487
|
+
* SELECT ...
|
|
488
|
+
*
|
|
489
|
+
* CREATE OR REPLACE GLOBAL TEMPORARY VIEW view_name (col1 COMMENT 'desc') AS
|
|
490
|
+
* SELECT ...
|
|
491
|
+
*
|
|
492
|
+
* CREATE VIEW IF NOT EXISTS view_name
|
|
493
|
+
* COMMENT 'description'
|
|
494
|
+
* TBLPROPERTIES ('key' = 'value') AS
|
|
495
|
+
* SELECT ...
|
|
496
|
+
*/
|
|
497
|
+
visitCreateView(ctx: CreateViewContext): void;
|
|
498
|
+
/**
|
|
499
|
+
* Format CREATE METRIC VIEW statement
|
|
500
|
+
* Format:
|
|
501
|
+
* CREATE VIEW view_name
|
|
502
|
+
* WITH METRICS
|
|
503
|
+
* LANGUAGE SQL
|
|
504
|
+
* COMMENT 'description'
|
|
505
|
+
* TBLPROPERTIES ('key' = 'value') AS
|
|
506
|
+
* '...'
|
|
507
|
+
*/
|
|
508
|
+
visitCreateMetricView(ctx: CreateMetricViewContext): void;
|
|
509
|
+
/**
|
|
510
|
+
* Format CREATE TEMP VIEW ... USING statement
|
|
511
|
+
* Format:
|
|
512
|
+
* CREATE TEMPORARY VIEW view_name (col1 STRING, col2 INT)
|
|
513
|
+
* USING CSV
|
|
514
|
+
* OPTIONS ('path' = '/data/path')
|
|
515
|
+
*
|
|
516
|
+
* CREATE OR REPLACE GLOBAL TEMPORARY VIEW view_name
|
|
517
|
+
* USING PARQUET
|
|
518
|
+
* OPTIONS ('path' = '/data/path')
|
|
519
|
+
*/
|
|
520
|
+
visitCreateTempViewUsing(ctx: CreateTempViewUsingContext): void;
|
|
521
|
+
/**
|
|
522
|
+
* Format CREATE FUNCTION statement
|
|
523
|
+
* Format:
|
|
524
|
+
* CREATE FUNCTION simple_udf AS 'SimpleUdf'
|
|
525
|
+
* USING JAR '/tmp/SimpleUdf.jar';
|
|
526
|
+
* CREATE TEMPORARY FUNCTION simple_temp_udf AS 'SimpleUdf'
|
|
527
|
+
* USING JAR '/tmp/SimpleUdf.jar';
|
|
528
|
+
* CREATE OR REPLACE FUNCTION simple_udf AS 'SimpleUdfR'
|
|
529
|
+
* USING JAR '/tmp/SimpleUdfR.jar';
|
|
530
|
+
*/
|
|
531
|
+
visitCreateFunction(ctx: CreateFunctionContext): void;
|
|
532
|
+
/**
|
|
533
|
+
* Format resource in CREATE FUNCTION USING clause
|
|
534
|
+
* Ensures single space between resource type (JAR/FILE/ARCHIVE) and path
|
|
535
|
+
* Format: JAR '/path/to/jar' (not: JAR '/path/to/jar')
|
|
536
|
+
*/
|
|
537
|
+
visitResource(ctx: ResourceContext): void;
|
|
538
|
+
/**
|
|
539
|
+
* Format CREATE INDEX statement
|
|
540
|
+
* Format: CREATE INDEX [IF NOT EXISTS] index_name ON [TABLE] table_name
|
|
541
|
+
* USING index_type
|
|
542
|
+
* (columns)
|
|
543
|
+
* OPTIONS (...)
|
|
544
|
+
*/
|
|
545
|
+
visitCreateIndex(ctx: CreateIndexContext): void;
|
|
546
|
+
/**
|
|
547
|
+
* Helper method to format ALTER TABLE/VIEW common structure
|
|
548
|
+
* Format: ALTER TABLE
|
|
549
|
+
* table_name
|
|
550
|
+
* SUB_COMMAND ...
|
|
551
|
+
*/
|
|
552
|
+
private formatAlterTableHeader;
|
|
553
|
+
/**
|
|
554
|
+
* ALTER TABLE ... ADD COLUMN/COLUMNS
|
|
555
|
+
* Format: ALTER TABLE
|
|
556
|
+
* table_name
|
|
557
|
+
* ADD COLUMN
|
|
558
|
+
* email STRING;
|
|
559
|
+
* Or with multiple columns:
|
|
560
|
+
* ADD COLUMNS (
|
|
561
|
+
* age INT, address STRING
|
|
562
|
+
* );
|
|
563
|
+
*/
|
|
564
|
+
visitAddTableColumns(ctx: AddTableColumnsContext): void;
|
|
565
|
+
/**
|
|
566
|
+
* ALTER TABLE ... RENAME COLUMN from TO to
|
|
567
|
+
* Format: ALTER TABLE
|
|
568
|
+
* table_name
|
|
569
|
+
* RENAME COLUMN
|
|
570
|
+
* name
|
|
571
|
+
* TO
|
|
572
|
+
* full_name;
|
|
573
|
+
*/
|
|
574
|
+
visitRenameTableColumn(ctx: RenameTableColumnContext): void;
|
|
575
|
+
/**
|
|
576
|
+
* ALTER TABLE ... DROP COLUMN/COLUMNS (IF EXISTS)
|
|
577
|
+
* Format: ALTER TABLE
|
|
578
|
+
* table_name
|
|
579
|
+
* DROP COLUMN
|
|
580
|
+
* address;
|
|
581
|
+
*/
|
|
582
|
+
visitDropTableColumns(ctx: DropTableColumnsContext): void;
|
|
583
|
+
/**
|
|
584
|
+
* ALTER TABLE/VIEW ... RENAME TO new_name
|
|
585
|
+
* Format: ALTER TABLE
|
|
586
|
+
* table_name
|
|
587
|
+
* RENAME TO
|
|
588
|
+
* new_table_name;
|
|
589
|
+
*/
|
|
590
|
+
visitRenameTable(ctx: RenameTableContext): void;
|
|
591
|
+
/**
|
|
592
|
+
* ALTER VIEW ... AS query
|
|
593
|
+
* Format: ALTER VIEW tempdb1.v2 AS
|
|
594
|
+
* SELECT
|
|
595
|
+
* *
|
|
596
|
+
* FROM
|
|
597
|
+
* tempdb1.v1;
|
|
598
|
+
*/
|
|
599
|
+
visitAlterViewQuery(ctx: AlterViewQueryContext): void;
|
|
600
|
+
/**
|
|
601
|
+
* ALTER TABLE/VIEW ... SET TBLPROPERTIES (...)
|
|
602
|
+
* Format: ALTER TABLE
|
|
603
|
+
* table_name
|
|
604
|
+
* SET TBLPROPERTIES
|
|
605
|
+
* ('description' = '...');
|
|
606
|
+
*/
|
|
607
|
+
visitSetTableProperties(ctx: SetTablePropertiesContext): void;
|
|
608
|
+
/**
|
|
609
|
+
* ALTER TABLE/VIEW ... UNSET TBLPROPERTIES (IF EXISTS) (...)
|
|
610
|
+
* Format: ALTER TABLE
|
|
611
|
+
* table_name
|
|
612
|
+
* UNSET TBLPROPERTIES
|
|
613
|
+
* ('key');
|
|
614
|
+
*/
|
|
615
|
+
visitUnsetTableProperties(ctx: UnsetTablePropertiesContext): void;
|
|
616
|
+
/**
|
|
617
|
+
* ALTER TABLE ... ALTER/CHANGE COLUMN column_name action
|
|
618
|
+
* Format: ALTER TABLE
|
|
619
|
+
* table_name
|
|
620
|
+
* ALTER COLUMN
|
|
621
|
+
* column_name ...
|
|
622
|
+
*/
|
|
623
|
+
visitAlterTableAlterColumn(ctx: AlterTableAlterColumnContext): void;
|
|
624
|
+
/**
|
|
625
|
+
* Format alterColumnAction for ALTER TABLE ... ALTER COLUMN
|
|
626
|
+
* COMMENT should be on its own line with same indent as column name
|
|
627
|
+
* Format: ALTER TABLE
|
|
628
|
+
* table_name
|
|
629
|
+
* ALTER COLUMN
|
|
630
|
+
* col_name
|
|
631
|
+
* COMMENT 'comment'
|
|
632
|
+
*/
|
|
633
|
+
visitAlterColumnAction(ctx: AlterColumnActionContext): void;
|
|
634
|
+
/**
|
|
635
|
+
* ALTER TABLE ... CHANGE COLUMN old_name new_type [COMMENT] [FIRST|AFTER]
|
|
636
|
+
* Format: ALTER TABLE
|
|
637
|
+
* table_name
|
|
638
|
+
* CHANGE COLUMN
|
|
639
|
+
* name
|
|
640
|
+
* name STRING;
|
|
641
|
+
* Or with position:
|
|
642
|
+
* email STRING
|
|
643
|
+
* FIRST;
|
|
644
|
+
*/
|
|
645
|
+
visitHiveChangeColumn(ctx: HiveChangeColumnContext): void;
|
|
646
|
+
/**
|
|
647
|
+
* ALTER TABLE ... REPLACE COLUMNS (col1 type1, col2 type2)
|
|
648
|
+
* Format: ALTER TABLE
|
|
649
|
+
* table_name
|
|
650
|
+
* REPLACE COLUMNS (
|
|
651
|
+
* col1 type1, col2 type2
|
|
652
|
+
* )
|
|
653
|
+
*/
|
|
654
|
+
visitHiveReplaceColumns(ctx: HiveReplaceColumnsContext): void;
|
|
655
|
+
/**
|
|
656
|
+
* Format qualifiedColTypeWithPositionList for REPLACE COLUMNS / ADD COLUMNS
|
|
657
|
+
* Format: (
|
|
658
|
+
* name string,
|
|
659
|
+
* ID int
|
|
660
|
+
* COMMENT 'new comment'
|
|
661
|
+
* )
|
|
662
|
+
* Each column definition on its own line with indent
|
|
663
|
+
*/
|
|
664
|
+
visitQualifiedColTypeWithPositionList(ctx: QualifiedColTypeWithPositionListContext): void;
|
|
665
|
+
/**
|
|
666
|
+
* Format qualifiedColTypeWithPosition for ADD COLUMNS / REPLACE COLUMNS
|
|
667
|
+
* Ensures single space between field name and data type
|
|
668
|
+
* Format: LastName string (not: LastName string)
|
|
669
|
+
*/
|
|
670
|
+
visitQualifiedColTypeWithPosition(ctx: QualifiedColTypeWithPositionContext): void;
|
|
671
|
+
/**
|
|
672
|
+
* Format multipartIdentifierList for DROP COLUMNS
|
|
673
|
+
* Ensures proper comma formatting: no space before comma, one space after
|
|
674
|
+
* Format: LastName, DOB (not: LastName , DOB)
|
|
675
|
+
*/
|
|
676
|
+
visitMultipartIdentifierList(ctx: MultipartIdentifierListContext): void;
|
|
677
|
+
/**
|
|
678
|
+
* Format column definition descriptors (COMMENT, NOT NULL, DEFAULT, position)
|
|
679
|
+
* COMMENT should be on its own line with extra indent
|
|
680
|
+
* Format: ID int
|
|
681
|
+
* COMMENT 'new comment'
|
|
682
|
+
*/
|
|
683
|
+
visitColDefinitionDescriptorWithPosition(ctx: ColDefinitionDescriptorWithPositionContext): void;
|
|
684
|
+
/**
|
|
685
|
+
* ALTER TABLE ... SET SERDE/SERDEPROPERTIES
|
|
686
|
+
* Format 1: ALTER TABLE
|
|
687
|
+
* table_name
|
|
688
|
+
* SET SERDE
|
|
689
|
+
* 'serde_class'
|
|
690
|
+
* WITH SERDEPROPERTIES
|
|
691
|
+
* (key = 'value')
|
|
692
|
+
* Format 2: ALTER TABLE
|
|
693
|
+
* table_name
|
|
694
|
+
* SET SERDEPROPERTIES
|
|
695
|
+
* (key = 'value')
|
|
696
|
+
*/
|
|
697
|
+
visitSetTableSerDe(ctx: SetTableSerDeContext): void;
|
|
698
|
+
/**
|
|
699
|
+
* ALTER TABLE/VIEW ... ADD (IF NOT EXISTS) PARTITION
|
|
700
|
+
* Format: ALTER TABLE
|
|
701
|
+
* table_name
|
|
702
|
+
* ADD
|
|
703
|
+
* PARTITION(pt = '2023-01-01');
|
|
704
|
+
*/
|
|
705
|
+
visitAddTablePartition(ctx: AddTablePartitionContext): void;
|
|
706
|
+
/**
|
|
707
|
+
* ALTER TABLE ... PARTITION (...) RENAME TO PARTITION (...)
|
|
708
|
+
* Format: ALTER TABLE
|
|
709
|
+
* table_name
|
|
710
|
+
* PARTITION(pt = '2023-01-02')
|
|
711
|
+
* RENAME TO
|
|
712
|
+
* PARTITION(pt = '2023-01-03');
|
|
713
|
+
*/
|
|
714
|
+
visitRenameTablePartition(ctx: RenameTablePartitionContext): void;
|
|
715
|
+
/**
|
|
716
|
+
* ALTER TABLE/VIEW ... DROP (IF EXISTS) PARTITION (...) PURGE?
|
|
717
|
+
* Format: ALTER TABLE
|
|
718
|
+
* table_name
|
|
719
|
+
* DROP
|
|
720
|
+
* PARTITION(pt = '2023-01-01');
|
|
721
|
+
*/
|
|
722
|
+
visitDropTablePartitions(ctx: DropTablePartitionsContext): void;
|
|
723
|
+
/**
|
|
724
|
+
* ALTER TABLE ... (PARTITION) SET LOCATION '...'
|
|
725
|
+
* Format: ALTER TABLE
|
|
726
|
+
* table_name
|
|
727
|
+
* SET
|
|
728
|
+
* LOCATION '/path/to/location';
|
|
729
|
+
*/
|
|
730
|
+
visitSetTableLocation(ctx: SetTableLocationContext): void;
|
|
731
|
+
/**
|
|
732
|
+
* Format locationSpec: LOCATION '/path/to/location'
|
|
733
|
+
* Ensures single space between LOCATION keyword and path value
|
|
734
|
+
* Format: LOCATION '/path' (not: LOCATION '/path')
|
|
735
|
+
*/
|
|
736
|
+
visitLocationSpec(ctx: LocationSpecContext): void;
|
|
737
|
+
/**
|
|
738
|
+
* Format commentSpec: COMMENT 'comment string'
|
|
739
|
+
* Ensures single space between COMMENT keyword and comment value
|
|
740
|
+
* Format: COMMENT 'comment' (not: COMMENT 'comment')
|
|
741
|
+
*/
|
|
742
|
+
visitCommentSpec(ctx: CommentSpecContext): void;
|
|
743
|
+
/**
|
|
744
|
+
* Format identifierCommentList: (ID COMMENT 'desc', Name, ...)
|
|
745
|
+
* Used in CREATE VIEW column definitions
|
|
746
|
+
* Format: (
|
|
747
|
+
* ID COMMENT 'desc',
|
|
748
|
+
* Name
|
|
749
|
+
* ) - each column on new line with indent
|
|
750
|
+
*/
|
|
751
|
+
visitIdentifierCommentList(ctx: IdentifierCommentListContext): void;
|
|
752
|
+
/**
|
|
753
|
+
* Format identifierComment: identifier COMMENT 'desc'
|
|
754
|
+
* Ensures single space between identifier and optional COMMENT clause
|
|
755
|
+
* Format: ID COMMENT 'desc' (not: ID COMMENT 'desc')
|
|
756
|
+
*/
|
|
757
|
+
visitIdentifierComment(ctx: IdentifierCommentContext): void;
|
|
758
|
+
/**
|
|
759
|
+
* ALTER TABLE ... RECOVER PARTITIONS
|
|
760
|
+
* Format: ALTER TABLE
|
|
761
|
+
* table_name
|
|
762
|
+
* RECOVER PARTITIONS
|
|
763
|
+
*/
|
|
764
|
+
visitRecoverPartitions(ctx: RecoverPartitionsContext): void;
|
|
765
|
+
/**
|
|
766
|
+
* Format CREATE DATABASE/NAMESPACE statement
|
|
767
|
+
* Format:
|
|
768
|
+
* CREATE DATABASE IF NOT EXISTS customer_db
|
|
769
|
+
* COMMENT 'This is customer database'
|
|
770
|
+
* LOCATION '/user'
|
|
771
|
+
* WITH DBPROPERTIES (
|
|
772
|
+
* ID = 001,
|
|
773
|
+
* Name = 'John'
|
|
774
|
+
* );
|
|
775
|
+
*/
|
|
776
|
+
visitCreateNamespace(ctx: CreateNamespaceContext): void;
|
|
777
|
+
/**
|
|
778
|
+
* Helper method to format ALTER NAMESPACE common structure
|
|
779
|
+
* Format: ALTER NAMESPACE
|
|
780
|
+
* namespace_name
|
|
781
|
+
* SUB_COMMAND ...
|
|
782
|
+
*/
|
|
783
|
+
private formatAlterNamespaceHeader;
|
|
784
|
+
/**
|
|
785
|
+
* ALTER NAMESPACE ... SET (DBPROPERTIES | PROPERTIES) propertyList
|
|
786
|
+
* Format: ALTER NAMESPACE
|
|
787
|
+
* namespace_name
|
|
788
|
+
* SET DBPROPERTIES
|
|
789
|
+
* ('key1' = 'value1', 'key2' = 'value2');
|
|
790
|
+
*/
|
|
791
|
+
visitSetNamespaceProperties(ctx: SetNamespacePropertiesContext): void;
|
|
792
|
+
/**
|
|
793
|
+
* ALTER NAMESPACE ... UNSET (DBPROPERTIES | PROPERTIES) propertyList
|
|
794
|
+
* Format: ALTER NAMESPACE
|
|
795
|
+
* namespace_name
|
|
796
|
+
* UNSET DBPROPERTIES
|
|
797
|
+
* ('key1', 'key2');
|
|
798
|
+
*/
|
|
799
|
+
visitUnsetNamespaceProperties(ctx: UnsetNamespacePropertiesContext): void;
|
|
800
|
+
/**
|
|
801
|
+
* ALTER NAMESPACE ... collationSpec
|
|
802
|
+
* Format: ALTER NAMESPACE
|
|
803
|
+
* namespace_name
|
|
804
|
+
* COLLATION
|
|
805
|
+
* collation_name;
|
|
806
|
+
*/
|
|
807
|
+
visitSetNamespaceCollation(ctx: SetNamespaceCollationContext): void;
|
|
808
|
+
/**
|
|
809
|
+
* ALTER NAMESPACE ... SET locationSpec
|
|
810
|
+
* Format: ALTER NAMESPACE
|
|
811
|
+
* namespace_name
|
|
812
|
+
* SET
|
|
813
|
+
* LOCATION '/path/to/location';
|
|
814
|
+
*/
|
|
815
|
+
visitSetNamespaceLocation(ctx: SetNamespaceLocationContext): void;
|
|
816
|
+
/**
|
|
817
|
+
* Query primary: handles inlineTable, subquery, tableName, etc.
|
|
818
|
+
* For inlineTable with AS alias, ensure the alias stays on the same line as VALUES
|
|
819
|
+
*/
|
|
820
|
+
visitQueryPrimary(ctx: QueryPrimaryContext): void;
|
|
821
|
+
/**
|
|
822
|
+
* Relation primary: handles tableName, inlineTable, subquery, etc.
|
|
823
|
+
* For inlineTable, we want to prevent unwanted line breaks
|
|
824
|
+
*/
|
|
825
|
+
visitRelationPrimary(ctx: RelationPrimaryContext): void;
|
|
826
|
+
visitSingleInsertQuery(ctx: SingleInsertQueryContext): void;
|
|
827
|
+
visitInsertIntoTable(ctx: InsertIntoTableContext): void;
|
|
828
|
+
visitInsertOverwriteTable(ctx: InsertOverwriteTableContext): void;
|
|
829
|
+
visitPartitionSpec(ctx: PartitionSpecContext): void;
|
|
830
|
+
/**
|
|
831
|
+
* Format partition value: pt = 'value' or pt = DEFAULT
|
|
832
|
+
* Ensure space around equals sign
|
|
833
|
+
*/
|
|
834
|
+
visitPartitionVal(ctx: PartitionValContext): void;
|
|
835
|
+
visitInlineTable(ctx: InlineTableContext): void;
|
|
836
|
+
/**
|
|
837
|
+
* Row constructor for VALUES clause: (expr1, expr2, ...)
|
|
838
|
+
* Ensures no extra spaces inside parentheses and proper comma spacing
|
|
839
|
+
* Format (short): ('value1', 'value2') not ( 'value1', 'value2' )
|
|
840
|
+
* Format (long): (
|
|
841
|
+
* expr1,
|
|
842
|
+
* expr2,
|
|
843
|
+
* ...
|
|
844
|
+
* )
|
|
845
|
+
*/
|
|
846
|
+
visitRowConstructor(ctx: RowConstructorContext): void;
|
|
847
|
+
/**
|
|
848
|
+
* Table alias: t(k, v) or AS t(k, v)
|
|
849
|
+
* Ensures single space before alias identifier and no space between identifier and column list
|
|
850
|
+
* Format: ... t(k, v) not ... t (k, v)
|
|
851
|
+
*/
|
|
852
|
+
visitTableAlias(ctx: TableAliasContext): void;
|
|
853
|
+
/**
|
|
854
|
+
* Identifier list for table alias: t(k, v)
|
|
855
|
+
* Ensures no extra spaces inside parentheses and proper comma spacing
|
|
856
|
+
* Format (short): t(k, v) not t(k,v) or t( k , v )
|
|
857
|
+
* Format (long): t(
|
|
858
|
+
* col1,
|
|
859
|
+
* col2,
|
|
860
|
+
* col3
|
|
861
|
+
* )
|
|
862
|
+
*/
|
|
863
|
+
visitIdentifierList(ctx: IdentifierListContext): void;
|
|
864
|
+
/**
|
|
865
|
+
* Identifier sequence: k, v, ...
|
|
866
|
+
* Note: Comma formatting is handled by parent (visitIdentifierList) when using formatParenthesizedContent
|
|
867
|
+
* This method only handles cases where identifierSeq is used outside of identifierList
|
|
868
|
+
*/
|
|
869
|
+
visitIdentifierSeq(ctx: IdentifierSeqContext): void;
|
|
870
|
+
visitQuery(ctx: QueryContext): void;
|
|
871
|
+
visitSetOperation(ctx: SetOperationContext): void;
|
|
872
|
+
visitQueryOrganization(ctx: QueryOrganizationContext): void;
|
|
873
|
+
visitCtes(ctx: CtesContext): void;
|
|
874
|
+
visitNamedQuery(ctx: NamedQueryContext): void;
|
|
875
|
+
visitRegularQuerySpecification(ctx: RegularQuerySpecificationContext): void;
|
|
876
|
+
visitSelectClause(ctx: SelectClauseContext): void;
|
|
877
|
+
/**
|
|
878
|
+
* Format fromStatementBody - used in multiInsertQuery (FROM table SELECT ...)
|
|
879
|
+
* The SELECT clause should be on a new line, aligned with FROM
|
|
880
|
+
*/
|
|
881
|
+
visitFromStatementBody(ctx: FromStatementBodyContext): void;
|
|
882
|
+
/**
|
|
883
|
+
* Format multi-insert query:
|
|
884
|
+
* FROM source_table
|
|
885
|
+
* INSERT INTO table1 SELECT col1, col2 WHERE condition1
|
|
886
|
+
* INSERT INTO table2 SELECT col3, col4 WHERE condition2
|
|
887
|
+
* INSERT OVERWRITE TABLE3 SELECT *;
|
|
888
|
+
*
|
|
889
|
+
* Formatting rules:
|
|
890
|
+
* - FROM clause as the starting point (no indent)
|
|
891
|
+
* - Each INSERT clause on a new line
|
|
892
|
+
* - SELECT parts are formatted according to query formatting rules
|
|
893
|
+
*/
|
|
894
|
+
visitMultiInsertQuery(ctx: MultiInsertQueryContext): void;
|
|
895
|
+
/**
|
|
896
|
+
* Format each multi-insert query body:
|
|
897
|
+
* INSERT INTO table_name SELECT ... WHERE ...
|
|
898
|
+
*
|
|
899
|
+
* Each body starts with INSERT and contains the full query specification.
|
|
900
|
+
* Subsequent INSERT bodies should each be on their own line.
|
|
901
|
+
*/
|
|
902
|
+
visitMultiInsertQueryBody(ctx: MultiInsertQueryBodyContext): void;
|
|
903
|
+
visitSetQuantifier(ctx: SetQuantifierContext): void;
|
|
904
|
+
visitNamedExpressionSeq(ctx: NamedExpressionSeqContext): void;
|
|
905
|
+
visitNamedExpression(ctx: NamedExpressionContext): void;
|
|
906
|
+
/**
|
|
907
|
+
* DELETE FROM table_name WHERE condition
|
|
908
|
+
* Format: DELETE FROM
|
|
909
|
+
* table_name
|
|
910
|
+
* WHERE
|
|
911
|
+
* condition;
|
|
912
|
+
* Note: DELETE FROM stays on same line (unlike SELECT's FROM which is on its own line)
|
|
913
|
+
*/
|
|
914
|
+
visitDeleteFromTable(ctx: DeleteFromTableContext): void;
|
|
915
|
+
/**
|
|
916
|
+
* UPDATE table_name SET col1 = val1, col2 = val2 WHERE condition
|
|
917
|
+
* Format: UPDATE
|
|
918
|
+
* table_name
|
|
919
|
+
* SET
|
|
920
|
+
* column1 = value1,
|
|
921
|
+
* column2 = value2
|
|
922
|
+
* WHERE
|
|
923
|
+
* condition;
|
|
924
|
+
*/
|
|
925
|
+
visitUpdateTable(ctx: UpdateTableContext): void;
|
|
926
|
+
/**
|
|
927
|
+
* SET clause in UPDATE statement
|
|
928
|
+
* Format: SET
|
|
929
|
+
* column1 = value1,
|
|
930
|
+
* column2 = value2
|
|
931
|
+
*/
|
|
932
|
+
visitSetClause(ctx: SetClauseContext): void;
|
|
933
|
+
/**
|
|
934
|
+
* MERGE INTO statement
|
|
935
|
+
* Format:
|
|
936
|
+
* MERGE INTO
|
|
937
|
+
* target_table t
|
|
938
|
+
* USING
|
|
939
|
+
* source_table s
|
|
940
|
+
* ON
|
|
941
|
+
* t.id = s.id
|
|
942
|
+
* WHEN MATCHED THEN UPDATE SET t.name = s.name
|
|
943
|
+
* WHEN NOT MATCHED THEN INSERT (id, name) VALUES (s.id, s.name)
|
|
944
|
+
* WHEN NOT MATCHED BY SOURCE THEN DELETE;
|
|
945
|
+
*
|
|
946
|
+
* Or with SCHEMA EVOLUTION:
|
|
947
|
+
* MERGE WITH SCHEMA EVOLUTION INTO
|
|
948
|
+
* target_table t
|
|
949
|
+
* USING
|
|
950
|
+
* source_table s
|
|
951
|
+
* ON
|
|
952
|
+
* t.id = s.id
|
|
953
|
+
* ...
|
|
954
|
+
*/
|
|
955
|
+
visitMergeIntoTable(ctx: MergeIntoTableContext): void;
|
|
956
|
+
/**
|
|
957
|
+
* Format WHEN MATCHED clause
|
|
958
|
+
* Format: WHEN MATCHED [AND condition] THEN UPDATE SET ...
|
|
959
|
+
* All on same line
|
|
960
|
+
*/
|
|
961
|
+
visitMatchedClause(ctx: MatchedClauseContext): void;
|
|
962
|
+
/**
|
|
963
|
+
* Format WHEN NOT MATCHED clause
|
|
964
|
+
* Format: WHEN NOT MATCHED [BY TARGET] [AND condition] THEN INSERT ...
|
|
965
|
+
* All on same line
|
|
966
|
+
*/
|
|
967
|
+
visitNotMatchedClause(ctx: NotMatchedClauseContext): void;
|
|
968
|
+
/**
|
|
969
|
+
* Format WHEN NOT MATCHED BY SOURCE clause
|
|
970
|
+
* Format: WHEN NOT MATCHED BY SOURCE [AND condition] THEN DELETE/UPDATE ...
|
|
971
|
+
* All on same line
|
|
972
|
+
*/
|
|
973
|
+
visitNotMatchedBySourceClause(ctx: NotMatchedBySourceClauseContext): void;
|
|
974
|
+
visitFromClause(ctx: FromClauseContext): void;
|
|
975
|
+
visitTable(ctx: TableContext): void;
|
|
976
|
+
visitTableName(ctx: TableNameContext): void;
|
|
977
|
+
visitJoinRelation(ctx: JoinRelationContext): void;
|
|
978
|
+
/**
|
|
979
|
+
* Format join type keywords: LEFT OUTER, RIGHT OUTER, FULL OUTER, etc.
|
|
980
|
+
* Ensures single space between keywords
|
|
981
|
+
*/
|
|
982
|
+
visitJoinType(ctx: JoinTypeContext): void;
|
|
983
|
+
visitJoinCriteria(ctx: JoinCriteriaContext): void;
|
|
984
|
+
visitLateralView(ctx: LateralViewContext): void;
|
|
985
|
+
visitAliasedQuery(ctx: AliasedQueryContext): void;
|
|
986
|
+
/**
|
|
987
|
+
* Check if a context is inside a SELECT expression (e.g., select (subquery) as alias)
|
|
988
|
+
*/
|
|
989
|
+
private isInsideSelectExpression;
|
|
990
|
+
visitWhereClause(ctx: WhereClauseContext): void;
|
|
991
|
+
visitAggregationClause(ctx: AggregationClauseContext): void;
|
|
992
|
+
visitGroupingAnalytics(ctx: GroupingAnalyticsContext): void;
|
|
993
|
+
/**
|
|
994
|
+
* Format grouping set: (expr1, expr2, ...) or single expression
|
|
995
|
+
* Ensures no extra spaces inside parentheses and proper comma spacing
|
|
996
|
+
* Format: (region, category, year) not ( region, category, year)
|
|
997
|
+
*/
|
|
998
|
+
visitGroupingSet(ctx: GroupingSetContext): void;
|
|
999
|
+
visitHavingClause(ctx: HavingClauseContext): void;
|
|
1000
|
+
visitPivotClause(ctx: PivotClauseContext): void;
|
|
1001
|
+
visitUnpivotClause(ctx: UnpivotClauseContext): void;
|
|
1002
|
+
visitUnpivotNullClause(ctx: UnpivotNullClauseContext): void;
|
|
1003
|
+
visitSample(ctx: SampleContext): void;
|
|
1004
|
+
visitSampleByPercentile(ctx: SampleByPercentileContext): void;
|
|
1005
|
+
visitUnpivotMultiValueColumnClause(ctx: UnpivotMultiValueColumnClauseContext): void;
|
|
1006
|
+
visitUnpivotSingleValueColumnClause(ctx: UnpivotSingleValueColumnClauseContext): void;
|
|
1007
|
+
visitUnpivotColumnSet(ctx: UnpivotColumnSetContext): void;
|
|
1008
|
+
visitWindowClause(ctx: WindowClauseContext): void;
|
|
1009
|
+
visitNamedWindow(ctx: NamedWindowContext): void;
|
|
1010
|
+
visitWindowDef(ctx: WindowDefContext): void;
|
|
1011
|
+
/**
|
|
1012
|
+
* Format window frame clause: ROWS/RANGE [BETWEEN ... AND ...]
|
|
1013
|
+
* Ensures single space between keywords
|
|
1014
|
+
* Format: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
|
|
1015
|
+
*/
|
|
1016
|
+
visitWindowFrame(ctx: WindowFrameContext): void;
|
|
1017
|
+
/**
|
|
1018
|
+
* Format frame bound: UNBOUNDED PRECEDING/FOLLOWING or CURRENT ROW
|
|
1019
|
+
* Ensures single space between keywords
|
|
1020
|
+
*/
|
|
1021
|
+
visitFrameBound(ctx: FrameBoundContext): void;
|
|
1022
|
+
visitSortItem(ctx: SortItemContext): void;
|
|
1023
|
+
private hasLogicalBinary;
|
|
1024
|
+
visitSearchedCase(ctx: SearchedCaseContext): void;
|
|
1025
|
+
visitSimpleCase(ctx: SimpleCaseContext): void;
|
|
1026
|
+
visitWhenClause(ctx: WhenClauseContext): void;
|
|
1027
|
+
private formatOrderedAggregateFunctionCall;
|
|
1028
|
+
private formatOuterWrapperFunctionCall;
|
|
1029
|
+
visitFunctionCall(ctx: FunctionCallContext): void;
|
|
1030
|
+
private isListAggFunctionCall;
|
|
1031
|
+
private containsWithinGroupClause;
|
|
1032
|
+
private isMultilineWithinGroupTarget;
|
|
1033
|
+
private isIntervalValueContext;
|
|
1034
|
+
private containsMultilineFunctionArgument;
|
|
1035
|
+
private hasMultilineFunctionCallChild;
|
|
1036
|
+
private classifyFunctionCallKind;
|
|
1037
|
+
/**
|
|
1038
|
+
* Format ANY_VALUE function: ANY_VALUE(expression [IGNORE NULLS])
|
|
1039
|
+
* Ensures compact format - no newlines inside parentheses
|
|
1040
|
+
*/
|
|
1041
|
+
visitAny_value(ctx: Any_valueContext): void;
|
|
1042
|
+
/**
|
|
1043
|
+
* Format FIRST function: FIRST(expression [IGNORE NULLS])
|
|
1044
|
+
* Ensures compact format - no newlines inside parentheses
|
|
1045
|
+
*/
|
|
1046
|
+
visitFirst(ctx: FirstContext): void;
|
|
1047
|
+
/**
|
|
1048
|
+
* Format LAST function: LAST(expression [IGNORE NULLS])
|
|
1049
|
+
* Ensures compact format - no newlines inside parentheses
|
|
1050
|
+
*/
|
|
1051
|
+
visitLast(ctx: LastContext): void;
|
|
1052
|
+
/**
|
|
1053
|
+
* Format TIMESTAMPADD function: TIMESTAMPADD(unit, amount, timestamp)
|
|
1054
|
+
* Ensures compact format - no newlines inside parentheses
|
|
1055
|
+
*/
|
|
1056
|
+
visitTimestampadd(ctx: TimestampaddContext): void;
|
|
1057
|
+
/**
|
|
1058
|
+
* Format TIMESTAMPDIFF function: TIMESTAMPDIFF(unit, startTimestamp, endTimestamp)
|
|
1059
|
+
* Ensures compact format - no newlines inside parentheses
|
|
1060
|
+
*/
|
|
1061
|
+
visitTimestampdiff(ctx: TimestampdiffContext): void;
|
|
1062
|
+
/**
|
|
1063
|
+
* Format POSITION function: POSITION(substr IN str)
|
|
1064
|
+
* Ensures compact format - no newlines inside parentheses
|
|
1065
|
+
*/
|
|
1066
|
+
visitPosition(ctx: PositionContext): void;
|
|
1067
|
+
/**
|
|
1068
|
+
* Format STRUCT function: STRUCT(expr1 [AS alias1], expr2 [AS alias2], ...)
|
|
1069
|
+
* Ensures compact format - no newlines inside parentheses
|
|
1070
|
+
*/
|
|
1071
|
+
visitStruct(ctx: StructContext): void;
|
|
1072
|
+
/**
|
|
1073
|
+
* Format TRIM function: TRIM([BOTH|LEADING|TRAILING] [trimStr] FROM srcStr)
|
|
1074
|
+
* Ensures no space after left paren and no space before right paren
|
|
1075
|
+
* Format: TRIM(BOTH ' ' FROM column) not TRIM( BOTH ' ' FROM column )
|
|
1076
|
+
*/
|
|
1077
|
+
visitTrim(ctx: TrimContext): void;
|
|
1078
|
+
/**
|
|
1079
|
+
* Format CAST and TRY_CAST expressions
|
|
1080
|
+
* Ensures proper spacing:
|
|
1081
|
+
* CAST(customer_id AS STRING) - no space after ( or before )
|
|
1082
|
+
* TRY_CAST(amount AS DECIMAL(10, 2)) - same formatting rules
|
|
1083
|
+
*/
|
|
1084
|
+
visitCast(ctx: CastContext): void;
|
|
1085
|
+
visitSubqueryExpression(ctx: SubqueryExpressionContext): void;
|
|
1086
|
+
/**
|
|
1087
|
+
* Format subquery: (query) - used in CTAS without AS keyword
|
|
1088
|
+
* Format:
|
|
1089
|
+
* CLUSTERED BY (id) INTO 4 buckets (
|
|
1090
|
+
* WITH tmpTable AS (...)
|
|
1091
|
+
* SELECT ...
|
|
1092
|
+
* )
|
|
1093
|
+
* Left parenthesis stays on same line, content indented, right parenthesis on new line
|
|
1094
|
+
*/
|
|
1095
|
+
visitSubquery(ctx: SubqueryContext): void;
|
|
1096
|
+
visitParenthesizedExpression(ctx: ParenthesizedExpressionContext): void;
|
|
1097
|
+
visitLogicalBinary(ctx: LogicalBinaryContext): void;
|
|
1098
|
+
visitLogicalNot(ctx: LogicalNotContext): void;
|
|
1099
|
+
visitCollateClause(ctx: CollateClauseContext): void;
|
|
1100
|
+
visitCollate(ctx: CollateContext): void;
|
|
1101
|
+
visitComparison(ctx: ComparisonContext): void;
|
|
1102
|
+
visitPredicate(ctx: PredicateContext): void;
|
|
1103
|
+
visitExists(ctx: ExistsContext): void;
|
|
1104
|
+
visitIntervalValue(ctx: IntervalValueContext): void;
|
|
1105
|
+
visitArithmeticBinary(ctx: ArithmeticBinaryContext): void;
|
|
1106
|
+
visitDereference(ctx: DereferenceContext): void;
|
|
1107
|
+
visitStar(ctx: StarContext): void;
|
|
1108
|
+
visitExceptClause(ctx: ExceptClauseContext): void;
|
|
1109
|
+
/**
|
|
1110
|
+
* Format partitionFieldList: (field1, field2, ...)
|
|
1111
|
+
* Ensures space after BY keyword and proper parenthesis formatting
|
|
1112
|
+
* Format: PARTITIONED BY (age INT) not: PARTITIONED BY(age INT) or PARTITIONED BY (age)
|
|
1113
|
+
*/
|
|
1114
|
+
visitPartitionFieldList(ctx: PartitionFieldListContext): void;
|
|
1115
|
+
/**
|
|
1116
|
+
* Format bucketSpec: CLUSTERED BY (col1, col2) SORTED BY (col1) INTO n BUCKETS
|
|
1117
|
+
* Ensures single space between all keywords
|
|
1118
|
+
* Format: CLUSTERED BY (id) SORTED BY (id) INTO 4 BUCKETS
|
|
1119
|
+
*/
|
|
1120
|
+
visitBucketSpec(ctx: BucketSpecContext): void;
|
|
1121
|
+
/**
|
|
1122
|
+
* Format orderedIdentifierList: (col1 ASC, col2 DESC)
|
|
1123
|
+
* Used by SORTED BY clause in bucketSpec
|
|
1124
|
+
* Ensures proper parenthesis and comma formatting
|
|
1125
|
+
*/
|
|
1126
|
+
visitOrderedIdentifierList(ctx: OrderedIdentifierListContext): void;
|
|
1127
|
+
/**
|
|
1128
|
+
* Format orderedIdentifier: column ASC/DESC
|
|
1129
|
+
* Ensures single space between identifier and ordering keyword (ASC/DESC)
|
|
1130
|
+
* Format: ID ASC not: ID ASC
|
|
1131
|
+
*/
|
|
1132
|
+
visitOrderedIdentifier(ctx: OrderedIdentifierContext): void;
|
|
1133
|
+
/**
|
|
1134
|
+
* Format createFileFormat: STORED AS format or STORED BY handler
|
|
1135
|
+
* Ensures single space between STORED and AS/BY keywords
|
|
1136
|
+
* Format: STORED AS PARQUET not: STORED AS PARQUET
|
|
1137
|
+
*/
|
|
1138
|
+
visitCreateFileFormat(ctx: CreateFileFormatContext): void;
|
|
1139
|
+
/**
|
|
1140
|
+
* Format tableFileFormat: INPUTFORMAT 'input_class' OUTPUTFORMAT 'output_class'
|
|
1141
|
+
*
|
|
1142
|
+
* Normal mode (short line):
|
|
1143
|
+
* STORED AS INPUTFORMAT 'input_class' OUTPUTFORMAT 'output_class'
|
|
1144
|
+
*
|
|
1145
|
+
* Wrap mode (long line > maxParenthesisLength):
|
|
1146
|
+
* STORED AS INPUTFORMAT 'input_class'
|
|
1147
|
+
* OUTPUTFORMAT 'output_class'
|
|
1148
|
+
*/
|
|
1149
|
+
visitTableFileFormat(ctx: TableFileFormatContext): void;
|
|
1150
|
+
/**
|
|
1151
|
+
* Format rowFormatSerde: ROW FORMAT SERDE 'serde_class' WITH SERDEPROPERTIES (...)
|
|
1152
|
+
* Ensures single space between ROW, FORMAT, SERDE keywords
|
|
1153
|
+
* Format: ROW FORMAT SERDE 'class' not: ROW FORMAT SERDE 'class'
|
|
1154
|
+
*/
|
|
1155
|
+
visitRowFormatSerde(ctx: RowFormatSerdeContext): void;
|
|
1156
|
+
/**
|
|
1157
|
+
* Format rowFormatDelimited: ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' ...
|
|
1158
|
+
* Each parameter group should be on its own line for readability
|
|
1159
|
+
* Format:
|
|
1160
|
+
* ROW FORMAT DELIMITED
|
|
1161
|
+
* FIELDS TERMINATED BY ','
|
|
1162
|
+
* ESCAPED BY '\\'
|
|
1163
|
+
* COLLECTION ITEMS TERMINATED BY '_'
|
|
1164
|
+
* MAP KEYS TERMINATED BY ':'
|
|
1165
|
+
* LINES TERMINATED BY '\n'
|
|
1166
|
+
* NULL DEFINED AS 'foonull'
|
|
1167
|
+
*/
|
|
1168
|
+
visitRowFormatDelimited(ctx: RowFormatDelimitedContext): void;
|
|
1169
|
+
/**
|
|
1170
|
+
* Format complex data types: ARRAY<>, MAP<>, STRUCT<>
|
|
1171
|
+
* Ensures proper spacing inside angle brackets
|
|
1172
|
+
* Format:
|
|
1173
|
+
* ARRAY<STRING> (not: ARRAY <STRING> or ARRAY< STRING >)
|
|
1174
|
+
* MAP<STRING, INT> (not: MAP <STRING, INT> or MAP<STRING, INT>)
|
|
1175
|
+
* STRUCT<field: type> (not: STRUCT <field: type> or STRUCT<field: type>)
|
|
1176
|
+
*/
|
|
1177
|
+
visitComplexDataType(ctx: ComplexDataTypeContext): void;
|
|
1178
|
+
/**
|
|
1179
|
+
* Format non-trivial primitive data types: DECIMAL(10, 2), VARCHAR(50), etc.
|
|
1180
|
+
* Ensures proper spacing inside parentheses
|
|
1181
|
+
* Format:
|
|
1182
|
+
* DECIMAL(10, 2) (not: DECIMAL( 10,2 ) or DECIMAL(10,2))
|
|
1183
|
+
* VARCHAR(50) (not: VARCHAR( 50 ) or VARCHAR(50 ))
|
|
1184
|
+
*/
|
|
1185
|
+
visitNonTrivialPrimitiveType(ctx: NonTrivialPrimitiveTypeContext): void;
|
|
1186
|
+
/**
|
|
1187
|
+
* Format primitive types with parentheses (e.g., TIMESTAMP(6), unsupported types with params)
|
|
1188
|
+
* Ensures proper spacing inside parentheses
|
|
1189
|
+
* Format:
|
|
1190
|
+
* TIMESTAMP(6) (not: TIMESTAMP( 6 ) or TIMESTAMP(6 ))
|
|
1191
|
+
* custom_type(10, 2) (not: custom_type( 10,2 ) or custom_type(10,2 ))
|
|
1192
|
+
*/
|
|
1193
|
+
visitPrimitiveType(ctx: PrimitiveTypeContext): void;
|
|
1194
|
+
/**
|
|
1195
|
+
* Format colTypeList: col1 TYPE, col2 TYPE, ...
|
|
1196
|
+
* Used in CREATE TEMP VIEW ... (col1 TYPE, col2 TYPE) USING ...
|
|
1197
|
+
* Ensures proper comma formatting: no space before, single space after
|
|
1198
|
+
* Format: (id INT, name STRING) not: (id INT , name STRING)
|
|
1199
|
+
*/
|
|
1200
|
+
visitColTypeList(ctx: ColTypeListContext): void;
|
|
1201
|
+
/**
|
|
1202
|
+
* Format colType: colName dataType [NOT NULL] [COMMENT '...']
|
|
1203
|
+
* Ensures single space between column name and data type
|
|
1204
|
+
* Format: id INT not: id INT
|
|
1205
|
+
*/
|
|
1206
|
+
visitColType(ctx: ColTypeContext): void;
|
|
1207
|
+
/**
|
|
1208
|
+
* Format complexColTypeList: field1: type1, field2: type2
|
|
1209
|
+
* Used inside STRUCT<...>
|
|
1210
|
+
* Ensures proper spacing between fields
|
|
1211
|
+
*/
|
|
1212
|
+
visitComplexColTypeList(ctx: ComplexColTypeListContext): void;
|
|
1213
|
+
/**
|
|
1214
|
+
* Format complexColType: fieldName: dataType
|
|
1215
|
+
* Used inside STRUCT<...>
|
|
1216
|
+
* Ensures single space after colon (or no space based on preference)
|
|
1217
|
+
* Format: field: TYPE (not: field: TYPE)
|
|
1218
|
+
*/
|
|
1219
|
+
visitComplexColType(ctx: ComplexColTypeContext): void;
|
|
1220
|
+
/**
|
|
1221
|
+
* Format DROP DATABASE/NAMESPACE/SCHEMA statement
|
|
1222
|
+
* Format: DROP DATABASE [IF EXISTS] db_name [RESTRICT|CASCADE]
|
|
1223
|
+
*/
|
|
1224
|
+
visitDropNamespace(ctx: DropNamespaceContext): void;
|
|
1225
|
+
/**
|
|
1226
|
+
* Format DROP TABLE statement
|
|
1227
|
+
* Format: DROP TABLE [IF EXISTS] table_name [PURGE]
|
|
1228
|
+
*/
|
|
1229
|
+
visitDropTable(ctx: DropTableContext): void;
|
|
1230
|
+
/**
|
|
1231
|
+
* Format DROP VIEW statement
|
|
1232
|
+
* Format: DROP VIEW [IF EXISTS] view_name
|
|
1233
|
+
*/
|
|
1234
|
+
visitDropView(ctx: DropViewContext): void;
|
|
1235
|
+
/**
|
|
1236
|
+
* Format DROP FUNCTION statement
|
|
1237
|
+
* Format: DROP [TEMPORARY] FUNCTION [IF EXISTS] function_name
|
|
1238
|
+
*/
|
|
1239
|
+
visitDropFunction(ctx: DropFunctionContext): void;
|
|
1240
|
+
/**
|
|
1241
|
+
* Format LOAD DATA statement
|
|
1242
|
+
* Format: LOAD DATA [LOCAL] INPATH 'path' [OVERWRITE] INTO TABLE table_name [PARTITION (...)]
|
|
1243
|
+
*/
|
|
1244
|
+
visitLoadData(ctx: LoadDataContext): void;
|
|
1245
|
+
/**
|
|
1246
|
+
* Format TRUNCATE TABLE statement
|
|
1247
|
+
* Format: TRUNCATE TABLE table_name [PARTITION (...)]
|
|
1248
|
+
*/
|
|
1249
|
+
visitTruncateTable(ctx: TruncateTableContext): void;
|
|
1250
|
+
/**
|
|
1251
|
+
* Format REPAIR TABLE statement
|
|
1252
|
+
* Format: [MSCK] REPAIR TABLE table_name [ADD|DROP|SYNC PARTITIONS]
|
|
1253
|
+
*/
|
|
1254
|
+
visitRepairTable(ctx: RepairTableContext): void;
|
|
1255
|
+
/**
|
|
1256
|
+
* Format ANALYZE TABLE statement
|
|
1257
|
+
* Format: ANALYZE TABLE table_name [PARTITION (...)] COMPUTE STATISTICS [FOR COLUMNS ...]
|
|
1258
|
+
*/
|
|
1259
|
+
visitAnalyze(ctx: AnalyzeContext): void;
|
|
1260
|
+
/**
|
|
1261
|
+
* Format ANALYZE TABLES statement
|
|
1262
|
+
* Format: ANALYZE TABLES [FROM|IN db_name] COMPUTE STATISTICS [NOSCAN]
|
|
1263
|
+
*/
|
|
1264
|
+
visitAnalyzeTables(ctx: AnalyzeTablesContext): void;
|
|
1265
|
+
/**
|
|
1266
|
+
* Format CACHE TABLE statement
|
|
1267
|
+
* Format: CACHE [LAZY] TABLE table_name [OPTIONS (...)] [AS query]
|
|
1268
|
+
*/
|
|
1269
|
+
visitCacheTable(ctx: CacheTableContext): void;
|
|
1270
|
+
/**
|
|
1271
|
+
* Format UNCACHE TABLE statement
|
|
1272
|
+
* Format: UNCACHE TABLE [IF EXISTS] table_name
|
|
1273
|
+
*/
|
|
1274
|
+
visitUncacheTable(ctx: UncacheTableContext): void;
|
|
1275
|
+
/**
|
|
1276
|
+
* Format CLEAR CACHE statement
|
|
1277
|
+
* Format: CLEAR CACHE
|
|
1278
|
+
*/
|
|
1279
|
+
visitClearCache(ctx: ClearCacheContext): void;
|
|
1280
|
+
/**
|
|
1281
|
+
* Format REFRESH TABLE statement
|
|
1282
|
+
* Format: REFRESH TABLE table_name
|
|
1283
|
+
*/
|
|
1284
|
+
visitRefreshTable(ctx: RefreshTableContext): void;
|
|
1285
|
+
/**
|
|
1286
|
+
* Format REFRESH FUNCTION statement
|
|
1287
|
+
* Format: REFRESH FUNCTION function_name
|
|
1288
|
+
*/
|
|
1289
|
+
visitRefreshFunction(ctx: RefreshFunctionContext): void;
|
|
1290
|
+
/**
|
|
1291
|
+
* Format DESCRIBE FUNCTION statement
|
|
1292
|
+
* Format: DESC|DESCRIBE FUNCTION [EXTENDED] function_name
|
|
1293
|
+
*/
|
|
1294
|
+
visitDescribeFunction(ctx: DescribeFunctionContext): void;
|
|
1295
|
+
/**
|
|
1296
|
+
* Format DESCRIBE PROCEDURE statement
|
|
1297
|
+
* Format: DESC|DESCRIBE PROCEDURE procedure_name
|
|
1298
|
+
*/
|
|
1299
|
+
visitDescribeProcedure(ctx: DescribeProcedureContext): void;
|
|
1300
|
+
/**
|
|
1301
|
+
* Format DESCRIBE NAMESPACE statement
|
|
1302
|
+
* Format: DESC|DESCRIBE (DATABASE|SCHEMA|NAMESPACE) [EXTENDED] identifier_reference
|
|
1303
|
+
*/
|
|
1304
|
+
visitDescribeNamespace(ctx: DescribeNamespaceContext): void;
|
|
1305
|
+
/**
|
|
1306
|
+
* Format DESCRIBE RELATION statement (for tables, views, etc.)
|
|
1307
|
+
* Format: DESC|DESCRIBE [TABLE] [EXTENDED|FORMATTED] table_name [PARTITION (...)] [col_name] [AS JSON]
|
|
1308
|
+
*/
|
|
1309
|
+
visitDescribeRelation(ctx: DescribeRelationContext): void;
|
|
1310
|
+
/**
|
|
1311
|
+
* Format DESCRIBE QUERY statement
|
|
1312
|
+
* Format: DESC|DESCRIBE [QUERY] query
|
|
1313
|
+
* Rules:
|
|
1314
|
+
* 1. DESC/DESCRIBE without QUERY - DESCRIBE on own line, query on next line
|
|
1315
|
+
* 2. DESC/DESCRIBE with QUERY - DESCRIBE QUERY on own line, query on next line
|
|
1316
|
+
* Expected format:
|
|
1317
|
+
* DESCRIBE QUERY
|
|
1318
|
+
* SELECT ...
|
|
1319
|
+
* Or:
|
|
1320
|
+
* DESCRIBE
|
|
1321
|
+
* SELECT ...
|
|
1322
|
+
*/
|
|
1323
|
+
visitDescribeQuery(ctx: DescribeQueryContext): void;
|
|
1324
|
+
/**
|
|
1325
|
+
* Format COMMENT ON NAMESPACE statement
|
|
1326
|
+
* Format: COMMENT ON NAMESPACE identifier IS 'comment text'
|
|
1327
|
+
* Rules:
|
|
1328
|
+
* - COMMENT ON 与对象类型间使用单个空格
|
|
1329
|
+
* - IS 关键字前后添加空格
|
|
1330
|
+
* - 注释文本内容保持原样不变
|
|
1331
|
+
*/
|
|
1332
|
+
visitCommentNamespace(ctx: CommentNamespaceContext): void;
|
|
1333
|
+
/**
|
|
1334
|
+
* Format COMMENT ON TABLE statement
|
|
1335
|
+
* Format: COMMENT ON TABLE identifier IS 'comment text'
|
|
1336
|
+
* Rules:
|
|
1337
|
+
* - COMMENT ON 与对象类型间使用单个空格
|
|
1338
|
+
* - IS 关键字前后添加空格
|
|
1339
|
+
* - 注释文本内容保持原样不变
|
|
1340
|
+
*/
|
|
1341
|
+
visitCommentTable(ctx: CommentTableContext): void;
|
|
1342
|
+
/**
|
|
1343
|
+
* Format MERGE INTO statement
|
|
1344
|
+
* Format:
|
|
1345
|
+
* MERGE INTO target_table t
|
|
1346
|
+
* USING source_table s
|
|
1347
|
+
* ON t.id = s.id
|
|
1348
|
+
* WHEN MATCHED THEN UPDATE SET t.name = s.name
|
|
1349
|
+
*/
|
|
1350
|
+
/**
|
|
1351
|
+
* Format pipe operator statement
|
|
1352
|
+
* The pipe operator (|> or single |) passes the result of the left query to the right side operation.
|
|
1353
|
+
*
|
|
1354
|
+
* Format rules based on pipe.sql:
|
|
1355
|
+
* - `|>` or `|` starts on a new line with proper indentation
|
|
1356
|
+
* - Pipe operator is followed by the operation keyword on the same line (no newline before keyword)
|
|
1357
|
+
* - Content after the operation keyword is indented (5 spaces from line start)
|
|
1358
|
+
*
|
|
1359
|
+
* Example:
|
|
1360
|
+
* table t
|
|
1361
|
+
* |> select
|
|
1362
|
+
* x,
|
|
1363
|
+
* y;
|
|
1364
|
+
*/
|
|
1365
|
+
visitOperatorPipeStatement(ctx: OperatorPipeStatementContext): void;
|
|
1366
|
+
private getPipeStepKind;
|
|
1367
|
+
private restorePipeFormattingState;
|
|
1368
|
+
private getPipeStepFormattingBridge;
|
|
1369
|
+
private createPipeStepFormattingContext;
|
|
1370
|
+
/**
|
|
1371
|
+
* Format pipe operator right side
|
|
1372
|
+
* Handles various operation types: SELECT, WHERE, EXTEND, SET, DROP, AS, AGGREGATE, JOIN,
|
|
1373
|
+
* UNION/INTERSECT/EXCEPT, ORDER BY/LIMIT, PIVOT/UNPIVOT
|
|
1374
|
+
*
|
|
1375
|
+
* Format rules based on pipe.sql:
|
|
1376
|
+
* - Operation keyword follows `|>` on the same line (handled by visitOperatorPipeStatement)
|
|
1377
|
+
* - Content after keyword is indented on new lines (5 spaces from line start for top-level)
|
|
1378
|
+
* - GROUP BY in AGGREGATE aligns with `|>` (3 spaces indent)
|
|
1379
|
+
*
|
|
1380
|
+
* Key design: Set dynamic indent base so all nested structures automatically get correct indentation
|
|
1381
|
+
*/
|
|
1382
|
+
visitOperatorPipeRightSide(ctx: OperatorPipeRightSideContext): void;
|
|
1383
|
+
/**
|
|
1384
|
+
* Format pipe operator SET assignment sequence
|
|
1385
|
+
* Format:
|
|
1386
|
+
* |> SET
|
|
1387
|
+
* col1 = expr1,
|
|
1388
|
+
* col2 = expr2;
|
|
1389
|
+
*/
|
|
1390
|
+
visitOperatorPipeSetAssignmentSeq(ctx: OperatorPipeSetAssignmentSeqContext): void;
|
|
1391
|
+
/**
|
|
1392
|
+
* Format USE statement
|
|
1393
|
+
* Format: USE database_name
|
|
1394
|
+
* Simple statement - keep formatting as-is
|
|
1395
|
+
*/
|
|
1396
|
+
visitUse(ctx: UseContext): void;
|
|
1397
|
+
/**
|
|
1398
|
+
* Format USE NAMESPACE statement
|
|
1399
|
+
* Format: USE NAMESPACE catalog.database
|
|
1400
|
+
* Simple statement - keep formatting as-is
|
|
1401
|
+
*/
|
|
1402
|
+
visitUseNamespace(ctx: UseNamespaceContext): void;
|
|
1403
|
+
/**
|
|
1404
|
+
* Format SET CATALOG statement
|
|
1405
|
+
* Format: SET CATALOG catalog_name
|
|
1406
|
+
* Simple statement - keep formatting as-is
|
|
1407
|
+
*/
|
|
1408
|
+
visitSetCatalog(ctx: SetCatalogContext): void;
|
|
1409
|
+
/**
|
|
1410
|
+
* Format SHOW NAMESPACES statement
|
|
1411
|
+
* Format: SHOW NAMESPACES [FROM catalog] [LIKE 'pattern']
|
|
1412
|
+
*/
|
|
1413
|
+
visitShowNamespaces(ctx: ShowNamespacesContext): void;
|
|
1414
|
+
/**
|
|
1415
|
+
* Format SHOW TABLES statement
|
|
1416
|
+
* Format: SHOW TABLES [FROM database] [LIKE 'pattern']
|
|
1417
|
+
*/
|
|
1418
|
+
visitShowTables(ctx: ShowTablesContext): void;
|
|
1419
|
+
/**
|
|
1420
|
+
* Format SHOW TABLE EXTENDED statement
|
|
1421
|
+
* Format: SHOW TABLE EXTENDED [FROM database] LIKE 'pattern' [PARTITION (...)]
|
|
1422
|
+
*/
|
|
1423
|
+
visitShowTableExtended(ctx: ShowTableExtendedContext): void;
|
|
1424
|
+
/**
|
|
1425
|
+
* Format SHOW TBLPROPERTIES statement
|
|
1426
|
+
* Format: SHOW TBLPROPERTIES table_name [('key')]
|
|
1427
|
+
*/
|
|
1428
|
+
visitShowTblProperties(ctx: ShowTblPropertiesContext): void;
|
|
1429
|
+
/**
|
|
1430
|
+
* Format SHOW COLUMNS statement
|
|
1431
|
+
* Format: SHOW COLUMNS FROM table_name [FROM database]
|
|
1432
|
+
*/
|
|
1433
|
+
visitShowColumns(ctx: ShowColumnsContext): void;
|
|
1434
|
+
/**
|
|
1435
|
+
* Format SHOW VIEWS statement
|
|
1436
|
+
* Format: SHOW VIEWS [FROM database] [LIKE 'pattern']
|
|
1437
|
+
*/
|
|
1438
|
+
visitShowViews(ctx: ShowViewsContext): void;
|
|
1439
|
+
/**
|
|
1440
|
+
* Format SHOW PARTITIONS statement
|
|
1441
|
+
* Format: SHOW PARTITIONS table_name [PARTITION (...)]
|
|
1442
|
+
*/
|
|
1443
|
+
visitShowPartitions(ctx: ShowPartitionsContext): void;
|
|
1444
|
+
/**
|
|
1445
|
+
* Format SHOW FUNCTIONS statement
|
|
1446
|
+
* Format: SHOW [USER|SYSTEM|ALL] FUNCTIONS [FROM database] [LIKE 'pattern']
|
|
1447
|
+
*/
|
|
1448
|
+
visitShowFunctions(ctx: ShowFunctionsContext): void;
|
|
1449
|
+
/**
|
|
1450
|
+
* Format SHOW PROCEDURES statement
|
|
1451
|
+
* Format: SHOW PROCEDURES [FROM database]
|
|
1452
|
+
*/
|
|
1453
|
+
visitShowProcedures(ctx: ShowProceduresContext): void;
|
|
1454
|
+
/**
|
|
1455
|
+
* Format SHOW CREATE TABLE statement
|
|
1456
|
+
* Format: SHOW CREATE TABLE table_name [AS SERDE]
|
|
1457
|
+
*/
|
|
1458
|
+
visitShowCreateTable(ctx: ShowCreateTableContext): void;
|
|
1459
|
+
/**
|
|
1460
|
+
* Format SHOW CURRENT NAMESPACE statement
|
|
1461
|
+
* Format: SHOW CURRENT NAMESPACE
|
|
1462
|
+
*/
|
|
1463
|
+
visitShowCurrentNamespace(ctx: ShowCurrentNamespaceContext): void;
|
|
1464
|
+
/**
|
|
1465
|
+
* Format SHOW CATALOGS statement
|
|
1466
|
+
* Format: SHOW CATALOGS [LIKE 'pattern']
|
|
1467
|
+
*/
|
|
1468
|
+
visitShowCatalogs(ctx: ShowCatalogsContext): void;
|
|
1469
|
+
/**
|
|
1470
|
+
* Format SET TIME ZONE statement
|
|
1471
|
+
* Format: SET TIME ZONE 'timezone' | INTERVAL ... | LOCAL
|
|
1472
|
+
*/
|
|
1473
|
+
visitSetTimeZone(ctx: SetTimeZoneContext): void;
|
|
1474
|
+
/**
|
|
1475
|
+
* Format SET variable statement
|
|
1476
|
+
* Format: SET var1 = value1, var2 = value2
|
|
1477
|
+
* Or: SET (var1, var2) = (SELECT ...)
|
|
1478
|
+
*/
|
|
1479
|
+
visitSetVariable(ctx: SetVariableContext): void;
|
|
1480
|
+
/**
|
|
1481
|
+
* Format SET configuration (quoted)
|
|
1482
|
+
* Format: SET 'spark.sql.shuffle.partitions' = '200'
|
|
1483
|
+
*/
|
|
1484
|
+
visitSetQuotedConfiguration(ctx: SetQuotedConfigurationContext): void;
|
|
1485
|
+
/**
|
|
1486
|
+
* Format SET configuration
|
|
1487
|
+
* Format: SET spark.sql.shuffle.partitions = 200
|
|
1488
|
+
* Or: SET spark.sql.shuffle.partitions
|
|
1489
|
+
*/
|
|
1490
|
+
visitSetConfiguration(ctx: SetConfigurationContext): void;
|
|
1491
|
+
/**
|
|
1492
|
+
* Format RESET configuration (quoted)
|
|
1493
|
+
* Format: RESET 'spark.sql.shuffle.partitions'
|
|
1494
|
+
*/
|
|
1495
|
+
visitResetQuotedConfiguration(ctx: ResetQuotedConfigurationContext): void;
|
|
1496
|
+
/**
|
|
1497
|
+
* Format RESET configuration
|
|
1498
|
+
* Format: RESET spark.sql.shuffle.partitions
|
|
1499
|
+
* Or: RESET (reset all)
|
|
1500
|
+
*/
|
|
1501
|
+
visitResetConfiguration(ctx: ResetConfigurationContext): void;
|
|
1502
|
+
/**
|
|
1503
|
+
* Format REPLACE TABLE statement
|
|
1504
|
+
* Same formatting as CREATE TABLE
|
|
1505
|
+
* Format:
|
|
1506
|
+
* REPLACE TABLE table_name (
|
|
1507
|
+
* col1 INT,
|
|
1508
|
+
* col2 STRING
|
|
1509
|
+
* )
|
|
1510
|
+
* USING parquet
|
|
1511
|
+
* PARTITIONED BY (col1)
|
|
1512
|
+
* AS SELECT ...
|
|
1513
|
+
*/
|
|
1514
|
+
visitReplaceTable(ctx: ReplaceTableContext): void;
|
|
1515
|
+
/**
|
|
1516
|
+
* Format CREATE FUNCTION statement with parameters and return type
|
|
1517
|
+
* Format:
|
|
1518
|
+
* CREATE OR REPLACE FUNCTION func_name(
|
|
1519
|
+
* param1 TYPE DEFAULT value COMMENT 'desc',
|
|
1520
|
+
* param2 TYPE
|
|
1521
|
+
* )
|
|
1522
|
+
* RETURNS type
|
|
1523
|
+
* LANGUAGE SQL
|
|
1524
|
+
* DETERMINISTIC
|
|
1525
|
+
* CONTAINS SQL
|
|
1526
|
+
* CALLED ON NULL INPUT
|
|
1527
|
+
* COMMENT 'description'
|
|
1528
|
+
* SQL SECURITY INVOKER
|
|
1529
|
+
* RETURN expression;
|
|
1530
|
+
*/
|
|
1531
|
+
visitCreateUserDefinedFunction(ctx: CreateUserDefinedFunctionContext): void;
|
|
1532
|
+
/**
|
|
1533
|
+
* Format DECLARE variable statement
|
|
1534
|
+
* Format: DECLARE [OR REPLACE] VARIABLE var_name TYPE DEFAULT value
|
|
1535
|
+
*/
|
|
1536
|
+
visitCreateVariable(ctx: CreateVariableContext): void;
|
|
1537
|
+
/**
|
|
1538
|
+
* Format DROP VARIABLE statement
|
|
1539
|
+
* Format: DROP TEMPORARY VARIABLE [IF EXISTS] var_name
|
|
1540
|
+
*/
|
|
1541
|
+
visitDropVariable(ctx: DropVariableContext): void;
|
|
1542
|
+
/**
|
|
1543
|
+
* Format ALTER TABLE CLUSTER BY statement
|
|
1544
|
+
* Format:
|
|
1545
|
+
* ALTER TABLE
|
|
1546
|
+
* table_name
|
|
1547
|
+
* CLUSTER BY
|
|
1548
|
+
* (col1, col2);
|
|
1549
|
+
* Or: CLUSTER BY NONE
|
|
1550
|
+
*/
|
|
1551
|
+
visitAlterClusterBy(ctx: AlterClusterByContext): void;
|
|
1552
|
+
/**
|
|
1553
|
+
* Format ALTER TABLE COLLATION statement
|
|
1554
|
+
* Format:
|
|
1555
|
+
* ALTER TABLE
|
|
1556
|
+
* table_name
|
|
1557
|
+
* COLLATE
|
|
1558
|
+
* collation_name;
|
|
1559
|
+
*/
|
|
1560
|
+
visitAlterTableCollation(ctx: AlterTableCollationContext): void;
|
|
1561
|
+
/**
|
|
1562
|
+
* Format ALTER TABLE ADD CONSTRAINT statement
|
|
1563
|
+
* Format:
|
|
1564
|
+
* ALTER TABLE
|
|
1565
|
+
* table_name
|
|
1566
|
+
* ADD
|
|
1567
|
+
* CONSTRAINT constraint_name
|
|
1568
|
+
* UNIQUE (col1, col2);
|
|
1569
|
+
*/
|
|
1570
|
+
visitAddTableConstraint(ctx: AddTableConstraintContext): void;
|
|
1571
|
+
/**
|
|
1572
|
+
* Format ALTER TABLE DROP CONSTRAINT statement
|
|
1573
|
+
* Format:
|
|
1574
|
+
* ALTER TABLE
|
|
1575
|
+
* table_name
|
|
1576
|
+
* DROP CONSTRAINT IF EXISTS
|
|
1577
|
+
* constraint_name
|
|
1578
|
+
* [RESTRICT | CASCADE];
|
|
1579
|
+
*/
|
|
1580
|
+
visitDropTableConstraint(ctx: DropTableConstraintContext): void;
|
|
1581
|
+
/**
|
|
1582
|
+
* Format ALTER VIEW SCHEMA BINDING statement
|
|
1583
|
+
* Format:
|
|
1584
|
+
* ALTER VIEW
|
|
1585
|
+
* view_name
|
|
1586
|
+
* WITH SCHEMA
|
|
1587
|
+
* BINDING | COMPENSATION | EVOLUTION | TYPE EVOLUTION;
|
|
1588
|
+
*/
|
|
1589
|
+
visitAlterViewSchemaBinding(ctx: AlterViewSchemaBindingContext): void;
|
|
1590
|
+
/**
|
|
1591
|
+
* Format CREATE MATERIALIZED VIEW / STREAMING TABLE header
|
|
1592
|
+
* Format: CREATE MATERIALIZED VIEW [IF NOT EXISTS] table_name
|
|
1593
|
+
* Or: CREATE STREAMING TABLE [IF NOT EXISTS] table_name
|
|
1594
|
+
*/
|
|
1595
|
+
visitCreatePipelineDatasetHeader(ctx: CreatePipelineDatasetHeaderContext): void;
|
|
1596
|
+
/**
|
|
1597
|
+
* Format CREATE MATERIALIZED VIEW / STREAMING TABLE statement
|
|
1598
|
+
* Format (same as CREATE TABLE):
|
|
1599
|
+
* CREATE MATERIALIZED VIEW table_name (
|
|
1600
|
+
* col1 INT,
|
|
1601
|
+
* col2 STRING
|
|
1602
|
+
* )
|
|
1603
|
+
* USING parquet
|
|
1604
|
+
* TBLPROPERTIES (...)
|
|
1605
|
+
* AS SELECT ...;
|
|
1606
|
+
*/
|
|
1607
|
+
visitCreatePipelineDataset(ctx: CreatePipelineDatasetContext): void;
|
|
1608
|
+
/**
|
|
1609
|
+
* Format CREATE FLOW header
|
|
1610
|
+
* Format: CREATE FLOW flow_name [COMMENT 'desc'] AS
|
|
1611
|
+
*/
|
|
1612
|
+
visitCreatePipelineFlowHeader(ctx: CreatePipelineFlowHeaderContext): void;
|
|
1613
|
+
/**
|
|
1614
|
+
* Format CREATE FLOW statement
|
|
1615
|
+
* Format:
|
|
1616
|
+
* CREATE FLOW flow_name
|
|
1617
|
+
* COMMENT 'description'
|
|
1618
|
+
* AS
|
|
1619
|
+
* INSERT INTO target_table
|
|
1620
|
+
* SELECT ...;
|
|
1621
|
+
*/
|
|
1622
|
+
visitCreatePipelineInsertIntoFlow(ctx: CreatePipelineInsertIntoFlowContext): void;
|
|
1623
|
+
/**
|
|
1624
|
+
* Format DROP INDEX statement
|
|
1625
|
+
* Format: DROP INDEX [IF EXISTS] index_name ON [TABLE] table_name
|
|
1626
|
+
*/
|
|
1627
|
+
visitDropIndex(ctx: DropIndexContext): void;
|
|
1628
|
+
/**
|
|
1629
|
+
* Format REFRESH resource statement
|
|
1630
|
+
* Format: REFRESH 'resource_path'
|
|
1631
|
+
* Simple statement - keep as-is
|
|
1632
|
+
*/
|
|
1633
|
+
visitRefreshResource(ctx: RefreshResourceContext): void;
|
|
1634
|
+
/**
|
|
1635
|
+
* Format ADD/LIST resource statement
|
|
1636
|
+
* Format: ADD JAR 'path' | LIST FILE 'path'
|
|
1637
|
+
* Simple statement - keep as-is
|
|
1638
|
+
*/
|
|
1639
|
+
visitManageResource(ctx: ManageResourceContext): void;
|
|
1640
|
+
}
|
|
1641
|
+
//# sourceMappingURL=space-replacer-format.visitor.d.ts.map
|