public class TSqlCmdsDatabricks extends AbstractSqlCmds
initialized, initLock, sqlCmdList, vendor| Constructor and Description |
|---|
TSqlCmdsDatabricks() |
| Modifier and Type | Method and Description |
|---|---|
protected TCustomSqlStatement |
findcte(TSourceToken ptoken)
Databricks/Spark allow the
AS keyword to be omitted in a CTE: |
protected String |
getToken1Str(int token1)
Get the string representation for vendor-specific token codes.
|
protected void |
initializeCommands()
Initialize vendor-specific commands.
|
TCustomSqlStatement |
issql(TSourceToken token,
EFindSqlStateType state,
TCustomSqlStatement currentStatement)
Identifies the SQL statement type from a token stream.
|
addCmd, addCmd, addCmd, addCmd, addCmd, addCmd, addCmd, addCmd, ensureInitialized, findCteByStructure, finddbcmd, getSqlCmdList, getStatementTypeForToken, getVendor, overrideCmdpublic TSqlCmdsDatabricks()
protected TCustomSqlStatement findcte(TSourceToken ptoken)
AS keyword to be omitted in a CTE:
WITH cte_name [ ( col_list ) ] ( query ) ...The shared
AbstractSqlCmds.findcte(TSourceToken) only recognizes
the AS form; this override adds the no-AS form.
The no-AS detection runs FIRST: the shared logic keys off the
first AS token, which for a no-AS CTE could be an unrelated
later AS (e.g. an INSERT INTO t AS a target alias) and lead
to the wrong statement class. findCteWithoutAs(gudusoft.gsqlparser.TSourceToken) returns null
for a genuine AS CTE, so those still fall through to the shared
logic.
findcte in class AbstractSqlCmdsptoken - The WITH tokenprotected String getToken1Str(int token1)
AbstractSqlCmdsgetToken1Str in class AbstractSqlCmdstoken1 - Token codeprotected void initializeCommands()
AbstractSqlCmdsinitializeCommands in class AbstractSqlCmdspublic TCustomSqlStatement issql(TSourceToken token, EFindSqlStateType state, TCustomSqlStatement currentStatement)
ISqlCmdstoken - Current token being analyzedstate - Current parsing state (start, in body, or in exception)currentStatement - Current statement being built (may be modified)