/*
 * This file was auto-generated by speedy-antlr-tool v1.3.2
 *  https://github.com/amykyta3/speedy-antlr-tool
 */

#define PY_SSIZE_T_CLEAN
#include <Python.h>

#include <cstring>
#include <any>

#include "antlr4-runtime.h"
#include "fugue_sqlLexer.h"
#include "fugue_sqlParser.h"
#include "speedy_antlr.h"

#include "sa_fugue_sql_translator.h"
antlr4::tree::ParseTree* get_parse_tree_fugueLanguage(fugue_sqlParser *parser) {return parser->fugueLanguage();}
antlr4::tree::ParseTree* get_parse_tree_fugueSingleStatement(fugue_sqlParser *parser) {return parser->fugueSingleStatement();}
antlr4::tree::ParseTree* get_parse_tree_fugueSingleTask(fugue_sqlParser *parser) {return parser->fugueSingleTask();}
antlr4::tree::ParseTree* get_parse_tree_fugueNestableTask(fugue_sqlParser *parser) {return parser->fugueNestableTask();}
antlr4::tree::ParseTree* get_parse_tree_fugueNestableTaskCollectionNoSelect(fugue_sqlParser *parser) {return parser->fugueNestableTaskCollectionNoSelect();}
antlr4::tree::ParseTree* get_parse_tree_fugueTransformTask(fugue_sqlParser *parser) {return parser->fugueTransformTask();}
antlr4::tree::ParseTree* get_parse_tree_fugueProcessTask(fugue_sqlParser *parser) {return parser->fugueProcessTask();}
antlr4::tree::ParseTree* get_parse_tree_fugueSaveAndUseTask(fugue_sqlParser *parser) {return parser->fugueSaveAndUseTask();}
antlr4::tree::ParseTree* get_parse_tree_fugueRenameColumnsTask(fugue_sqlParser *parser) {return parser->fugueRenameColumnsTask();}
antlr4::tree::ParseTree* get_parse_tree_fugueAlterColumnsTask(fugue_sqlParser *parser) {return parser->fugueAlterColumnsTask();}
antlr4::tree::ParseTree* get_parse_tree_fugueDropColumnsTask(fugue_sqlParser *parser) {return parser->fugueDropColumnsTask();}
antlr4::tree::ParseTree* get_parse_tree_fugueDropnaTask(fugue_sqlParser *parser) {return parser->fugueDropnaTask();}
antlr4::tree::ParseTree* get_parse_tree_fugueFillnaTask(fugue_sqlParser *parser) {return parser->fugueFillnaTask();}
antlr4::tree::ParseTree* get_parse_tree_fugueSampleTask(fugue_sqlParser *parser) {return parser->fugueSampleTask();}
antlr4::tree::ParseTree* get_parse_tree_fugueTakeTask(fugue_sqlParser *parser) {return parser->fugueTakeTask();}
antlr4::tree::ParseTree* get_parse_tree_fugueZipTask(fugue_sqlParser *parser) {return parser->fugueZipTask();}
antlr4::tree::ParseTree* get_parse_tree_fugueCreateTask(fugue_sqlParser *parser) {return parser->fugueCreateTask();}
antlr4::tree::ParseTree* get_parse_tree_fugueCreateDataTask(fugue_sqlParser *parser) {return parser->fugueCreateDataTask();}
antlr4::tree::ParseTree* get_parse_tree_fugueLoadTask(fugue_sqlParser *parser) {return parser->fugueLoadTask();}
antlr4::tree::ParseTree* get_parse_tree_fugueOutputTask(fugue_sqlParser *parser) {return parser->fugueOutputTask();}
antlr4::tree::ParseTree* get_parse_tree_fuguePrintTask(fugue_sqlParser *parser) {return parser->fuguePrintTask();}
antlr4::tree::ParseTree* get_parse_tree_fugueSaveTask(fugue_sqlParser *parser) {return parser->fugueSaveTask();}
antlr4::tree::ParseTree* get_parse_tree_fugueOutputTransformTask(fugue_sqlParser *parser) {return parser->fugueOutputTransformTask();}
antlr4::tree::ParseTree* get_parse_tree_fugueModuleTask(fugue_sqlParser *parser) {return parser->fugueModuleTask();}
antlr4::tree::ParseTree* get_parse_tree_fugueSqlEngine(fugue_sqlParser *parser) {return parser->fugueSqlEngine();}
antlr4::tree::ParseTree* get_parse_tree_fugueSingleFile(fugue_sqlParser *parser) {return parser->fugueSingleFile();}
antlr4::tree::ParseTree* get_parse_tree_fugueLoadColumns(fugue_sqlParser *parser) {return parser->fugueLoadColumns();}
antlr4::tree::ParseTree* get_parse_tree_fugueSaveMode(fugue_sqlParser *parser) {return parser->fugueSaveMode();}
antlr4::tree::ParseTree* get_parse_tree_fugueFileFormat(fugue_sqlParser *parser) {return parser->fugueFileFormat();}
antlr4::tree::ParseTree* get_parse_tree_fuguePath(fugue_sqlParser *parser) {return parser->fuguePath();}
antlr4::tree::ParseTree* get_parse_tree_fugueCheckpoint(fugue_sqlParser *parser) {return parser->fugueCheckpoint();}
antlr4::tree::ParseTree* get_parse_tree_fugueCheckpointNamespace(fugue_sqlParser *parser) {return parser->fugueCheckpointNamespace();}
antlr4::tree::ParseTree* get_parse_tree_fugueYield(fugue_sqlParser *parser) {return parser->fugueYield();}
antlr4::tree::ParseTree* get_parse_tree_fugueBroadcast(fugue_sqlParser *parser) {return parser->fugueBroadcast();}
antlr4::tree::ParseTree* get_parse_tree_fugueDataFrames(fugue_sqlParser *parser) {return parser->fugueDataFrames();}
antlr4::tree::ParseTree* get_parse_tree_fugueDataFramePair(fugue_sqlParser *parser) {return parser->fugueDataFramePair();}
antlr4::tree::ParseTree* get_parse_tree_fugueDataFrame(fugue_sqlParser *parser) {return parser->fugueDataFrame();}
antlr4::tree::ParseTree* get_parse_tree_fugueDataFrameMember(fugue_sqlParser *parser) {return parser->fugueDataFrameMember();}
antlr4::tree::ParseTree* get_parse_tree_fugueAssignment(fugue_sqlParser *parser) {return parser->fugueAssignment();}
antlr4::tree::ParseTree* get_parse_tree_fugueAssignmentSign(fugue_sqlParser *parser) {return parser->fugueAssignmentSign();}
antlr4::tree::ParseTree* get_parse_tree_fugueSingleOutputExtensionCommonWild(fugue_sqlParser *parser) {return parser->fugueSingleOutputExtensionCommonWild();}
antlr4::tree::ParseTree* get_parse_tree_fugueSingleOutputExtensionCommon(fugue_sqlParser *parser) {return parser->fugueSingleOutputExtensionCommon();}
antlr4::tree::ParseTree* get_parse_tree_fugueExtension(fugue_sqlParser *parser) {return parser->fugueExtension();}
antlr4::tree::ParseTree* get_parse_tree_fugueSampleMethod(fugue_sqlParser *parser) {return parser->fugueSampleMethod();}
antlr4::tree::ParseTree* get_parse_tree_fugueZipType(fugue_sqlParser *parser) {return parser->fugueZipType();}
antlr4::tree::ParseTree* get_parse_tree_fuguePrepartition(fugue_sqlParser *parser) {return parser->fuguePrepartition();}
antlr4::tree::ParseTree* get_parse_tree_fuguePartitionAlgo(fugue_sqlParser *parser) {return parser->fuguePartitionAlgo();}
antlr4::tree::ParseTree* get_parse_tree_fuguePartitionNum(fugue_sqlParser *parser) {return parser->fuguePartitionNum();}
antlr4::tree::ParseTree* get_parse_tree_fuguePartitionNumber(fugue_sqlParser *parser) {return parser->fuguePartitionNumber();}
antlr4::tree::ParseTree* get_parse_tree_fugueParams(fugue_sqlParser *parser) {return parser->fugueParams();}
antlr4::tree::ParseTree* get_parse_tree_fugueCols(fugue_sqlParser *parser) {return parser->fugueCols();}
antlr4::tree::ParseTree* get_parse_tree_fugueColsSort(fugue_sqlParser *parser) {return parser->fugueColsSort();}
antlr4::tree::ParseTree* get_parse_tree_fugueColSort(fugue_sqlParser *parser) {return parser->fugueColSort();}
antlr4::tree::ParseTree* get_parse_tree_fugueColumnIdentifier(fugue_sqlParser *parser) {return parser->fugueColumnIdentifier();}
antlr4::tree::ParseTree* get_parse_tree_fugueRenameExpression(fugue_sqlParser *parser) {return parser->fugueRenameExpression();}
antlr4::tree::ParseTree* get_parse_tree_fugueWildSchema(fugue_sqlParser *parser) {return parser->fugueWildSchema();}
antlr4::tree::ParseTree* get_parse_tree_fugueWildSchemaPair(fugue_sqlParser *parser) {return parser->fugueWildSchemaPair();}
antlr4::tree::ParseTree* get_parse_tree_fugueSchemaOp(fugue_sqlParser *parser) {return parser->fugueSchemaOp();}
antlr4::tree::ParseTree* get_parse_tree_fugueSchema(fugue_sqlParser *parser) {return parser->fugueSchema();}
antlr4::tree::ParseTree* get_parse_tree_fugueSchemaPair(fugue_sqlParser *parser) {return parser->fugueSchemaPair();}
antlr4::tree::ParseTree* get_parse_tree_fugueSchemaKey(fugue_sqlParser *parser) {return parser->fugueSchemaKey();}
antlr4::tree::ParseTree* get_parse_tree_fugueSchemaType(fugue_sqlParser *parser) {return parser->fugueSchemaType();}
antlr4::tree::ParseTree* get_parse_tree_fugueRenamePair(fugue_sqlParser *parser) {return parser->fugueRenamePair();}
antlr4::tree::ParseTree* get_parse_tree_fugueJson(fugue_sqlParser *parser) {return parser->fugueJson();}
antlr4::tree::ParseTree* get_parse_tree_fugueJsonObj(fugue_sqlParser *parser) {return parser->fugueJsonObj();}
antlr4::tree::ParseTree* get_parse_tree_fugueJsonPairs(fugue_sqlParser *parser) {return parser->fugueJsonPairs();}
antlr4::tree::ParseTree* get_parse_tree_fugueJsonPair(fugue_sqlParser *parser) {return parser->fugueJsonPair();}
antlr4::tree::ParseTree* get_parse_tree_fugueJsonKey(fugue_sqlParser *parser) {return parser->fugueJsonKey();}
antlr4::tree::ParseTree* get_parse_tree_fugueJsonArray(fugue_sqlParser *parser) {return parser->fugueJsonArray();}
antlr4::tree::ParseTree* get_parse_tree_fugueJsonValue(fugue_sqlParser *parser) {return parser->fugueJsonValue();}
antlr4::tree::ParseTree* get_parse_tree_fugueJsonNumber(fugue_sqlParser *parser) {return parser->fugueJsonNumber();}
antlr4::tree::ParseTree* get_parse_tree_fugueJsonString(fugue_sqlParser *parser) {return parser->fugueJsonString();}
antlr4::tree::ParseTree* get_parse_tree_fugueJsonBool(fugue_sqlParser *parser) {return parser->fugueJsonBool();}
antlr4::tree::ParseTree* get_parse_tree_fugueJsonNull(fugue_sqlParser *parser) {return parser->fugueJsonNull();}
antlr4::tree::ParseTree* get_parse_tree_fugueIdentifier(fugue_sqlParser *parser) {return parser->fugueIdentifier();}
antlr4::tree::ParseTree* get_parse_tree_singleStatement(fugue_sqlParser *parser) {return parser->singleStatement();}
antlr4::tree::ParseTree* get_parse_tree_singleExpression(fugue_sqlParser *parser) {return parser->singleExpression();}
antlr4::tree::ParseTree* get_parse_tree_singleTableIdentifier(fugue_sqlParser *parser) {return parser->singleTableIdentifier();}
antlr4::tree::ParseTree* get_parse_tree_singleMultipartIdentifier(fugue_sqlParser *parser) {return parser->singleMultipartIdentifier();}
antlr4::tree::ParseTree* get_parse_tree_singleFunctionIdentifier(fugue_sqlParser *parser) {return parser->singleFunctionIdentifier();}
antlr4::tree::ParseTree* get_parse_tree_singleDataType(fugue_sqlParser *parser) {return parser->singleDataType();}
antlr4::tree::ParseTree* get_parse_tree_singleTableSchema(fugue_sqlParser *parser) {return parser->singleTableSchema();}
antlr4::tree::ParseTree* get_parse_tree_statement(fugue_sqlParser *parser) {return parser->statement();}
antlr4::tree::ParseTree* get_parse_tree_unsupportedHiveNativeCommands(fugue_sqlParser *parser) {return parser->unsupportedHiveNativeCommands();}
antlr4::tree::ParseTree* get_parse_tree_createTableHeader(fugue_sqlParser *parser) {return parser->createTableHeader();}
antlr4::tree::ParseTree* get_parse_tree_replaceTableHeader(fugue_sqlParser *parser) {return parser->replaceTableHeader();}
antlr4::tree::ParseTree* get_parse_tree_bucketSpec(fugue_sqlParser *parser) {return parser->bucketSpec();}
antlr4::tree::ParseTree* get_parse_tree_skewSpec(fugue_sqlParser *parser) {return parser->skewSpec();}
antlr4::tree::ParseTree* get_parse_tree_locationSpec(fugue_sqlParser *parser) {return parser->locationSpec();}
antlr4::tree::ParseTree* get_parse_tree_commentSpec(fugue_sqlParser *parser) {return parser->commentSpec();}
antlr4::tree::ParseTree* get_parse_tree_query(fugue_sqlParser *parser) {return parser->query();}
antlr4::tree::ParseTree* get_parse_tree_insertInto(fugue_sqlParser *parser) {return parser->insertInto();}
antlr4::tree::ParseTree* get_parse_tree_partitionSpecLocation(fugue_sqlParser *parser) {return parser->partitionSpecLocation();}
antlr4::tree::ParseTree* get_parse_tree_partitionSpec(fugue_sqlParser *parser) {return parser->partitionSpec();}
antlr4::tree::ParseTree* get_parse_tree_partitionVal(fugue_sqlParser *parser) {return parser->partitionVal();}
antlr4::tree::ParseTree* get_parse_tree_theNamespace(fugue_sqlParser *parser) {return parser->theNamespace();}
antlr4::tree::ParseTree* get_parse_tree_describeFuncName(fugue_sqlParser *parser) {return parser->describeFuncName();}
antlr4::tree::ParseTree* get_parse_tree_describeColName(fugue_sqlParser *parser) {return parser->describeColName();}
antlr4::tree::ParseTree* get_parse_tree_ctes(fugue_sqlParser *parser) {return parser->ctes();}
antlr4::tree::ParseTree* get_parse_tree_namedQuery(fugue_sqlParser *parser) {return parser->namedQuery();}
antlr4::tree::ParseTree* get_parse_tree_tableProvider(fugue_sqlParser *parser) {return parser->tableProvider();}
antlr4::tree::ParseTree* get_parse_tree_createTableClauses(fugue_sqlParser *parser) {return parser->createTableClauses();}
antlr4::tree::ParseTree* get_parse_tree_tablePropertyList(fugue_sqlParser *parser) {return parser->tablePropertyList();}
antlr4::tree::ParseTree* get_parse_tree_tableProperty(fugue_sqlParser *parser) {return parser->tableProperty();}
antlr4::tree::ParseTree* get_parse_tree_tablePropertyKey(fugue_sqlParser *parser) {return parser->tablePropertyKey();}
antlr4::tree::ParseTree* get_parse_tree_tablePropertyValue(fugue_sqlParser *parser) {return parser->tablePropertyValue();}
antlr4::tree::ParseTree* get_parse_tree_constantList(fugue_sqlParser *parser) {return parser->constantList();}
antlr4::tree::ParseTree* get_parse_tree_nestedConstantList(fugue_sqlParser *parser) {return parser->nestedConstantList();}
antlr4::tree::ParseTree* get_parse_tree_createFileFormat(fugue_sqlParser *parser) {return parser->createFileFormat();}
antlr4::tree::ParseTree* get_parse_tree_fileFormat(fugue_sqlParser *parser) {return parser->fileFormat();}
antlr4::tree::ParseTree* get_parse_tree_storageHandler(fugue_sqlParser *parser) {return parser->storageHandler();}
antlr4::tree::ParseTree* get_parse_tree_resource(fugue_sqlParser *parser) {return parser->resource();}
antlr4::tree::ParseTree* get_parse_tree_dmlStatementNoWith(fugue_sqlParser *parser) {return parser->dmlStatementNoWith();}
antlr4::tree::ParseTree* get_parse_tree_queryOrganization(fugue_sqlParser *parser) {return parser->queryOrganization();}
antlr4::tree::ParseTree* get_parse_tree_multiInsertQueryBody(fugue_sqlParser *parser) {return parser->multiInsertQueryBody();}
antlr4::tree::ParseTree* get_parse_tree_queryTerm(fugue_sqlParser *parser) {return parser->queryTerm();}
antlr4::tree::ParseTree* get_parse_tree_queryPrimary(fugue_sqlParser *parser) {return parser->queryPrimary();}
antlr4::tree::ParseTree* get_parse_tree_sortItem(fugue_sqlParser *parser) {return parser->sortItem();}
antlr4::tree::ParseTree* get_parse_tree_fromStatement(fugue_sqlParser *parser) {return parser->fromStatement();}
antlr4::tree::ParseTree* get_parse_tree_fromStatementBody(fugue_sqlParser *parser) {return parser->fromStatementBody();}
antlr4::tree::ParseTree* get_parse_tree_querySpecification(fugue_sqlParser *parser) {return parser->querySpecification();}
antlr4::tree::ParseTree* get_parse_tree_optionalFromClause(fugue_sqlParser *parser) {return parser->optionalFromClause();}
antlr4::tree::ParseTree* get_parse_tree_transformClause(fugue_sqlParser *parser) {return parser->transformClause();}
antlr4::tree::ParseTree* get_parse_tree_selectClause(fugue_sqlParser *parser) {return parser->selectClause();}
antlr4::tree::ParseTree* get_parse_tree_setClause(fugue_sqlParser *parser) {return parser->setClause();}
antlr4::tree::ParseTree* get_parse_tree_matchedClause(fugue_sqlParser *parser) {return parser->matchedClause();}
antlr4::tree::ParseTree* get_parse_tree_notMatchedClause(fugue_sqlParser *parser) {return parser->notMatchedClause();}
antlr4::tree::ParseTree* get_parse_tree_matchedAction(fugue_sqlParser *parser) {return parser->matchedAction();}
antlr4::tree::ParseTree* get_parse_tree_notMatchedAction(fugue_sqlParser *parser) {return parser->notMatchedAction();}
antlr4::tree::ParseTree* get_parse_tree_assignmentList(fugue_sqlParser *parser) {return parser->assignmentList();}
antlr4::tree::ParseTree* get_parse_tree_assignment(fugue_sqlParser *parser) {return parser->assignment();}
antlr4::tree::ParseTree* get_parse_tree_whereClause(fugue_sqlParser *parser) {return parser->whereClause();}
antlr4::tree::ParseTree* get_parse_tree_havingClause(fugue_sqlParser *parser) {return parser->havingClause();}
antlr4::tree::ParseTree* get_parse_tree_hint(fugue_sqlParser *parser) {return parser->hint();}
antlr4::tree::ParseTree* get_parse_tree_hintStatement(fugue_sqlParser *parser) {return parser->hintStatement();}
antlr4::tree::ParseTree* get_parse_tree_fromClause(fugue_sqlParser *parser) {return parser->fromClause();}
antlr4::tree::ParseTree* get_parse_tree_aggregationClause(fugue_sqlParser *parser) {return parser->aggregationClause();}
antlr4::tree::ParseTree* get_parse_tree_groupingSet(fugue_sqlParser *parser) {return parser->groupingSet();}
antlr4::tree::ParseTree* get_parse_tree_pivotClause(fugue_sqlParser *parser) {return parser->pivotClause();}
antlr4::tree::ParseTree* get_parse_tree_pivotColumn(fugue_sqlParser *parser) {return parser->pivotColumn();}
antlr4::tree::ParseTree* get_parse_tree_pivotValue(fugue_sqlParser *parser) {return parser->pivotValue();}
antlr4::tree::ParseTree* get_parse_tree_lateralView(fugue_sqlParser *parser) {return parser->lateralView();}
antlr4::tree::ParseTree* get_parse_tree_setQuantifier(fugue_sqlParser *parser) {return parser->setQuantifier();}
antlr4::tree::ParseTree* get_parse_tree_relation(fugue_sqlParser *parser) {return parser->relation();}
antlr4::tree::ParseTree* get_parse_tree_joinRelation(fugue_sqlParser *parser) {return parser->joinRelation();}
antlr4::tree::ParseTree* get_parse_tree_joinType(fugue_sqlParser *parser) {return parser->joinType();}
antlr4::tree::ParseTree* get_parse_tree_joinCriteria(fugue_sqlParser *parser) {return parser->joinCriteria();}
antlr4::tree::ParseTree* get_parse_tree_sample(fugue_sqlParser *parser) {return parser->sample();}
antlr4::tree::ParseTree* get_parse_tree_sampleMethod(fugue_sqlParser *parser) {return parser->sampleMethod();}
antlr4::tree::ParseTree* get_parse_tree_identifierList(fugue_sqlParser *parser) {return parser->identifierList();}
antlr4::tree::ParseTree* get_parse_tree_identifierSeq(fugue_sqlParser *parser) {return parser->identifierSeq();}
antlr4::tree::ParseTree* get_parse_tree_orderedIdentifierList(fugue_sqlParser *parser) {return parser->orderedIdentifierList();}
antlr4::tree::ParseTree* get_parse_tree_orderedIdentifier(fugue_sqlParser *parser) {return parser->orderedIdentifier();}
antlr4::tree::ParseTree* get_parse_tree_identifierCommentList(fugue_sqlParser *parser) {return parser->identifierCommentList();}
antlr4::tree::ParseTree* get_parse_tree_identifierComment(fugue_sqlParser *parser) {return parser->identifierComment();}
antlr4::tree::ParseTree* get_parse_tree_relationPrimary(fugue_sqlParser *parser) {return parser->relationPrimary();}
antlr4::tree::ParseTree* get_parse_tree_inlineTable(fugue_sqlParser *parser) {return parser->inlineTable();}
antlr4::tree::ParseTree* get_parse_tree_functionTable(fugue_sqlParser *parser) {return parser->functionTable();}
antlr4::tree::ParseTree* get_parse_tree_tableAlias(fugue_sqlParser *parser) {return parser->tableAlias();}
antlr4::tree::ParseTree* get_parse_tree_rowFormat(fugue_sqlParser *parser) {return parser->rowFormat();}
antlr4::tree::ParseTree* get_parse_tree_multipartIdentifierList(fugue_sqlParser *parser) {return parser->multipartIdentifierList();}
antlr4::tree::ParseTree* get_parse_tree_multipartIdentifier(fugue_sqlParser *parser) {return parser->multipartIdentifier();}
antlr4::tree::ParseTree* get_parse_tree_tableIdentifier(fugue_sqlParser *parser) {return parser->tableIdentifier();}
antlr4::tree::ParseTree* get_parse_tree_functionIdentifier(fugue_sqlParser *parser) {return parser->functionIdentifier();}
antlr4::tree::ParseTree* get_parse_tree_namedExpression(fugue_sqlParser *parser) {return parser->namedExpression();}
antlr4::tree::ParseTree* get_parse_tree_namedExpressionSeq(fugue_sqlParser *parser) {return parser->namedExpressionSeq();}
antlr4::tree::ParseTree* get_parse_tree_transformList(fugue_sqlParser *parser) {return parser->transformList();}
antlr4::tree::ParseTree* get_parse_tree_transform(fugue_sqlParser *parser) {return parser->transform();}
antlr4::tree::ParseTree* get_parse_tree_transformArgument(fugue_sqlParser *parser) {return parser->transformArgument();}
antlr4::tree::ParseTree* get_parse_tree_expression(fugue_sqlParser *parser) {return parser->expression();}
antlr4::tree::ParseTree* get_parse_tree_booleanExpression(fugue_sqlParser *parser) {return parser->booleanExpression();}
antlr4::tree::ParseTree* get_parse_tree_predicate(fugue_sqlParser *parser) {return parser->predicate();}
antlr4::tree::ParseTree* get_parse_tree_valueExpression(fugue_sqlParser *parser) {return parser->valueExpression();}
antlr4::tree::ParseTree* get_parse_tree_primaryExpression(fugue_sqlParser *parser) {return parser->primaryExpression();}
antlr4::tree::ParseTree* get_parse_tree_constant(fugue_sqlParser *parser) {return parser->constant();}
antlr4::tree::ParseTree* get_parse_tree_comparisonOperator(fugue_sqlParser *parser) {return parser->comparisonOperator();}
antlr4::tree::ParseTree* get_parse_tree_comparisonEqualOperator(fugue_sqlParser *parser) {return parser->comparisonEqualOperator();}
antlr4::tree::ParseTree* get_parse_tree_arithmeticOperator(fugue_sqlParser *parser) {return parser->arithmeticOperator();}
antlr4::tree::ParseTree* get_parse_tree_predicateOperator(fugue_sqlParser *parser) {return parser->predicateOperator();}
antlr4::tree::ParseTree* get_parse_tree_booleanValue(fugue_sqlParser *parser) {return parser->booleanValue();}
antlr4::tree::ParseTree* get_parse_tree_interval(fugue_sqlParser *parser) {return parser->interval();}
antlr4::tree::ParseTree* get_parse_tree_errorCapturingMultiUnitsInterval(fugue_sqlParser *parser) {return parser->errorCapturingMultiUnitsInterval();}
antlr4::tree::ParseTree* get_parse_tree_multiUnitsInterval(fugue_sqlParser *parser) {return parser->multiUnitsInterval();}
antlr4::tree::ParseTree* get_parse_tree_errorCapturingUnitToUnitInterval(fugue_sqlParser *parser) {return parser->errorCapturingUnitToUnitInterval();}
antlr4::tree::ParseTree* get_parse_tree_unitToUnitInterval(fugue_sqlParser *parser) {return parser->unitToUnitInterval();}
antlr4::tree::ParseTree* get_parse_tree_intervalValue(fugue_sqlParser *parser) {return parser->intervalValue();}
antlr4::tree::ParseTree* get_parse_tree_intervalUnit(fugue_sqlParser *parser) {return parser->intervalUnit();}
antlr4::tree::ParseTree* get_parse_tree_colPosition(fugue_sqlParser *parser) {return parser->colPosition();}
antlr4::tree::ParseTree* get_parse_tree_dataType(fugue_sqlParser *parser) {return parser->dataType();}
antlr4::tree::ParseTree* get_parse_tree_qualifiedColTypeWithPositionList(fugue_sqlParser *parser) {return parser->qualifiedColTypeWithPositionList();}
antlr4::tree::ParseTree* get_parse_tree_qualifiedColTypeWithPosition(fugue_sqlParser *parser) {return parser->qualifiedColTypeWithPosition();}
antlr4::tree::ParseTree* get_parse_tree_colTypeList(fugue_sqlParser *parser) {return parser->colTypeList();}
antlr4::tree::ParseTree* get_parse_tree_colType(fugue_sqlParser *parser) {return parser->colType();}
antlr4::tree::ParseTree* get_parse_tree_complexColTypeList(fugue_sqlParser *parser) {return parser->complexColTypeList();}
antlr4::tree::ParseTree* get_parse_tree_complexColType(fugue_sqlParser *parser) {return parser->complexColType();}
antlr4::tree::ParseTree* get_parse_tree_whenClause(fugue_sqlParser *parser) {return parser->whenClause();}
antlr4::tree::ParseTree* get_parse_tree_windowClause(fugue_sqlParser *parser) {return parser->windowClause();}
antlr4::tree::ParseTree* get_parse_tree_namedWindow(fugue_sqlParser *parser) {return parser->namedWindow();}
antlr4::tree::ParseTree* get_parse_tree_windowSpec(fugue_sqlParser *parser) {return parser->windowSpec();}
antlr4::tree::ParseTree* get_parse_tree_windowFrame(fugue_sqlParser *parser) {return parser->windowFrame();}
antlr4::tree::ParseTree* get_parse_tree_frameBound(fugue_sqlParser *parser) {return parser->frameBound();}
antlr4::tree::ParseTree* get_parse_tree_qualifiedNameList(fugue_sqlParser *parser) {return parser->qualifiedNameList();}
antlr4::tree::ParseTree* get_parse_tree_functionName(fugue_sqlParser *parser) {return parser->functionName();}
antlr4::tree::ParseTree* get_parse_tree_qualifiedName(fugue_sqlParser *parser) {return parser->qualifiedName();}
antlr4::tree::ParseTree* get_parse_tree_errorCapturingIdentifier(fugue_sqlParser *parser) {return parser->errorCapturingIdentifier();}
antlr4::tree::ParseTree* get_parse_tree_errorCapturingIdentifierExtra(fugue_sqlParser *parser) {return parser->errorCapturingIdentifierExtra();}
antlr4::tree::ParseTree* get_parse_tree_identifier(fugue_sqlParser *parser) {return parser->identifier();}
antlr4::tree::ParseTree* get_parse_tree_strictIdentifier(fugue_sqlParser *parser) {return parser->strictIdentifier();}
antlr4::tree::ParseTree* get_parse_tree_quotedIdentifier(fugue_sqlParser *parser) {return parser->quotedIdentifier();}
antlr4::tree::ParseTree* get_parse_tree_number(fugue_sqlParser *parser) {return parser->number();}
antlr4::tree::ParseTree* get_parse_tree_alterColumnAction(fugue_sqlParser *parser) {return parser->alterColumnAction();}
antlr4::tree::ParseTree* get_parse_tree_ansiNonReserved(fugue_sqlParser *parser) {return parser->ansiNonReserved();}
antlr4::tree::ParseTree* get_parse_tree_strictNonReserved(fugue_sqlParser *parser) {return parser->strictNonReserved();}
antlr4::tree::ParseTree* get_parse_tree_nonReserved(fugue_sqlParser *parser) {return parser->nonReserved();}

