Class SqlParserTest
- java.lang.Object
-
- org.apache.calcite.sql.parser.SqlParserTest
-
- Direct Known Subclasses:
BabelParserTest
,ServerParserTest
,SqlUnParserTest
public class SqlParserTest extends java.lang.Object
ASqlParserTest
is a unit-test forthe SQL parser
.To reuse this test for an extension parser, implement the
parserImplFactory()
method to return the extension parser implementation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
SqlParserTest.Checker
Runs tests on period operators such as OVERLAPS, IMMEDIATELY PRECEDES.protected class
SqlParserTest.Sql
Helper class for building fluent code such assql("values 1").ok();
.protected static interface
SqlParserTest.Tester
Callback to control how test actions are performed.protected class
SqlParserTest.TesterImpl
Default implementation ofSqlParserTest.Tester
.class
SqlParserTest.UnparsingTesterImpl
Implementation ofSqlParserTest.Tester
which makes sure that the results of unparsing a query are consistent with the original query.
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
ANY
(package private) org.apache.calcite.sql.validate.SqlConformance
conformance
private static java.lang.ThreadLocal<boolean[]>
LINUXIFY
(package private) org.apache.calcite.avatica.util.Casing
quotedCasing
(package private) org.apache.calcite.avatica.util.Quoting
quoting
private static java.util.List<java.lang.String>
RESERVED_KEYWORDS
List of reserved keywords.(package private) org.apache.calcite.avatica.util.Casing
unquotedCasing
-
Constructor Summary
Constructors Constructor Description SqlParserTest()
-
Method Summary
-
-
-
Field Detail
-
RESERVED_KEYWORDS
private static final java.util.List<java.lang.String> RESERVED_KEYWORDS
List of reserved keywords.Each keyword is followed by tokens indicating whether it is reserved in the SQL:92, SQL:99, SQL:2003, SQL:2011, SQL:2014 standards and in Calcite.
The standard keywords are derived from Mimer and from the specification.
If a new reserved keyword is added to the parser, include it in this list, flagged "c". If the keyword is not intended to be a reserved keyword, add it to the non-reserved keyword list in the parser.
-
ANY
private static final java.lang.String ANY
- See Also:
- Constant Field Values
-
LINUXIFY
private static final java.lang.ThreadLocal<boolean[]> LINUXIFY
-
quoting
org.apache.calcite.avatica.util.Quoting quoting
-
unquotedCasing
org.apache.calcite.avatica.util.Casing unquotedCasing
-
quotedCasing
org.apache.calcite.avatica.util.Casing quotedCasing
-
conformance
org.apache.calcite.sql.validate.SqlConformance conformance
-
-
Method Detail
-
getTester
protected SqlParserTest.Tester getTester()
-
check
protected void check(java.lang.String sql, java.lang.String expected)
-
sql
protected SqlParserTest.Sql sql(java.lang.String sql)
-
parserImplFactory
protected org.apache.calcite.sql.parser.SqlParserImplFactory parserImplFactory()
Implementors of custom parsing logic who want to reuse this test should override this method with the factory for their extension parser.
-
getSqlParser
protected org.apache.calcite.sql.parser.SqlParser getSqlParser(java.lang.String sql)
-
getSqlParser
protected org.apache.calcite.sql.parser.SqlParser getSqlParser(java.io.Reader source)
-
checkExp
protected void checkExp(java.lang.String sql, java.lang.String expected)
-
checkExpSame
protected void checkExpSame(java.lang.String sql)
-
checkFails
protected void checkFails(java.lang.String sql, java.lang.String expectedMsgPattern)
-
checkExpFails
protected void checkExpFails(java.lang.String sql, java.lang.String expectedMsgPattern)
Tests that an expression throws an exception which matches the given pattern.
-
isDdl
public static org.hamcrest.Matcher<org.apache.calcite.sql.SqlNode> isDdl()
Returns aMatcher
that succeeds if the givenSqlNode
is a DDL statement.
-
getReservedKeywords
protected java.util.SortedSet<java.lang.String> getReservedKeywords()
-
isReserved
protected boolean isReserved(java.lang.String word)
Returns whether a word is reserved in this parser. This method can be used to disable tests that behave differently with different collections of reserved words.
-
keywords
protected static java.util.SortedSet<java.lang.String> keywords(java.lang.String dialect)
-
testExceptionCleanup
public void testExceptionCleanup()
Tests that when there is an error, non-reserved keywords such as "A", "ABSOLUTE" (which naturally arise whenever a production uses "<IDENTIFIER>") are removed, but reserved words such as "AND" remain.
-
testInvalidToken
public void testInvalidToken()
-
testStarAsFails
public void testStarAsFails()
-
testDerivedColumnList
public void testDerivedColumnList()
-
testDerivedColumnListInJoin
public void testDerivedColumnListInJoin()
-
testBetweenAnd
public void testBetweenAnd()
Test case that does not reproduce but is related to [CALCITE-2637] Prefix '-' operator failed between BETWEEN and AND.
-
testBetweenAnd2
public void testBetweenAnd2()
-
testDerivedColumnListNoAs
public void testDerivedColumnListNoAs()
-
testEmbeddedCall
public void testEmbeddedCall()
-
testEmbeddedFunction
public void testEmbeddedFunction()
-
testColumnAliasWithAs
public void testColumnAliasWithAs()
-
testColumnAliasWithoutAs
public void testColumnAliasWithoutAs()
-
testEmbeddedDate
public void testEmbeddedDate()
-
testEmbeddedTime
public void testEmbeddedTime()
-
testEmbeddedTimestamp
public void testEmbeddedTimestamp()
-
testNot
public void testNot()
-
testBooleanPrecedenceAndAssociativity
public void testBooleanPrecedenceAndAssociativity()
-
testLessThanAssociativity
public void testLessThanAssociativity()
-
testIsBooleans
public void testIsBooleans()
-
testIsBooleanPrecedenceAndAssociativity
public void testIsBooleanPrecedenceAndAssociativity()
-
testEqualNotEqual
public void testEqualNotEqual()
-
testBangEqualIsBad
public void testBangEqualIsBad()
-
testBetween
public void testBetween()
-
testOperateOnColumn
public void testOperateOnColumn()
-
testRow
public void testRow()
-
isUnparserTest
protected boolean isUnparserTest()
Whether this is a sub-class that tests un-parsing as well as parsing.
-
testRowWitDot
public void testRowWitDot()
-
testPeriod
public void testPeriod()
-
testOverlaps
public void testOverlaps()
-
checkPeriodPredicate
void checkPeriodPredicate(SqlParserTest.Checker checker)
-
testIsDistinctFrom
public void testIsDistinctFrom()
-
testIsNotDistinct
public void testIsNotDistinct()
-
testFloor
public void testFloor()
-
testCeil
public void testCeil()
-
testCast
public void testCast()
-
testCastFails
public void testCastFails()
-
testLikeAndSimilar
public void testLikeAndSimilar()
-
testFoo
public void testFoo()
-
testArithmeticOperators
public void testArithmeticOperators()
-
testExists
public void testExists()
-
testExistsInWhere
public void testExistsInWhere()
-
testFromWithAs
public void testFromWithAs()
-
testConcat
public void testConcat()
-
testReverseSolidus
public void testReverseSolidus()
-
testSubstring
public void testSubstring()
-
testFunction
public void testFunction()
-
testFunctionWithDistinct
public void testFunctionWithDistinct()
-
testFunctionCallWithDot
public void testFunctionCallWithDot()
-
testFunctionInFunction
public void testFunctionInFunction()
-
testFunctionNamedArgument
public void testFunctionNamedArgument()
-
testFunctionDefaultArgument
public void testFunctionDefaultArgument()
-
testDefault
public void testDefault()
-
testAggregateFilter
public void testAggregateFilter()
-
testGroup
public void testGroup()
-
testGroupEmpty
public void testGroupEmpty()
-
testHavingAfterGroup
public void testHavingAfterGroup()
-
testHavingBeforeGroupFails
public void testHavingBeforeGroupFails()
-
testHavingNoGroup
public void testHavingNoGroup()
-
testGroupingSets
public void testGroupingSets()
-
testGroupByCube
public void testGroupByCube()
-
testGroupByCube2
public void testGroupByCube2()
-
testGroupByRollup
public void testGroupByRollup()
-
testGrouping
public void testGrouping()
-
testWith
public void testWith()
-
testWith2
public void testWith2()
-
testWithFails
public void testWithFails()
-
testWithValues
public void testWithValues()
-
testWithNestedFails
public void testWithNestedFails()
-
testWithNestedInSubQuery
public void testWithNestedInSubQuery()
-
testWithUnion
public void testWithUnion()
-
testIdentifier
public void testIdentifier()
-
testBackTickIdentifier
public void testBackTickIdentifier()
-
testBracketIdentifier
public void testBracketIdentifier()
-
testBackTickQuery
public void testBackTickQuery()
-
testInList
public void testInList()
-
testInListEmptyFails
public void testInListEmptyFails()
-
testInQuery
public void testInQuery()
-
testInQueryWithComma
public void testInQueryWithComma()
Tricky for the parser - looks like "IN (scalar, scalar)" but isn't.
-
testInSetop
public void testInSetop()
-
testSome
public void testSome()
-
testAll
public void testAll()
-
testAllList
public void testAllList()
-
testUnion
public void testUnion()
-
testUnionOrder
public void testUnionOrder()
-
testOrderUnion
public void testOrderUnion()
-
testLimitUnion
public void testLimitUnion()
-
testUnionOfNonQueryFails
public void testUnionOfNonQueryFails()
-
testQueryInIllegalContext
public void testQueryInIllegalContext()
In modern SQL, a query can occur almost everywhere that an expression can. This test tests the few exceptions.
-
testExcept
public void testExcept()
-
testSetMinus
public void testSetMinus()
Tests MINUS, which is equivalent to EXCEPT but only supported in some conformance levels (e.g. ORACLE).
-
testMinusIsReserved
public void testMinusIsReserved()
MINUS is a reserved keyword in Calcite in all conformances, even in the default conformance, where it is not allowed as an alternative to EXCEPT. (It is reserved in Oracle but not in any version of the SQL standard.)
-
testIntersect
public void testIntersect()
-
testJoinCross
public void testJoinCross()
-
testJoinOn
public void testJoinOn()
-
testJoinOnParentheses
public void testJoinOnParentheses()
-
testJoinOnParenthesesPlus
public void testJoinOnParenthesesPlus()
Same astestJoinOnParentheses()
but fancy aliases.
-
testExplicitTableInJoin
public void testExplicitTableInJoin()
-
testSubQueryInJoin
public void testSubQueryInJoin()
-
testOuterJoinNoiseWord
public void testOuterJoinNoiseWord()
-
testJoinQuery
public void testJoinQuery()
-
testFullInnerJoinFails
public void testFullInnerJoinFails()
-
testFullOuterJoin
public void testFullOuterJoin()
-
testInnerOuterJoinFails
public void testInnerOuterJoinFails()
-
testJoinAssociativity
public void testJoinAssociativity()
-
testNaturalCrossJoin
public void testNaturalCrossJoin()
-
testJoinUsing
public void testJoinUsing()
-
testApply
public void testApply()
Tests CROSS APPLY, which is equivalent to CROSS JOIN and LEFT JOIN but only supported in some conformance levels (e.g. SQL Server).
-
testOuterApply
public void testOuterApply()
Tests OUTER APPLY.
-
testOuterApplySubQuery
public void testOuterApplySubQuery()
-
testOuterApplyValues
public void testOuterApplyValues()
-
testOuterApplyFunctionFails
public void testOuterApplyFunctionFails()
Even in SQL Server conformance mode, we do not yet support 'function(args)' as an abbreviation for 'table(function(args)'.
-
testCrossOuterApply
public void testCrossOuterApply()
-
testTableSample
public void testTableSample()
-
testLiteral
public void testLiteral()
-
testContinuedLiteral
public void testContinuedLiteral()
-
testMixedFrom
public void testMixedFrom()
-
testMixedStar
public void testMixedStar()
-
testSchemaTableStar
public void testSchemaTableStar()
-
testCatalogSchemaTableStar
public void testCatalogSchemaTableStar()
-
testAliasedStar
public void testAliasedStar()
-
testNotExists
public void testNotExists()
-
testOrder
public void testOrder()
-
testOrderNullsFirst
public void testOrderNullsFirst()
-
testOrderInternal
public void testOrderInternal()
-
testOrderIllegalInExpression
public void testOrderIllegalInExpression()
-
testOrderOffsetFetch
public void testOrderOffsetFetch()
-
testLimit
public void testLimit()
"LIMIT ... OFFSET ..." is the postgres equivalent of SQL:2008 "OFFSET ... FETCH". It all maps down to a parse tree that looks like SQL:2008.
-
testLimitWithoutOrder
public void testLimitWithoutOrder()
Test case that does not reproduce but is related to [CALCITE-1238] Unparsing LIMIT without ORDER BY after validation.
-
testLimitOffsetWithoutOrder
public void testLimitOffsetWithoutOrder()
-
testLimitStartCount
public void testLimitStartCount()
-
testSqlInlineComment
public void testSqlInlineComment()
-
testMultilineComment
public void testMultilineComment()
-
testParseNumber
public void testParseNumber()
-
testParseNumberFails
public void testParseNumberFails()
-
testMinusPrefixInExpression
public void testMinusPrefixInExpression()
-
testPrecedence0
public void testPrecedence0()
-
testPrecedence1
public void testPrecedence1()
-
testPrecedence2
public void testPrecedence2()
-
testPrecedence2b
public void testPrecedence2b()
-
testPrecedence3
public void testPrecedence3()
-
testPrecedence4
public void testPrecedence4()
-
testPrecedence5
public void testPrecedence5()
-
testPrecedenceSetOps
public void testPrecedenceSetOps()
-
testQueryInFrom
public void testQueryInFrom()
-
testQuotesInString
public void testQuotesInString()
-
testScalarQueryInWhere
public void testScalarQueryInWhere()
-
testScalarQueryInSelect
public void testScalarQueryInSelect()
-
testSelectList
public void testSelectList()
-
testSelectWithoutFrom
public void testSelectWithoutFrom()
-
testSelectWithoutFrom2
public void testSelectWithoutFrom2()
-
testSelectDistinctWithoutFrom
public void testSelectDistinctWithoutFrom()
-
testSelectWithoutFromWhereFails
public void testSelectWithoutFromWhereFails()
-
testSelectWithoutFromGroupByFails
public void testSelectWithoutFromGroupByFails()
-
testSelectWithoutFromHavingFails
public void testSelectWithoutFromHavingFails()
-
testSelectList3
public void testSelectList3()
-
testSelectList4
public void testSelectList4()
-
testStar
public void testStar()
-
testCompoundStar
public void testCompoundStar()
-
testSelectDistinct
public void testSelectDistinct()
-
testSelectAll
public void testSelectAll()
-
testSelectStream
public void testSelectStream()
-
testSelectStreamDistinct
public void testSelectStreamDistinct()
-
testWhere
public void testWhere()
-
testNestedSelect
public void testNestedSelect()
-
testValues
public void testValues()
-
testValuesExplicitRow
public void testValuesExplicitRow()
-
testFromValues
public void testFromValues()
-
testFromValuesWithoutParens
public void testFromValuesWithoutParens()
-
testEmptyValues
public void testEmptyValues()
-
testTableExtend
public void testTableExtend()
-
testExplicitTable
public void testExplicitTable()
-
testExplicitTableOrdered
public void testExplicitTableOrdered()
-
testSelectFromExplicitTable
public void testSelectFromExplicitTable()
-
testSelectFromBareExplicitTableFails
public void testSelectFromBareExplicitTableFails()
-
testCollectionTable
public void testCollectionTable()
-
testCollectionTableWithCursorParam
public void testCollectionTableWithCursorParam()
-
testCollectionTableWithColumnListParam
public void testCollectionTableWithColumnListParam()
-
testLateral
public void testLateral()
-
testCollectionTableWithLateral
public void testCollectionTableWithLateral()
-
testCollectionTableWithLateral2
public void testCollectionTableWithLateral2()
-
testCollectionTableWithLateral3
public void testCollectionTableWithLateral3()
-
testIllegalCursors
public void testIllegalCursors()
-
testExplain
public void testExplain()
-
testExplainAsXml
public void testExplainAsXml()
-
testExplainAsJson
public void testExplainAsJson()
-
testExplainWithImpl
public void testExplainWithImpl()
-
testExplainWithoutImpl
public void testExplainWithoutImpl()
-
testExplainWithType
public void testExplainWithType()
-
testDescribeSchema
public void testDescribeSchema()
-
testDescribeTable
public void testDescribeTable()
-
testDescribeStatement
public void testDescribeStatement()
-
testSelectIsNotDdl
public void testSelectIsNotDdl()
-
testInsertSelect
public void testInsertSelect()
-
testInsertUnion
public void testInsertUnion()
-
testInsertValues
public void testInsertValues()
-
testInsertValuesDefault
public void testInsertValuesDefault()
-
testInsertValuesRawDefault
public void testInsertValuesRawDefault()
-
testInsertColumnList
public void testInsertColumnList()
-
testInsertCaseSensitiveColumnList
public void testInsertCaseSensitiveColumnList()
-
testInsertExtendedColumnList
public void testInsertExtendedColumnList()
-
testUpdateExtendedColumnList
public void testUpdateExtendedColumnList()
-
testUpdateCaseSensitiveExtendedColumnList
public void testUpdateCaseSensitiveExtendedColumnList()
-
testInsertCaseSensitiveExtendedColumnList
public void testInsertCaseSensitiveExtendedColumnList()
-
testExplainInsert
public void testExplainInsert()
-
testUpsertValues
public void testUpsertValues()
-
testUpsertSelect
public void testUpsertSelect()
-
testExplainUpsert
public void testExplainUpsert()
-
testDelete
public void testDelete()
-
testDeleteWhere
public void testDeleteWhere()
-
testUpdate
public void testUpdate()
-
testMergeSelectSource
public void testMergeSelectSource()
-
testMergeTableRefSource
public void testMergeTableRefSource()
-
testBitStringNotImplemented
public void testBitStringNotImplemented()
-
testHexAndBinaryString
public void testHexAndBinaryString()
-
testHexAndBinaryStringFails
public void testHexAndBinaryStringFails()
-
testStringLiteral
public void testStringLiteral()
-
testStringLiteralFails
public void testStringLiteralFails()
-
testStringLiteralChain
public void testStringLiteralChain()
-
testCaseExpression
public void testCaseExpression()
-
testCaseExpressionFails
public void testCaseExpressionFails()
-
testNullIf
public void testNullIf()
-
testCoalesce
public void testCoalesce()
-
testLiteralCollate
public void testLiteralCollate()
-
testCharLength
public void testCharLength()
-
testPosition
public void testPosition()
-
testReplace
public void testReplace()
-
testDateLiteral
public void testDateLiteral()
-
testTimeDate
public void testTimeDate()
-
testDateTimeCast
public void testDateTimeCast()
Tests for casting to/from date/time types.
-
testTrim
public void testTrim()
-
testConvertAndTranslate
public void testConvertAndTranslate()
-
testTranslate3
public void testTranslate3()
-
testOverlay
public void testOverlay()
-
testJdbcFunctionCall
public void testJdbcFunctionCall()
-
testWindowReference
public void testWindowReference()
-
testWindowInSubQuery
public void testWindowInSubQuery()
-
testWindowSpec
public void testWindowSpec()
-
testWindowSpecPartial
public void testWindowSpecPartial()
-
testAs
public void testAs()
-
testAsAliases
public void testAsAliases()
-
testOver
public void testOver()
-
testElementFunc
public void testElementFunc()
-
testCardinalityFunc
public void testCardinalityFunc()
-
testMemberOf
public void testMemberOf()
-
testSubMultisetrOf
public void testSubMultisetrOf()
-
testIsASet
public void testIsASet()
-
testMultiset
public void testMultiset()
-
testMultisetUnion
public void testMultisetUnion()
-
testMultisetExcept
public void testMultisetExcept()
-
testMultisetIntersect
public void testMultisetIntersect()
-
testMultisetMixed
public void testMultisetMixed()
-
testMapItem
public void testMapItem()
-
testMapItemPrecedence
public void testMapItemPrecedence()
-
testArrayElement
public void testArrayElement()
-
testArrayElementWithDot
public void testArrayElementWithDot()
-
testArrayValueConstructor
public void testArrayValueConstructor()
-
testMapValueConstructor
public void testMapValueConstructor()
-
subTestIntervalYearPositive
public void subTestIntervalYearPositive()
Runs tests for INTERVAL... YEAR that should pass both parser and validator. A substantially identical set of tests exists in SqlValidatorTest, and any changes here should be synchronized there. Similarly, any changes to tests here should be echoed appropriately to each of the other 12 subTestIntervalXXXPositive() tests.
-
subTestIntervalYearToMonthPositive
public void subTestIntervalYearToMonthPositive()
Runs tests for INTERVAL... YEAR TO MONTH that should pass both parser and validator. A substantially identical set of tests exists in SqlValidatorTest, and any changes here should be synchronized there. Similarly, any changes to tests here should be echoed appropriately to each of the other 12 subTestIntervalXXXPositive() tests.
-
subTestIntervalMonthPositive
public void subTestIntervalMonthPositive()
Runs tests for INTERVAL... MONTH that should pass both parser and validator. A substantially identical set of tests exists in SqlValidatorTest, and any changes here should be synchronized there. Similarly, any changes to tests here should be echoed appropriately to each of the other 12 subTestIntervalXXXPositive() tests.
-
subTestIntervalDayPositive
public void subTestIntervalDayPositive()
Runs tests for INTERVAL... DAY that should pass both parser and validator. A substantially identical set of tests exists in SqlValidatorTest, and any changes here should be synchronized there. Similarly, any changes to tests here should be echoed appropriately to each of the other 12 subTestIntervalXXXPositive() tests.
-
subTestIntervalDayToHourPositive
public void subTestIntervalDayToHourPositive()
Runs tests for INTERVAL... DAY TO HOUR that should pass both parser and validator. A substantially identical set of tests exists in SqlValidatorTest, and any changes here should be synchronized there. Similarly, any changes to tests here should be echoed appropriately to each of the other 12 subTestIntervalXXXPositive() tests.
-
subTestIntervalDayToMinutePositive
public void subTestIntervalDayToMinutePositive()
Runs tests for INTERVAL... DAY TO MINUTE that should pass both parser and validator. A substantially identical set of tests exists in SqlValidatorTest, and any changes here should be synchronized there. Similarly, any changes to tests here should be echoed appropriately to each of the other 12 subTestIntervalXXXPositive() tests.
-
subTestIntervalDayToSecondPositive
public void subTestIntervalDayToSecondPositive()
Runs tests for INTERVAL... DAY TO SECOND that should pass both parser and validator. A substantially identical set of tests exists in SqlValidatorTest, and any changes here should be synchronized there. Similarly, any changes to tests here should be echoed appropriately to each of the other 12 subTestIntervalXXXPositive() tests.
-
subTestIntervalHourPositive
public void subTestIntervalHourPositive()
Runs tests for INTERVAL... HOUR that should pass both parser and validator. A substantially identical set of tests exists in SqlValidatorTest, and any changes here should be synchronized there. Similarly, any changes to tests here should be echoed appropriately to each of the other 12 subTestIntervalXXXPositive() tests.
-
subTestIntervalHourToMinutePositive
public void subTestIntervalHourToMinutePositive()
Runs tests for INTERVAL... HOUR TO MINUTE that should pass both parser and validator. A substantially identical set of tests exists in SqlValidatorTest, and any changes here should be synchronized there. Similarly, any changes to tests here should be echoed appropriately to each of the other 12 subTestIntervalXXXPositive() tests.
-
subTestIntervalHourToSecondPositive
public void subTestIntervalHourToSecondPositive()
Runs tests for INTERVAL... HOUR TO SECOND that should pass both parser and validator. A substantially identical set of tests exists in SqlValidatorTest, and any changes here should be synchronized there. Similarly, any changes to tests here should be echoed appropriately to each of the other 12 subTestIntervalXXXPositive() tests.
-
subTestIntervalMinutePositive
public void subTestIntervalMinutePositive()
Runs tests for INTERVAL... MINUTE that should pass both parser and validator. A substantially identical set of tests exists in SqlValidatorTest, and any changes here should be synchronized there. Similarly, any changes to tests here should be echoed appropriately to each of the other 12 subTestIntervalXXXPositive() tests.
-
subTestIntervalMinuteToSecondPositive
public void subTestIntervalMinuteToSecondPositive()
Runs tests for INTERVAL... MINUTE TO SECOND that should pass both parser and validator. A substantially identical set of tests exists in SqlValidatorTest, and any changes here should be synchronized there. Similarly, any changes to tests here should be echoed appropriately to each of the other 12 subTestIntervalXXXPositive() tests.
-
subTestIntervalSecondPositive
public void subTestIntervalSecondPositive()
Runs tests for INTERVAL... SECOND that should pass both parser and validator. A substantially identical set of tests exists in SqlValidatorTest, and any changes here should be synchronized there. Similarly, any changes to tests here should be echoed appropriately to each of the other 12 subTestIntervalXXXPositive() tests.
-
subTestIntervalYearFailsValidation
public void subTestIntervalYearFailsValidation()
Runs tests for INTERVAL... YEAR that should pass parser but fail validator. A substantially identical set of tests exists in SqlValidatorTest, and any changes here should be synchronized there. Similarly, any changes to tests here should be echoed appropriately to each of the other 12 subTestIntervalXXXFailsValidation() tests.
-
subTestIntervalYearToMonthFailsValidation
public void subTestIntervalYearToMonthFailsValidation()
Runs tests for INTERVAL... YEAR TO MONTH that should pass parser but fail validator. A substantially identical set of tests exists in SqlValidatorTest, and any changes here should be synchronized there. Similarly, any changes to tests here should be echoed appropriately to each of the other 12 subTestIntervalXXXFailsValidation() tests.
-
subTestIntervalMonthFailsValidation
public void subTestIntervalMonthFailsValidation()
Runs tests for INTERVAL... MONTH that should pass parser but fail validator. A substantially identical set of tests exists in SqlValidatorTest, and any changes here should be synchronized there. Similarly, any changes to tests here should be echoed appropriately to each of the other 12 subTestIntervalXXXFailsValidation() tests.
-
subTestIntervalDayFailsValidation
public void subTestIntervalDayFailsValidation()
Runs tests for INTERVAL... DAY that should pass parser but fail validator. A substantially identical set of tests exists in SqlValidatorTest, and any changes here should be synchronized there. Similarly, any changes to tests here should be echoed appropriately to each of the other 12 subTestIntervalXXXFailsValidation() tests.
-
subTestIntervalDayToHourFailsValidation
public void subTestIntervalDayToHourFailsValidation()
Runs tests for INTERVAL... DAY TO HOUR that should pass parser but fail validator. A substantially identical set of tests exists in SqlValidatorTest, and any changes here should be synchronized there. Similarly, any changes to tests here should be echoed appropriately to each of the other 12 subTestIntervalXXXFailsValidation() tests.
-
subTestIntervalDayToMinuteFailsValidation
public void subTestIntervalDayToMinuteFailsValidation()
Runs tests for INTERVAL... DAY TO MINUTE that should pass parser but fail validator. A substantially identical set of tests exists in SqlValidatorTest, and any changes here should be synchronized there. Similarly, any changes to tests here should be echoed appropriately to each of the other 12 subTestIntervalXXXFailsValidation() tests.
-
subTestIntervalDayToSecondFailsValidation
public void subTestIntervalDayToSecondFailsValidation()
Runs tests for INTERVAL... DAY TO SECOND that should pass parser but fail validator. A substantially identical set of tests exists in SqlValidatorTest, and any changes here should be synchronized there. Similarly, any changes to tests here should be echoed appropriately to each of the other 12 subTestIntervalXXXFailsValidation() tests.
-
subTestIntervalHourFailsValidation
public void subTestIntervalHourFailsValidation()
Runs tests for INTERVAL... HOUR that should pass parser but fail validator. A substantially identical set of tests exists in SqlValidatorTest, and any changes here should be synchronized there. Similarly, any changes to tests here should be echoed appropriately to each of the other 12 subTestIntervalXXXFailsValidation() tests.
-
subTestIntervalHourToMinuteFailsValidation
public void subTestIntervalHourToMinuteFailsValidation()
Runs tests for INTERVAL... HOUR TO MINUTE that should pass parser but fail validator. A substantially identical set of tests exists in SqlValidatorTest, and any changes here should be synchronized there. Similarly, any changes to tests here should be echoed appropriately to each of the other 12 subTestIntervalXXXFailsValidation() tests.
-
subTestIntervalHourToSecondFailsValidation
public void subTestIntervalHourToSecondFailsValidation()
Runs tests for INTERVAL... HOUR TO SECOND that should pass parser but fail validator. A substantially identical set of tests exists in SqlValidatorTest, and any changes here should be synchronized there. Similarly, any changes to tests here should be echoed appropriately to each of the other 12 subTestIntervalXXXFailsValidation() tests.
-
subTestIntervalMinuteFailsValidation
public void subTestIntervalMinuteFailsValidation()
Runs tests for INTERVAL... MINUTE that should pass parser but fail validator. A substantially identical set of tests exists in SqlValidatorTest, and any changes here should be synchronized there. Similarly, any changes to tests here should be echoed appropriately to each of the other 12 subTestIntervalXXXFailsValidation() tests.
-
subTestIntervalMinuteToSecondFailsValidation
public void subTestIntervalMinuteToSecondFailsValidation()
Runs tests for INTERVAL... MINUTE TO SECOND that should pass parser but fail validator. A substantially identical set of tests exists in SqlValidatorTest, and any changes here should be synchronized there. Similarly, any changes to tests here should be echoed appropriately to each of the other 12 subTestIntervalXXXFailsValidation() tests.
-
subTestIntervalSecondFailsValidation
public void subTestIntervalSecondFailsValidation()
Runs tests for INTERVAL... SECOND that should pass parser but fail validator. A substantially identical set of tests exists in SqlValidatorTest, and any changes here should be synchronized there. Similarly, any changes to tests here should be echoed appropriately to each of the other 12 subTestIntervalXXXFailsValidation() tests.
-
testIntervalLiterals
public void testIntervalLiterals()
Runs tests for each of the thirteen different main types of INTERVAL qualifiers (YEAR, YEAR TO MONTH, etc.) Tests in this section fall into two categories:- xxxPositive: tests that should pass parser and validator
- xxxFailsValidation: tests that should pass parser but fail validator
A substantially identical set of tests exists in SqlValidatorTest, and any changes here should be synchronized there.
-
testUnparseableIntervalQualifiers
public void testUnparseableIntervalQualifiers()
-
testMiscIntervalQualifier
public void testMiscIntervalQualifier()
-
testIntervalOperators
public void testIntervalOperators()
-
testDateMinusDate
public void testDateMinusDate()
-
testExtract
public void testExtract()
-
testGeometry
public void testGeometry()
-
testIntervalArithmetics
public void testIntervalArithmetics()
-
testIntervalCompare
public void testIntervalCompare()
-
testCastToInterval
public void testCastToInterval()
-
testCastToVarchar
public void testCastToVarchar()
-
testTimestampAddAndDiff
public void testTimestampAddAndDiff()
-
testTimestampAdd
public void testTimestampAdd()
-
testTimestampDiff
public void testTimestampDiff()
-
testUnnest
public void testUnnest()
-
testUnnestWithOrdinality
public void testUnnestWithOrdinality()
-
testParensInFrom
public void testParensInFrom()
-
testProcedureCall
public void testProcedureCall()
-
testNewSpecification
public void testNewSpecification()
-
testMultisetCast
public void testMultisetCast()
-
testAddCarets
public void testAddCarets()
-
testMetadata
public void testMetadata()
-
testNoUnintendedNewReservedKeywords
public void testNoUnintendedNewReservedKeywords()
Tests that reserved keywords are not added to the parser unintentionally. (Most keywords are non-reserved. The set of reserved words generally only changes with a new version of the SQL standard.)If the new keyword added is intended to be a reserved keyword, update the
RESERVED_KEYWORDS
list. If not, add the keyword to the non-reserved keyword list in the parser.
-
testGenerateKeyWords
public void testGenerateKeyWords() throws java.io.IOException
Generates a copy ofreference.md
with the current set of key words. Fails if the copy is different from the original.- Throws:
java.io.IOException
-
testTabStop
public void testTabStop()
-
testLongIdentifiers
public void testLongIdentifiers()
-
testQuotedFunction
public void testQuotedFunction()
Tests that you can't quote the names of builtin functions.- See Also:
SqlValidatorTest.testQuotedFunction()
-
testUnicodeLiteral
public void testUnicodeLiteral()
-
testUnicodeEscapedLiteral
public void testUnicodeEscapedLiteral()
-
testIllegalUnicodeEscape
public void testIllegalUnicodeEscape()
-
testSqlOptions
public void testSqlOptions() throws org.apache.calcite.sql.parser.SqlParseException
- Throws:
org.apache.calcite.sql.parser.SqlParseException
-
testSequence
public void testSequence()
-
testMatchRecognize1
public void testMatchRecognize1()
-
testMatchRecognize2
public void testMatchRecognize2()
-
testMatchRecognize3
public void testMatchRecognize3()
-
testMatchRecognize4
public void testMatchRecognize4()
-
testMatchRecognize5
public void testMatchRecognize5()
-
testMatchRecognize6
public void testMatchRecognize6()
-
testMatchRecognize7
public void testMatchRecognize7()
-
testMatchRecognize8
public void testMatchRecognize8()
-
testMatchRecognize9
public void testMatchRecognize9()
-
testMatchRecognize10
public void testMatchRecognize10()
-
testMatchRecognize11
public void testMatchRecognize11()
-
testMatchRecognizeDefineClause
public void testMatchRecognizeDefineClause()
-
testMatchRecognizeDefineClause2
public void testMatchRecognizeDefineClause2()
-
testMatchRecognizeDefineClause3
public void testMatchRecognizeDefineClause3()
-
testMatchRecognizeDefineClause4
public void testMatchRecognizeDefineClause4()
-
testMatchRecognizeMeasures1
public void testMatchRecognizeMeasures1()
-
testMatchRecognizeMeasures2
public void testMatchRecognizeMeasures2()
-
testMatchRecognizeMeasures3
public void testMatchRecognizeMeasures3()
-
testMatchRecognizeMeasures4
public void testMatchRecognizeMeasures4()
-
testMatchRecognizeMeasures5
public void testMatchRecognizeMeasures5()
-
testMatchRecognizeMeasures6
public void testMatchRecognizeMeasures6()
-
testMatchRecognizePatternSkip1
public void testMatchRecognizePatternSkip1()
-
testMatchRecognizePatternSkip2
public void testMatchRecognizePatternSkip2()
-
testMatchRecognizePatternSkip3
public void testMatchRecognizePatternSkip3()
-
testMatchRecognizePatternSkip4
public void testMatchRecognizePatternSkip4()
-
testMatchRecognizePatternSkip5
public void testMatchRecognizePatternSkip5()
-
testMatchRecognizeSubset1
public void testMatchRecognizeSubset1()
-
testMatchRecognizeSubset2
public void testMatchRecognizeSubset2()
-
testMatchRecognizeSubset3
public void testMatchRecognizeSubset3()
-
testMatchRecognizeRowsPerMatch1
public void testMatchRecognizeRowsPerMatch1()
-
testMatchRecognizeRowsPerMatch2
public void testMatchRecognizeRowsPerMatch2()
-
testMatchRecognizeWithin
public void testMatchRecognizeWithin()
-
testWithinGroupClause1
public void testWithinGroupClause1()
-
testWithinGroupClause2
public void testWithinGroupClause2()
-
testWithinGroupClause3
public void testWithinGroupClause3()
-
testWithinGroupClause4
public void testWithinGroupClause4()
-
testWithinGroupClause5
public void testWithinGroupClause5()
-
testJsonExists
public void testJsonExists()
-
testJsonValue
public void testJsonValue()
-
testJsonQuery
public void testJsonQuery()
-
testJsonObject
public void testJsonObject()
-
testJsonObjectAgg
public void testJsonObjectAgg()
-
testJsonArray
public void testJsonArray()
-
testJsonArrayAgg
public void testJsonArrayAgg()
-
testJsonPredicate
public void testJsonPredicate()
-
testParseWithReader
public void testParseWithReader() throws java.lang.Exception
- Throws:
java.lang.Exception
-
isNotSubclass
private boolean isNotSubclass()
-
linux
private java.lang.String linux(java.lang.String s)
-
-