Package org.apache.calcite.test
Class RelMetadataTest
- java.lang.Object
-
- org.apache.calcite.test.SqlToRelTestBase
-
- org.apache.calcite.test.RelMetadataTest
-
public class RelMetadataTest extends SqlToRelTestBase
Unit test forDefaultRelMetadataProvider
. SeeSqlToRelTestBase
class comments for details on the schema used. Note that no optimizer rules are fired on the translation of the SQL into relational algebra (e.g. join conditions in the WHERE clause will look like filters), so it's necessary to phrase the SQL carefully.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RelMetadataTest.BrokenColTypeImpl
Implementation ofRelMetadataTest.ColType
that has no fall-back forRelNode
.static interface
RelMetadataTest.ColType
Custom metadata interface.static class
RelMetadataTest.ColTypeImpl
A provider forRelMetadataTest.ColType
via reflection.private class
RelMetadataTest.DummyRelNode
Dummy rel node used for testing.private static class
RelMetadataTest.MyRelMetadataQuery
Extension toRelMetadataQuery
to supportRelMetadataTest.ColType
.static class
RelMetadataTest.PartialColTypeImpl
A provider forRelMetadataTest.ColType
via reflection.-
Nested classes/interfaces inherited from class org.apache.calcite.test.SqlToRelTestBase
SqlToRelTestBase.MockRelOptSchema, SqlToRelTestBase.Tester, SqlToRelTestBase.TesterImpl
-
-
Field Summary
Fields Modifier and Type Field Description private static double
DEFAULT_COMP_SELECTIVITY
private static double
DEFAULT_EQUAL_SELECTIVITY
private static double
DEFAULT_EQUAL_SELECTIVITY_SQUARED
private static double
DEFAULT_NOTNULL_SELECTIVITY
private static double
DEFAULT_SELECTIVITY
private static double
DEPT_SIZE
private static java.util.List<java.lang.String>
EMP_QNAME
private static double
EMP_SIZE
private static double
EPSILON
private static java.util.concurrent.locks.ReentrantLock
LOCK
Ensures that tests that use a lot of memory do not run at the same time.private static org.apache.calcite.sql.SqlOperator
NONDETERMINISTIC_OP
-
Fields inherited from class org.apache.calcite.test.SqlToRelTestBase
NL, tester
-
-
Constructor Summary
Constructors Constructor Description RelMetadataTest()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addRow(com.google.common.collect.ImmutableList.Builder<com.google.common.collect.ImmutableList<org.apache.calcite.rex.RexLiteral>> builder, org.apache.calcite.rex.RexBuilder rexBuilder, java.lang.Object... values)
private void
assertUniqueConsistent(org.apache.calcite.rel.RelNode rel)
Asserts thatRelMetadataQuery.getUniqueKeys(RelNode)
andRelMetadataQuery.areColumnsUnique(RelNode, ImmutableBitSet)
return consistent results.private void
checkAllPredicates(org.apache.calcite.plan.RelOptCluster cluster, org.apache.calcite.plan.RelOptTable empTable, org.apache.calcite.plan.RelOptTable deptTable)
private void
checkAverageRowSize(org.apache.calcite.plan.RelOptCluster cluster, org.apache.calcite.plan.RelOptTable empTable, org.apache.calcite.plan.RelOptTable deptTable)
private void
checkCollation(org.apache.calcite.plan.RelOptCluster cluster, org.apache.calcite.plan.RelOptTable empTable, org.apache.calcite.plan.RelOptTable deptTable)
private java.util.Set<org.apache.calcite.rel.metadata.RelColumnOrigin>
checkColumnOrigin(java.lang.String sql)
static void
checkColumnOrigin(org.apache.calcite.rel.metadata.RelColumnOrigin rco, java.lang.String expectedTableName, java.lang.String expectedColumnName, boolean expectedDerived)
private void
checkFilterSelectivity(java.lang.String sql, double expected)
private void
checkNoColumnOrigin(java.lang.String sql)
private void
checkNodeTypeCount(java.lang.String sql, java.util.Map<java.lang.Class<? extends org.apache.calcite.rel.RelNode>,java.lang.Integer> expected)
private void
checkPercentageOriginalRows(java.lang.String sql, double expected)
private void
checkPercentageOriginalRows(java.lang.String sql, double expected, double epsilon)
private void
checkPredicates(org.apache.calcite.plan.RelOptCluster cluster, org.apache.calcite.plan.RelOptTable empTable, org.apache.calcite.plan.RelOptTable deptTable)
private void
checkRelSelectivity(org.apache.calcite.rel.RelNode rel, double expected)
private void
checkRowCount(java.lang.String sql, double expected, double expectedMin, double expectedMax)
private void
checkSingleColumnOrigin(java.lang.String sql, java.lang.String expectedTableName, java.lang.String expectedColumnName, boolean expectedDerived)
private void
checkTwoColumnOrigin(java.lang.String sql, java.lang.String expectedTableName1, java.lang.String expectedColumnName1, java.lang.String expectedTableName2, java.lang.String expectedColumnName2, boolean expectedDerived)
java.lang.String
colType(org.apache.calcite.rel.metadata.RelMetadataQuery mq, org.apache.calcite.rel.RelNode rel, int column)
private org.apache.calcite.rel.RelNode
convertSql(java.lang.String sql)
private boolean
isUnique(java.util.Set<org.apache.calcite.util.ImmutableBitSet> uniqueKeys, org.apache.calcite.util.ImmutableBitSet key)
Returns whetherkeys
is unique, that is, whether it or a superset is inkeySets
.(package private) static <T> org.hamcrest.Matcher<java.lang.Iterable<? extends T>>
sortsAs(java.lang.String value)
Matcher that succeeds for any collection that, when converted to strings and sorted on those strings, matches the given reference string.void
testAllPredicates()
void
testAllPredicatesAggregate1()
void
testAllPredicatesAggregate2()
void
testAllPredicatesAggregate3()
void
testAllPredicatesAndTablesJoin()
void
testAllPredicatesAndTableUnion()
void
testAllPredicatesCrossJoinMultiTable()
void
testAllPredicatesUnionMultiTable()
void
testAverageRowSize()
Unit test forRelMetadataQuery.getAverageColumnSizes(org.apache.calcite.rel.RelNode)
,RelMetadataQuery.getAverageRowSize(org.apache.calcite.rel.RelNode)
.void
testBrokenCustomProvider()
void
testCollation()
Unit test forRelMdCollation.project(org.apache.calcite.rel.metadata.RelMetadataQuery, org.apache.calcite.rel.RelNode, java.util.List<? extends org.apache.calcite.rex.RexNode>)
and other helper functions for deducing collations.void
testColumnOriginsAggCountNullable()
void
testColumnOriginsAggCountStar()
void
testColumnOriginsAggKey()
void
testColumnOriginsAggReduced()
void
testColumnOriginsConstant()
void
testColumnOriginsDyadicExpression()
void
testColumnOriginsExpression()
void
testColumnOriginsFilter()
void
testColumnOriginsJoinFullOuter()
void
testColumnOriginsJoinLeft()
void
testColumnOriginsJoinOuter()
void
testColumnOriginsJoinRight()
void
testColumnOriginsSelfUnion()
void
testColumnOriginsTableOnly()
void
testColumnOriginsUnion()
void
testColumnOriginsValues()
void
testColumnUniquenessForValues()
Unit test forRelMdColumnUniqueness.areColumnsUnique(org.apache.calcite.rel.core.TableScan, org.apache.calcite.rel.metadata.RelMetadataQuery, org.apache.calcite.util.ImmutableBitSet, boolean)
applied toValues
.void
testCorrelateUniqueKeys()
void
testCustomProvider()
void
testDistinctRowCountTable()
void
testDistinctRowCountTableEmptyKey()
void
testDistributionHash()
void
testDistributionHashEmpty()
void
testDistributionSimple()
void
testDistributionSingleton()
void
testEmptyAggregateTableOrigin()
Tests callingRelMetadataQuery.getTableOrigin(org.apache.calcite.rel.RelNode)
for an aggregate with no columns.void
testExpressionLineageAggregateAggColumn()
void
testExpressionLineageAggregateGroupColumn()
void
testExpressionLineageCombineTwoColumns()
void
testExpressionLineageFilter()
void
testExpressionLineageInnerJoinLeft()
void
testExpressionLineageInnerJoinRight()
void
testExpressionLineageLeftJoinLeft()
void
testExpressionLineageMultiUnion()
void
testExpressionLineageOuterJoin()
void
testExpressionLineageRightJoinRight()
void
testExpressionLineageSelfJoin()
void
testExpressionLineageStar()
void
testExpressionLineageTwoColumns()
void
testExpressionLineageTwoColumnsSwapped()
void
testExpressionLineageUnion()
void
testExpressionLineageValues()
void
testGetPredicatesForFilter()
void
testGetPredicatesForJoin()
void
testGroupBy()
void
testGroupByEmptyHavingUniqueKeys()
void
testGroupByEmptyUniqueKeys()
void
testJoinUniqueKeys()
void
testLinear()
Unit test forRelMdUtil.linear(int, int, int, double, double)
.void
testMetadataHandlerCacheLimit()
void
testNodeTypeCountAggregate()
void
testNodeTypeCountAggregateEmptyKeyOnEmptyTable()
void
testNodeTypeCountAggregateGroupingSets()
void
testNodeTypeCountCartesian()
void
testNodeTypeCountDept()
void
testNodeTypeCountEmp()
void
testNodeTypeCountFilter()
void
testNodeTypeCountFilterAggregateEmptyKey()
void
testNodeTypeCountJoin()
void
testNodeTypeCountJoinEmptyEmpty()
void
testNodeTypeCountJoinEmptyFinite()
void
testNodeTypeCountJoinFinite()
void
testNodeTypeCountJoinFiniteEmpty()
void
testNodeTypeCountLeftJoinEmptyFinite()
void
testNodeTypeCountMinusOnFinite()
void
testNodeTypeCountRightJoinEmptyFinite()
void
testNodeTypeCountSort()
void
testNodeTypeCountSortLimit()
void
testNodeTypeCountSortLimitOffset()
void
testNodeTypeCountSortLimitOffsetOnFinite()
void
testNodeTypeCountUnion()
void
testNodeTypeCountUnionOnFinite()
void
testNodeTypeCountValues()
void
testPercentageOriginalRowsAgg()
void
testPercentageOriginalRowsJoin()
void
testPercentageOriginalRowsJoinTwoFilters()
void
testPercentageOriginalRowsOneFilter()
void
testPercentageOriginalRowsRedundantFilter()
void
testPercentageOriginalRowsTableOnly()
void
testPercentageOriginalRowsTwoFilters()
void
testPercentageOriginalRowsUnionBigFilter()
void
testPercentageOriginalRowsUnionLittleFilter()
void
testPercentageOriginalRowsUnionNoFilter()
void
testPredicates()
Unit test forRelMdPredicates.getPredicates(Join, RelMetadataQuery)
.void
testPullUpPredicatesForExprsItr()
void
testPullUpPredicatesFromAggregation()
Unit test forRelMdPredicates.getPredicates(Aggregate, RelMetadataQuery)
.void
testPullUpPredicatesOnConstant()
void
testPullUpPredicatesOnNullableConstant()
void
testRowCountAggregate()
void
testRowCountAggregateEmptyKey()
void
testRowCountAggregateEmptyKeyOnEmptyTable()
void
testRowCountAggregateGroupingSets()
void
testRowCountAggregateGroupingSetsOneEmpty()
void
testRowCountCartesian()
void
testRowCountDept()
void
testRowCountEmp()
void
testRowCountFilter()
void
testRowCountFilterAggregateEmptyKey()
void
testRowCountFilterFalse()
void
testRowCountFilterOnFinite()
void
testRowCountIntersectOnFinite()
void
testRowCountJoin()
void
testRowCountJoinEmptyEmpty()
void
testRowCountJoinEmptyFinite()
void
testRowCountJoinFinite()
void
testRowCountJoinFiniteEmpty()
void
testRowCountLeftJoinEmptyFinite()
void
testRowCountMinusOnFinite()
void
testRowCountRightJoinEmptyFinite()
void
testRowCountSort()
void
testRowCountSortHighLimit()
void
testRowCountSortHighOffset()
void
testRowCountSortHighOffsetLimit()
void
testRowCountSortLimit()
void
testRowCountSortLimit0()
void
testRowCountSortLimitOffset()
void
testRowCountSortLimitOffsetOnFinite()
void
testRowCountUnion()
void
testRowCountUnionOnFinite()
void
testRowCountValues()
void
testSelectivityAgg()
void
testSelectivityAggCached()
Checks that we can cache a metadata request that includes a null argument.void
testSelectivityAndFilter()
void
testSelectivityComparisonFilter()
void
testSelectivityIsNotNullFilter()
void
testSelectivityIsNotNullFilterOnNotNullColumn()
void
testSelectivityJoin()
void
testSelectivityOrFilter()
void
testSelectivityRedundantFilter()
void
testSelectivitySort()
void
testSelectivityUnion()
void
testTableReferencesJoinUnknownNode()
void
testTableReferencesUnionUnknownNode()
void
testUnion()
-
Methods inherited from class org.apache.calcite.test.SqlToRelTestBase
assertValid, createTester, createTester, getDiffRepos, getTesterWithDynamicTable
-
-
-
-
Field Detail
-
EPSILON
private static final double EPSILON
- See Also:
- Constant Field Values
-
DEFAULT_EQUAL_SELECTIVITY
private static final double DEFAULT_EQUAL_SELECTIVITY
- See Also:
- Constant Field Values
-
DEFAULT_EQUAL_SELECTIVITY_SQUARED
private static final double DEFAULT_EQUAL_SELECTIVITY_SQUARED
- See Also:
- Constant Field Values
-
DEFAULT_COMP_SELECTIVITY
private static final double DEFAULT_COMP_SELECTIVITY
- See Also:
- Constant Field Values
-
DEFAULT_NOTNULL_SELECTIVITY
private static final double DEFAULT_NOTNULL_SELECTIVITY
- See Also:
- Constant Field Values
-
DEFAULT_SELECTIVITY
private static final double DEFAULT_SELECTIVITY
- See Also:
- Constant Field Values
-
EMP_SIZE
private static final double EMP_SIZE
- See Also:
- Constant Field Values
-
DEPT_SIZE
private static final double DEPT_SIZE
- See Also:
- Constant Field Values
-
EMP_QNAME
private static final java.util.List<java.lang.String> EMP_QNAME
-
LOCK
private static final java.util.concurrent.locks.ReentrantLock LOCK
Ensures that tests that use a lot of memory do not run at the same time.
-
NONDETERMINISTIC_OP
private static final org.apache.calcite.sql.SqlOperator NONDETERMINISTIC_OP
-
-
Method Detail
-
convertSql
private org.apache.calcite.rel.RelNode convertSql(java.lang.String sql)
-
checkPercentageOriginalRows
private void checkPercentageOriginalRows(java.lang.String sql, double expected)
-
checkPercentageOriginalRows
private void checkPercentageOriginalRows(java.lang.String sql, double expected, double epsilon)
-
testPercentageOriginalRowsTableOnly
public void testPercentageOriginalRowsTableOnly()
-
testPercentageOriginalRowsAgg
public void testPercentageOriginalRowsAgg()
-
testPercentageOriginalRowsOneFilter
public void testPercentageOriginalRowsOneFilter()
-
testPercentageOriginalRowsTwoFilters
public void testPercentageOriginalRowsTwoFilters()
-
testPercentageOriginalRowsRedundantFilter
public void testPercentageOriginalRowsRedundantFilter()
-
testPercentageOriginalRowsJoin
public void testPercentageOriginalRowsJoin()
-
testPercentageOriginalRowsJoinTwoFilters
public void testPercentageOriginalRowsJoinTwoFilters()
-
testPercentageOriginalRowsUnionNoFilter
public void testPercentageOriginalRowsUnionNoFilter()
-
testPercentageOriginalRowsUnionLittleFilter
public void testPercentageOriginalRowsUnionLittleFilter()
-
testPercentageOriginalRowsUnionBigFilter
public void testPercentageOriginalRowsUnionBigFilter()
-
checkColumnOrigin
private java.util.Set<org.apache.calcite.rel.metadata.RelColumnOrigin> checkColumnOrigin(java.lang.String sql)
-
checkNoColumnOrigin
private void checkNoColumnOrigin(java.lang.String sql)
-
checkColumnOrigin
public static void checkColumnOrigin(org.apache.calcite.rel.metadata.RelColumnOrigin rco, java.lang.String expectedTableName, java.lang.String expectedColumnName, boolean expectedDerived)
-
checkSingleColumnOrigin
private void checkSingleColumnOrigin(java.lang.String sql, java.lang.String expectedTableName, java.lang.String expectedColumnName, boolean expectedDerived)
-
checkTwoColumnOrigin
private void checkTwoColumnOrigin(java.lang.String sql, java.lang.String expectedTableName1, java.lang.String expectedColumnName1, java.lang.String expectedTableName2, java.lang.String expectedColumnName2, boolean expectedDerived)
-
testColumnOriginsTableOnly
public void testColumnOriginsTableOnly()
-
testColumnOriginsExpression
public void testColumnOriginsExpression()
-
testColumnOriginsDyadicExpression
public void testColumnOriginsDyadicExpression()
-
testColumnOriginsConstant
public void testColumnOriginsConstant()
-
testColumnOriginsFilter
public void testColumnOriginsFilter()
-
testColumnOriginsJoinLeft
public void testColumnOriginsJoinLeft()
-
testColumnOriginsJoinRight
public void testColumnOriginsJoinRight()
-
testColumnOriginsJoinOuter
public void testColumnOriginsJoinOuter()
-
testColumnOriginsJoinFullOuter
public void testColumnOriginsJoinFullOuter()
-
testColumnOriginsAggKey
public void testColumnOriginsAggKey()
-
testColumnOriginsAggReduced
public void testColumnOriginsAggReduced()
-
testColumnOriginsAggCountNullable
public void testColumnOriginsAggCountNullable()
-
testColumnOriginsAggCountStar
public void testColumnOriginsAggCountStar()
-
testColumnOriginsValues
public void testColumnOriginsValues()
-
testColumnOriginsUnion
public void testColumnOriginsUnion()
-
testColumnOriginsSelfUnion
public void testColumnOriginsSelfUnion()
-
checkRowCount
private void checkRowCount(java.lang.String sql, double expected, double expectedMin, double expectedMax)
-
testRowCountEmp
public void testRowCountEmp()
-
testRowCountDept
public void testRowCountDept()
-
testRowCountValues
public void testRowCountValues()
-
testRowCountCartesian
public void testRowCountCartesian()
-
testRowCountJoin
public void testRowCountJoin()
-
testRowCountJoinFinite
public void testRowCountJoinFinite()
-
testRowCountJoinEmptyFinite
public void testRowCountJoinEmptyFinite()
-
testRowCountLeftJoinEmptyFinite
public void testRowCountLeftJoinEmptyFinite()
-
testRowCountRightJoinEmptyFinite
public void testRowCountRightJoinEmptyFinite()
-
testRowCountJoinFiniteEmpty
public void testRowCountJoinFiniteEmpty()
-
testRowCountJoinEmptyEmpty
public void testRowCountJoinEmptyEmpty()
-
testRowCountUnion
public void testRowCountUnion()
-
testRowCountUnionOnFinite
public void testRowCountUnionOnFinite()
-
testRowCountIntersectOnFinite
public void testRowCountIntersectOnFinite()
-
testRowCountMinusOnFinite
public void testRowCountMinusOnFinite()
-
testRowCountFilter
public void testRowCountFilter()
-
testRowCountFilterOnFinite
public void testRowCountFilterOnFinite()
-
testRowCountFilterFalse
public void testRowCountFilterFalse()
-
testRowCountSort
public void testRowCountSort()
-
testRowCountSortHighLimit
public void testRowCountSortHighLimit()
-
testRowCountSortHighOffset
public void testRowCountSortHighOffset()
-
testRowCountSortHighOffsetLimit
public void testRowCountSortHighOffsetLimit()
-
testRowCountSortLimit
public void testRowCountSortLimit()
-
testRowCountSortLimit0
public void testRowCountSortLimit0()
-
testRowCountSortLimitOffset
public void testRowCountSortLimitOffset()
-
testRowCountSortLimitOffsetOnFinite
public void testRowCountSortLimitOffsetOnFinite()
-
testRowCountAggregate
public void testRowCountAggregate()
-
testRowCountAggregateGroupingSets
public void testRowCountAggregateGroupingSets()
-
testRowCountAggregateGroupingSetsOneEmpty
public void testRowCountAggregateGroupingSetsOneEmpty()
-
testRowCountAggregateEmptyKey
public void testRowCountAggregateEmptyKey()
-
testRowCountFilterAggregateEmptyKey
public void testRowCountFilterAggregateEmptyKey()
-
testRowCountAggregateEmptyKeyOnEmptyTable
public void testRowCountAggregateEmptyKeyOnEmptyTable()
-
checkFilterSelectivity
private void checkFilterSelectivity(java.lang.String sql, double expected)
-
testSelectivityIsNotNullFilter
public void testSelectivityIsNotNullFilter()
-
testSelectivityIsNotNullFilterOnNotNullColumn
public void testSelectivityIsNotNullFilterOnNotNullColumn()
-
testSelectivityComparisonFilter
public void testSelectivityComparisonFilter()
-
testSelectivityAndFilter
public void testSelectivityAndFilter()
-
testSelectivityOrFilter
public void testSelectivityOrFilter()
-
testSelectivityJoin
public void testSelectivityJoin()
-
checkRelSelectivity
private void checkRelSelectivity(org.apache.calcite.rel.RelNode rel, double expected)
-
testSelectivityRedundantFilter
public void testSelectivityRedundantFilter()
-
testSelectivitySort
public void testSelectivitySort()
-
testSelectivityUnion
public void testSelectivityUnion()
-
testSelectivityAgg
public void testSelectivityAgg()
-
testSelectivityAggCached
public void testSelectivityAggCached()
Checks that we can cache a metadata request that includes a null argument.
-
testMetadataHandlerCacheLimit
public void testMetadataHandlerCacheLimit()
-
testDistinctRowCountTable
public void testDistinctRowCountTable()
-
testDistinctRowCountTableEmptyKey
public void testDistinctRowCountTableEmptyKey()
-
assertUniqueConsistent
private void assertUniqueConsistent(org.apache.calcite.rel.RelNode rel)
Asserts thatRelMetadataQuery.getUniqueKeys(RelNode)
andRelMetadataQuery.areColumnsUnique(RelNode, ImmutableBitSet)
return consistent results.
-
isUnique
private boolean isUnique(java.util.Set<org.apache.calcite.util.ImmutableBitSet> uniqueKeys, org.apache.calcite.util.ImmutableBitSet key)
Returns whetherkeys
is unique, that is, whether it or a superset is inkeySets
.
-
testJoinUniqueKeys
public void testJoinUniqueKeys()
-
testCorrelateUniqueKeys
public void testCorrelateUniqueKeys()
-
testGroupByEmptyUniqueKeys
public void testGroupByEmptyUniqueKeys()
-
testGroupByEmptyHavingUniqueKeys
public void testGroupByEmptyHavingUniqueKeys()
-
testGroupBy
public void testGroupBy()
-
testUnion
public void testUnion()
-
testBrokenCustomProvider
public void testBrokenCustomProvider()
-
colType
public java.lang.String colType(org.apache.calcite.rel.metadata.RelMetadataQuery mq, org.apache.calcite.rel.RelNode rel, int column)
-
testCustomProvider
public void testCustomProvider()
-
testCollation
public void testCollation()
Unit test forRelMdCollation.project(org.apache.calcite.rel.metadata.RelMetadataQuery, org.apache.calcite.rel.RelNode, java.util.List<? extends org.apache.calcite.rex.RexNode>)
and other helper functions for deducing collations.
-
checkCollation
private void checkCollation(org.apache.calcite.plan.RelOptCluster cluster, org.apache.calcite.plan.RelOptTable empTable, org.apache.calcite.plan.RelOptTable deptTable)
-
testColumnUniquenessForValues
public void testColumnUniquenessForValues()
Unit test forRelMdColumnUniqueness.areColumnsUnique(org.apache.calcite.rel.core.TableScan, org.apache.calcite.rel.metadata.RelMetadataQuery, org.apache.calcite.util.ImmutableBitSet, boolean)
applied toValues
.
-
addRow
private void addRow(com.google.common.collect.ImmutableList.Builder<com.google.common.collect.ImmutableList<org.apache.calcite.rex.RexLiteral>> builder, org.apache.calcite.rex.RexBuilder rexBuilder, java.lang.Object... values)
-
testAverageRowSize
public void testAverageRowSize()
Unit test forRelMetadataQuery.getAverageColumnSizes(org.apache.calcite.rel.RelNode)
,RelMetadataQuery.getAverageRowSize(org.apache.calcite.rel.RelNode)
.
-
checkAverageRowSize
private void checkAverageRowSize(org.apache.calcite.plan.RelOptCluster cluster, org.apache.calcite.plan.RelOptTable empTable, org.apache.calcite.plan.RelOptTable deptTable)
-
testPredicates
public void testPredicates()
Unit test forRelMdPredicates.getPredicates(Join, RelMetadataQuery)
.
-
checkPredicates
private void checkPredicates(org.apache.calcite.plan.RelOptCluster cluster, org.apache.calcite.plan.RelOptTable empTable, org.apache.calcite.plan.RelOptTable deptTable)
-
testPullUpPredicatesFromAggregation
public void testPullUpPredicatesFromAggregation()
Unit test forRelMdPredicates.getPredicates(Aggregate, RelMetadataQuery)
.
-
testPullUpPredicatesForExprsItr
public void testPullUpPredicatesForExprsItr()
Test case for [CALCITE-1960] RelMdPredicates.getPredicates is slow if there are many equivalent columns. There are much less duplicates after [CALCITE-2205]. Since this is a performance problem, the test result does not change, but takes over 15 minutes before the fix and 6 seconds after.
-
testPullUpPredicatesOnConstant
public void testPullUpPredicatesOnConstant()
-
testPullUpPredicatesOnNullableConstant
public void testPullUpPredicatesOnNullableConstant()
-
testDistributionSimple
public void testDistributionSimple()
-
testDistributionHash
public void testDistributionHash()
-
testDistributionHashEmpty
public void testDistributionHashEmpty()
-
testDistributionSingleton
public void testDistributionSingleton()
-
testLinear
public void testLinear()
Unit test forRelMdUtil.linear(int, int, int, double, double)
.
-
testExpressionLineageStar
public void testExpressionLineageStar()
-
testExpressionLineageTwoColumns
public void testExpressionLineageTwoColumns()
-
testExpressionLineageTwoColumnsSwapped
public void testExpressionLineageTwoColumnsSwapped()
-
testExpressionLineageCombineTwoColumns
public void testExpressionLineageCombineTwoColumns()
-
testExpressionLineageInnerJoinLeft
public void testExpressionLineageInnerJoinLeft()
-
testExpressionLineageInnerJoinRight
public void testExpressionLineageInnerJoinRight()
-
testExpressionLineageLeftJoinLeft
public void testExpressionLineageLeftJoinLeft()
-
testExpressionLineageRightJoinRight
public void testExpressionLineageRightJoinRight()
-
testExpressionLineageSelfJoin
public void testExpressionLineageSelfJoin()
-
testExpressionLineageOuterJoin
public void testExpressionLineageOuterJoin()
-
testExpressionLineageFilter
public void testExpressionLineageFilter()
-
testExpressionLineageAggregateGroupColumn
public void testExpressionLineageAggregateGroupColumn()
-
testExpressionLineageAggregateAggColumn
public void testExpressionLineageAggregateAggColumn()
-
testExpressionLineageUnion
public void testExpressionLineageUnion()
-
testExpressionLineageMultiUnion
public void testExpressionLineageMultiUnion()
-
testExpressionLineageValues
public void testExpressionLineageValues()
-
testAllPredicates
public void testAllPredicates()
-
checkAllPredicates
private void checkAllPredicates(org.apache.calcite.plan.RelOptCluster cluster, org.apache.calcite.plan.RelOptTable empTable, org.apache.calcite.plan.RelOptTable deptTable)
-
testAllPredicatesAggregate1
public void testAllPredicatesAggregate1()
-
testAllPredicatesAggregate2
public void testAllPredicatesAggregate2()
-
testAllPredicatesAggregate3
public void testAllPredicatesAggregate3()
-
testAllPredicatesAndTablesJoin
public void testAllPredicatesAndTablesJoin()
-
testAllPredicatesAndTableUnion
public void testAllPredicatesAndTableUnion()
-
testAllPredicatesCrossJoinMultiTable
public void testAllPredicatesCrossJoinMultiTable()
-
testTableReferencesJoinUnknownNode
public void testTableReferencesJoinUnknownNode()
-
testAllPredicatesUnionMultiTable
public void testAllPredicatesUnionMultiTable()
-
testTableReferencesUnionUnknownNode
public void testTableReferencesUnionUnknownNode()
-
checkNodeTypeCount
private void checkNodeTypeCount(java.lang.String sql, java.util.Map<java.lang.Class<? extends org.apache.calcite.rel.RelNode>,java.lang.Integer> expected)
-
testNodeTypeCountEmp
public void testNodeTypeCountEmp()
-
testNodeTypeCountDept
public void testNodeTypeCountDept()
-
testNodeTypeCountValues
public void testNodeTypeCountValues()
-
testNodeTypeCountCartesian
public void testNodeTypeCountCartesian()
-
testNodeTypeCountJoin
public void testNodeTypeCountJoin()
-
testNodeTypeCountJoinFinite
public void testNodeTypeCountJoinFinite()
-
testNodeTypeCountJoinEmptyFinite
public void testNodeTypeCountJoinEmptyFinite()
-
testNodeTypeCountLeftJoinEmptyFinite
public void testNodeTypeCountLeftJoinEmptyFinite()
-
testNodeTypeCountRightJoinEmptyFinite
public void testNodeTypeCountRightJoinEmptyFinite()
-
testNodeTypeCountJoinFiniteEmpty
public void testNodeTypeCountJoinFiniteEmpty()
-
testNodeTypeCountJoinEmptyEmpty
public void testNodeTypeCountJoinEmptyEmpty()
-
testNodeTypeCountUnion
public void testNodeTypeCountUnion()
-
testNodeTypeCountUnionOnFinite
public void testNodeTypeCountUnionOnFinite()
-
testNodeTypeCountMinusOnFinite
public void testNodeTypeCountMinusOnFinite()
-
testNodeTypeCountFilter
public void testNodeTypeCountFilter()
-
testNodeTypeCountSort
public void testNodeTypeCountSort()
-
testNodeTypeCountSortLimit
public void testNodeTypeCountSortLimit()
-
testNodeTypeCountSortLimitOffset
public void testNodeTypeCountSortLimitOffset()
-
testNodeTypeCountSortLimitOffsetOnFinite
public void testNodeTypeCountSortLimitOffsetOnFinite()
-
testNodeTypeCountAggregate
public void testNodeTypeCountAggregate()
-
testNodeTypeCountAggregateGroupingSets
public void testNodeTypeCountAggregateGroupingSets()
-
testNodeTypeCountAggregateEmptyKeyOnEmptyTable
public void testNodeTypeCountAggregateEmptyKeyOnEmptyTable()
-
testNodeTypeCountFilterAggregateEmptyKey
public void testNodeTypeCountFilterAggregateEmptyKey()
-
testEmptyAggregateTableOrigin
public void testEmptyAggregateTableOrigin()
Tests callingRelMetadataQuery.getTableOrigin(org.apache.calcite.rel.RelNode)
for an aggregate with no columns. Previously threw.
-
testGetPredicatesForJoin
public void testGetPredicatesForJoin() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testGetPredicatesForFilter
public void testGetPredicatesForFilter() throws java.lang.Exception
- Throws:
java.lang.Exception
-
sortsAs
static <T> org.hamcrest.Matcher<java.lang.Iterable<? extends T>> sortsAs(java.lang.String value)
Matcher that succeeds for any collection that, when converted to strings and sorted on those strings, matches the given reference string.Use it as an alternative to
CoreMatchers.is(T)
if items in your list might occur in any order.For example:
List<Integer> ints = Arrays.asList(2, 500, 12); assertThat(ints, sortsAs("[12, 2, 500]");
-
-