antlr4::tree::ParseTree* get_parse_tree(fugue_sqlParser *parser, const char *entry_rule_name) {
    static std::map<std::string, antlr4::tree::ParseTree* (*)(fugue_sqlParser*)> table
    {
        {"fugueLanguage", &get_parse_tree_fugueLanguage},
        {"fugueSingleStatement", &get_parse_tree_fugueSingleStatement},
        {"fugueSingleTask", &get_parse_tree_fugueSingleTask},
        {"fugueNestableTask", &get_parse_tree_fugueNestableTask},
        {"fugueNestableTaskCollectionNoSelect", &get_parse_tree_fugueNestableTaskCollectionNoSelect},
        {"fugueTransformTask", &get_parse_tree_fugueTransformTask},
        {"fugueProcessTask", &get_parse_tree_fugueProcessTask},
        {"fugueSaveAndUseTask", &get_parse_tree_fugueSaveAndUseTask},
        {"fugueRenameColumnsTask", &get_parse_tree_fugueRenameColumnsTask},
        {"fugueAlterColumnsTask", &get_parse_tree_fugueAlterColumnsTask},
        {"fugueDropColumnsTask", &get_parse_tree_fugueDropColumnsTask},
        {"fugueDropnaTask", &get_parse_tree_fugueDropnaTask},
        {"fugueFillnaTask", &get_parse_tree_fugueFillnaTask},
        {"fugueSampleTask", &get_parse_tree_fugueSampleTask},
        {"fugueTakeTask", &get_parse_tree_fugueTakeTask},
        {"fugueZipTask", &get_parse_tree_fugueZipTask},
        {"fugueCreateTask", &get_parse_tree_fugueCreateTask},
        {"fugueCreateDataTask", &get_parse_tree_fugueCreateDataTask},
        {"fugueLoadTask", &get_parse_tree_fugueLoadTask},
        {"fugueOutputTask", &get_parse_tree_fugueOutputTask},
        {"fuguePrintTask", &get_parse_tree_fuguePrintTask},
        {"fugueSaveTask", &get_parse_tree_fugueSaveTask},
        {"fugueOutputTransformTask", &get_parse_tree_fugueOutputTransformTask},
        {"fugueModuleTask", &get_parse_tree_fugueModuleTask},
        {"fugueSqlEngine", &get_parse_tree_fugueSqlEngine},
        {"fugueSingleFile", &get_parse_tree_fugueSingleFile},
        {"fugueLoadColumns", &get_parse_tree_fugueLoadColumns},
        {"fugueSaveMode", &get_parse_tree_fugueSaveMode},
        {"fugueFileFormat", &get_parse_tree_fugueFileFormat},
        {"fuguePath", &get_parse_tree_fuguePath},
        {"fugueCheckpoint", &get_parse_tree_fugueCheckpoint},
        {"fugueCheckpointNamespace", &get_parse_tree_fugueCheckpointNamespace},
        {"fugueYield", &get_parse_tree_fugueYield},
        {"fugueBroadcast", &get_parse_tree_fugueBroadcast},
        {"fugueDataFrames", &get_parse_tree_fugueDataFrames},
        {"fugueDataFramePair", &get_parse_tree_fugueDataFramePair},
        {"fugueDataFrame", &get_parse_tree_fugueDataFrame},
        {"fugueDataFrameMember", &get_parse_tree_fugueDataFrameMember},
        {"fugueAssignment", &get_parse_tree_fugueAssignment},
        {"fugueAssignmentSign", &get_parse_tree_fugueAssignmentSign},
        {"fugueSingleOutputExtensionCommonWild", &get_parse_tree_fugueSingleOutputExtensionCommonWild},
        {"fugueSingleOutputExtensionCommon", &get_parse_tree_fugueSingleOutputExtensionCommon},
        {"fugueExtension", &get_parse_tree_fugueExtension},
        {"fugueSampleMethod", &get_parse_tree_fugueSampleMethod},
        {"fugueZipType", &get_parse_tree_fugueZipType},
        {"fuguePrepartition", &get_parse_tree_fuguePrepartition},
        {"fuguePartitionAlgo", &get_parse_tree_fuguePartitionAlgo},
        {"fuguePartitionNum", &get_parse_tree_fuguePartitionNum},
        {"fuguePartitionNumber", &get_parse_tree_fuguePartitionNumber},
        {"fugueParams", &get_parse_tree_fugueParams},
        {"fugueCols", &get_parse_tree_fugueCols},
        {"fugueColsSort", &get_parse_tree_fugueColsSort},
        {"fugueColSort", &get_parse_tree_fugueColSort},
        {"fugueColumnIdentifier", &get_parse_tree_fugueColumnIdentifier},
        {"fugueRenameExpression", &get_parse_tree_fugueRenameExpression},
        {"fugueWildSchema", &get_parse_tree_fugueWildSchema},
        {"fugueWildSchemaPair", &get_parse_tree_fugueWildSchemaPair},
        {"fugueSchemaOp", &get_parse_tree_fugueSchemaOp},
        {"fugueSchema", &get_parse_tree_fugueSchema},
        {"fugueSchemaPair", &get_parse_tree_fugueSchemaPair},
        {"fugueSchemaKey", &get_parse_tree_fugueSchemaKey},
        {"fugueSchemaType", &get_parse_tree_fugueSchemaType},
        {"fugueRenamePair", &get_parse_tree_fugueRenamePair},
        {"fugueJson", &get_parse_tree_fugueJson},
        {"fugueJsonObj", &get_parse_tree_fugueJsonObj},
        {"fugueJsonPairs", &get_parse_tree_fugueJsonPairs},
        {"fugueJsonPair", &get_parse_tree_fugueJsonPair},
        {"fugueJsonKey", &get_parse_tree_fugueJsonKey},
        {"fugueJsonArray", &get_parse_tree_fugueJsonArray},
        {"fugueJsonValue", &get_parse_tree_fugueJsonValue},
        {"fugueJsonNumber", &get_parse_tree_fugueJsonNumber},
        {"fugueJsonString", &get_parse_tree_fugueJsonString},
        {"fugueJsonBool", &get_parse_tree_fugueJsonBool},
        {"fugueJsonNull", &get_parse_tree_fugueJsonNull},
        {"fugueIdentifier", &get_parse_tree_fugueIdentifier},
        {"singleStatement", &get_parse_tree_singleStatement},
        {"singleExpression", &get_parse_tree_singleExpression},
        {"singleTableIdentifier", &get_parse_tree_singleTableIdentifier},
        {"singleMultipartIdentifier", &get_parse_tree_singleMultipartIdentifier},
        {"singleFunctionIdentifier", &get_parse_tree_singleFunctionIdentifier},
        {"singleDataType", &get_parse_tree_singleDataType},
        {"singleTableSchema", &get_parse_tree_singleTableSchema},
        {"statement", &get_parse_tree_statement},
        {"unsupportedHiveNativeCommands", &get_parse_tree_unsupportedHiveNativeCommands},
        {"createTableHeader", &get_parse_tree_createTableHeader},
        {"replaceTableHeader", &get_parse_tree_replaceTableHeader},
        {"bucketSpec", &get_parse_tree_bucketSpec},
        {"skewSpec", &get_parse_tree_skewSpec},
        {"locationSpec", &get_parse_tree_locationSpec},
        {"commentSpec", &get_parse_tree_commentSpec},
        {"query", &get_parse_tree_query},
        {"insertInto", &get_parse_tree_insertInto},
        {"partitionSpecLocation", &get_parse_tree_partitionSpecLocation},
        {"partitionSpec", &get_parse_tree_partitionSpec},
        {"partitionVal", &get_parse_tree_partitionVal},
        {"theNamespace", &get_parse_tree_theNamespace},
        {"describeFuncName", &get_parse_tree_describeFuncName},
        {"describeColName", &get_parse_tree_describeColName},
        {"ctes", &get_parse_tree_ctes},
        {"namedQuery", &get_parse_tree_namedQuery},
        {"tableProvider", &get_parse_tree_tableProvider},
        {"createTableClauses", &get_parse_tree_createTableClauses},
        {"tablePropertyList", &get_parse_tree_tablePropertyList},
        {"tableProperty", &get_parse_tree_tableProperty},
        {"tablePropertyKey", &get_parse_tree_tablePropertyKey},
        {"tablePropertyValue", &get_parse_tree_tablePropertyValue},
        {"constantList", &get_parse_tree_constantList},
        {"nestedConstantList", &get_parse_tree_nestedConstantList},
        {"createFileFormat", &get_parse_tree_createFileFormat},
        {"fileFormat", &get_parse_tree_fileFormat},
        {"storageHandler", &get_parse_tree_storageHandler},
        {"resource", &get_parse_tree_resource},
        {"dmlStatementNoWith", &get_parse_tree_dmlStatementNoWith},
        {"queryOrganization", &get_parse_tree_queryOrganization},
        {"multiInsertQueryBody", &get_parse_tree_multiInsertQueryBody},
        {"queryTerm", &get_parse_tree_queryTerm},
        {"queryPrimary", &get_parse_tree_queryPrimary},
        {"sortItem", &get_parse_tree_sortItem},
        {"fromStatement", &get_parse_tree_fromStatement},
        {"fromStatementBody", &get_parse_tree_fromStatementBody},
        {"querySpecification", &get_parse_tree_querySpecification},
        {"optionalFromClause", &get_parse_tree_optionalFromClause},
        {"transformClause", &get_parse_tree_transformClause},
        {"selectClause", &get_parse_tree_selectClause},
        {"setClause", &get_parse_tree_setClause},
        {"matchedClause", &get_parse_tree_matchedClause},
        {"notMatchedClause", &get_parse_tree_notMatchedClause},
        {"matchedAction", &get_parse_tree_matchedAction},
        {"notMatchedAction", &get_parse_tree_notMatchedAction},
        {"assignmentList", &get_parse_tree_assignmentList},
        {"assignment", &get_parse_tree_assignment},
        {"whereClause", &get_parse_tree_whereClause},
        {"havingClause", &get_parse_tree_havingClause},
        {"hint", &get_parse_tree_hint},
        {"hintStatement", &get_parse_tree_hintStatement},
        {"fromClause", &get_parse_tree_fromClause},
        {"aggregationClause", &get_parse_tree_aggregationClause},
        {"groupingSet", &get_parse_tree_groupingSet},
        {"pivotClause", &get_parse_tree_pivotClause},
        {"pivotColumn", &get_parse_tree_pivotColumn},
        {"pivotValue", &get_parse_tree_pivotValue},
        {"lateralView", &get_parse_tree_lateralView},
        {"setQuantifier", &get_parse_tree_setQuantifier},
        {"relation", &get_parse_tree_relation},
        {"joinRelation", &get_parse_tree_joinRelation},
        {"joinType", &get_parse_tree_joinType},
        {"joinCriteria", &get_parse_tree_joinCriteria},
        {"sample", &get_parse_tree_sample},
        {"sampleMethod", &get_parse_tree_sampleMethod},
        {"identifierList", &get_parse_tree_identifierList},
        {"identifierSeq", &get_parse_tree_identifierSeq},
        {"orderedIdentifierList", &get_parse_tree_orderedIdentifierList},
        {"orderedIdentifier", &get_parse_tree_orderedIdentifier},
        {"identifierCommentList", &get_parse_tree_identifierCommentList},
        {"identifierComment", &get_parse_tree_identifierComment},
        {"relationPrimary", &get_parse_tree_relationPrimary},
        {"inlineTable", &get_parse_tree_inlineTable},
        {"functionTable", &get_parse_tree_functionTable},
        {"tableAlias", &get_parse_tree_tableAlias},
        {"rowFormat", &get_parse_tree_rowFormat},
        {"multipartIdentifierList", &get_parse_tree_multipartIdentifierList},
        {"multipartIdentifier", &get_parse_tree_multipartIdentifier},
        {"tableIdentifier", &get_parse_tree_tableIdentifier},
        {"functionIdentifier", &get_parse_tree_functionIdentifier},
        {"namedExpression", &get_parse_tree_namedExpression},
        {"namedExpressionSeq", &get_parse_tree_namedExpressionSeq},
        {"transformList", &get_parse_tree_transformList},
        {"transform", &get_parse_tree_transform},
        {"transformArgument", &get_parse_tree_transformArgument},
        {"expression", &get_parse_tree_expression},
        {"booleanExpression", &get_parse_tree_booleanExpression},
        {"predicate", &get_parse_tree_predicate},
        {"valueExpression", &get_parse_tree_valueExpression},
        {"primaryExpression", &get_parse_tree_primaryExpression},
        {"constant", &get_parse_tree_constant},
        {"comparisonOperator", &get_parse_tree_comparisonOperator},
        {"comparisonEqualOperator", &get_parse_tree_comparisonEqualOperator},
        {"arithmeticOperator", &get_parse_tree_arithmeticOperator},
        {"predicateOperator", &get_parse_tree_predicateOperator},
        {"booleanValue", &get_parse_tree_booleanValue},
        {"interval", &get_parse_tree_interval},
        {"errorCapturingMultiUnitsInterval", &get_parse_tree_errorCapturingMultiUnitsInterval},
        {"multiUnitsInterval", &get_parse_tree_multiUnitsInterval},
        {"errorCapturingUnitToUnitInterval", &get_parse_tree_errorCapturingUnitToUnitInterval},
        {"unitToUnitInterval", &get_parse_tree_unitToUnitInterval},
        {"intervalValue", &get_parse_tree_intervalValue},
        {"intervalUnit", &get_parse_tree_intervalUnit},
        {"colPosition", &get_parse_tree_colPosition},
        {"dataType", &get_parse_tree_dataType},
        {"qualifiedColTypeWithPositionList", &get_parse_tree_qualifiedColTypeWithPositionList},
        {"qualifiedColTypeWithPosition", &get_parse_tree_qualifiedColTypeWithPosition},
        {"colTypeList", &get_parse_tree_colTypeList},
        {"colType", &get_parse_tree_colType},
        {"complexColTypeList", &get_parse_tree_complexColTypeList},
        {"complexColType", &get_parse_tree_complexColType},
        {"whenClause", &get_parse_tree_whenClause},
        {"windowClause", &get_parse_tree_windowClause},
        {"namedWindow", &get_parse_tree_namedWindow},
        {"windowSpec", &get_parse_tree_windowSpec},
        {"windowFrame", &get_parse_tree_windowFrame},
        {"frameBound", &get_parse_tree_frameBound},
        {"qualifiedNameList", &get_parse_tree_qualifiedNameList},
        {"functionName", &get_parse_tree_functionName},
        {"qualifiedName", &get_parse_tree_qualifiedName},
        {"errorCapturingIdentifier", &get_parse_tree_errorCapturingIdentifier},
        {"errorCapturingIdentifierExtra", &get_parse_tree_errorCapturingIdentifierExtra},
        {"identifier", &get_parse_tree_identifier},
        {"strictIdentifier", &get_parse_tree_strictIdentifier},
        {"quotedIdentifier", &get_parse_tree_quotedIdentifier},
        {"number", &get_parse_tree_number},
        {"alterColumnAction", &get_parse_tree_alterColumnAction},
        {"ansiNonReserved", &get_parse_tree_ansiNonReserved},
        {"strictNonReserved", &get_parse_tree_strictNonReserved},
        {"nonReserved", &get_parse_tree_nonReserved}
    };

    auto entry = table.find(entry_rule_name);
    if (entry != table.end()) {
        return (*(entry->second))(parser);
    } else {
        PyErr_SetString(PyExc_ValueError, "Invalid entry_rule_name");
        throw speedy_antlr::PythonException();
    }
}

/*
 * Python function prototype:
 *  do_parse(
 *      parser_cls:antlr4.Parser,
 *      stream:antlr4.InputStream,
 *      entry_rule_name:str,
 *      sa_err_listener:SA_ErrorListener
 *  )
 */
PyObject* do_parse(PyObject *self, PyObject *args) {
    PyObject *strdata = NULL;
    PyObject *result = NULL;
    PyObject *token_module = NULL;

    try {
        // Get args
        PyObject *parser_cls = NULL;
        PyObject *stream = NULL;
        const char *entry_rule_name = NULL;
        PyObject *sa_err_listener = NULL;
        if(!PyArg_ParseTuple(args,
            "OOsO:do_parse",
            &parser_cls, &stream, &entry_rule_name, &sa_err_listener
        )) {
            return NULL;
        }

        // Extract input stream's string
        const char *cstrdata;
        Py_ssize_t bufsize;
        strdata = PyObject_GetAttrString(stream, "strdata");
        if(!strdata) throw speedy_antlr::PythonException();
        cstrdata = PyUnicode_AsUTF8AndSize(strdata, &bufsize);
        if(!cstrdata) throw speedy_antlr::PythonException();

        // Create an antlr InputStream object
        antlr4::ANTLRInputStream cpp_stream(cstrdata, bufsize);

        // in case error listener is overridden
        token_module = PyImport_ImportModule("antlr4.Token");
        if(!token_module) throw speedy_antlr::PythonException();
        speedy_antlr::Translator translator(parser_cls, stream);
        speedy_antlr::ErrorTranslatorListener err_listener(&translator, sa_err_listener);

        // Lex
        fugue_sqlLexer lexer(&cpp_stream);
        if(sa_err_listener != Py_None){
            lexer.removeErrorListeners();
            lexer.addErrorListener(&err_listener);
        }
        antlr4::CommonTokenStream token_stream(&lexer);
        token_stream.fill();

        // Parse
        fugue_sqlParser parser(&token_stream);
        if(sa_err_listener != Py_None){
            parser.removeErrorListeners();
            parser.addErrorListener(&err_listener);
        }
        antlr4::tree::ParseTree *parse_tree;
        parse_tree = get_parse_tree(&parser, entry_rule_name);

        // Translate Parse tree to Python
        SA_fugue_sqlTranslator visitor(&translator);
        result = std::any_cast<PyObject *>(visitor.visit(parse_tree));

        // Clean up data
        Py_XDECREF(token_module);
        Py_XDECREF(strdata);

        return result;

    } catch(speedy_antlr::PythonException &e) {
        Py_XDECREF(token_module);
        Py_XDECREF(strdata);
        Py_XDECREF(result);

        // Python exception already has error indicator set
        return NULL;
    } catch(...) {
        Py_XDECREF(token_module);
        Py_XDECREF(strdata);
        Py_XDECREF(result);

        // An internal C++ exception was thrown.
        // Set error indicator to a generic runtime error
        PyErr_SetString(PyExc_RuntimeError, "Internal error");
        return NULL;
    }
}


extern "C" {

    static PyObject* c_do_parse(PyObject *self, PyObject *args) {
        return do_parse(self, args);
    }

    static PyMethodDef methods[] = {
        {
            "do_parse",  c_do_parse, METH_VARARGS,
            "Run parser"
        },
        {NULL, NULL, 0, NULL} /* Sentinel */
    };

    static struct PyModuleDef module = {
        PyModuleDef_HEAD_INIT,
        "sa_fugue_sql_cpp_parser",   /* name of module */
        NULL, /* module documentation, may be NULL */
        -1,       /* size of per-interpreter state of the module,
                    or -1 if the module keeps state in global variables. */
        methods
    };
}


PyMODINIT_FUNC
PyInit_sa_fugue_sql_cpp_parser(void) {
    PyObject *m = PyModule_Create(&module);
    return m;
}