From 12e88b74279a04111c37d38c6596a35b28b4dd74 Mon Sep 17 00:00:00 2001 From: Clint Wylie Date: Thu, 9 Jan 2025 14:21:25 -0800 Subject: [PATCH] remove legacy SQL incompatible modes (#17609) * remove legacy SQL incompatible modes changes: * druid.generic.useDefaultValueForNull is no longer wired up to anything and will log.warn if set to true * druid.generic.useThreeValueLogicForNativeFilters is no longer wired up to anything and will log.warn if set to false * clean up and simplify all code and tests related to null handling configs * fixes * fix * fix IT --- .../druid/benchmark/BoundFilterBenchmark.java | 5 - .../benchmark/DataSketchesHllBenchmark.java | 5 - .../DelimitedInputFormatBenchmark.java | 5 - ...ryEncodedStringIndexSupplierBenchmark.java | 5 - .../DimensionPredicateFilterBenchmark.java | 5 - .../ExpressionAggregationBenchmark.java | 5 - .../benchmark/ExpressionFilterBenchmark.java | 2 - .../ExpressionSelectorBenchmark.java | 2 - .../ExpressionVectorSelectorBenchmark.java | 5 - .../benchmark/FilterPartitionBenchmark.java | 9 +- .../FilteredAggregatorBenchmark.java | 5 - .../benchmark/FixedHistogramAddBenchmark.java | 5 - .../benchmark/FixedHistogramBenchmark.java | 5 - .../benchmark/FrontCodedIndexedBenchmark.java | 5 - .../benchmark/GenericIndexedBenchmark.java | 5 - .../GroupByDeserializationBenchmark.java | 3 - .../GroupByTypeInterfaceBenchmark.java | 5 - .../druid/benchmark/InFilterBenchmark.java | 5 - .../IncrementalIndexRowTypeBenchmark.java | 5 - .../IndexedTableJoinCursorBenchmark.java | 5 - .../benchmark/JoinAndLookupBenchmark.java | 5 - .../druid/benchmark/LikeFilterBenchmark.java | 5 - .../druid/benchmark/MemoryBenchmark.java | 5 - .../benchmark/ProtobufParserBenchmark.java | 5 - .../SinkQuerySegmentWalkerBenchmark.java | 5 - .../benchmark/TopNTypeInterfaceBenchmark.java | 5 - .../BitmapBenchmarkWithVaryingOrder.java | 5 - .../bitmap/RangeBitmapBenchmark.java | 5 - .../bitmap/UniformBitmapBenchmark.java | 5 - .../CompressedColumnarIntsBenchmark.java | 5 - ...ressedVSizeColumnarMultiIntsBenchmark.java | 5 - .../FloatCompressionBenchmark.java | 5 - ...loatCompressionBenchmarkFileGenerator.java | 5 - .../compression/LongCompressionBenchmark.java | 5 - ...LongCompressionBenchmarkFileGenerator.java | 5 - .../compression/VSizeSerdeBenchmark.java | 5 - .../frame/FrameChannelMergerBenchmark.java | 2 - .../IncrementalIndexReadBenchmark.java | 5 - .../indexing/IndexIngestionBenchmark.java | 5 - .../indexing/IndexMergeBenchmark.java | 5 - .../indexing/IndexPersistBenchmark.java | 2 - .../OnheapIncrementalIndexBenchmark.java | 5 - .../StringDimensionIndexerBenchmark.java | 5 - ...tringDimensionIndexerProcessBenchmark.java | 5 - .../lookup/LookupExtractorBenchmark.java | 5 - .../lookup/SqlReverseLookupBenchmark.java | 5 - .../CachingClusteredClientBenchmark.java | 5 - .../benchmark/query/GroupByBenchmark.java | 5 - .../benchmark/query/InPlanningBenchmark.java | 2 - .../query/MSQWindowFunctionsBenchmark.java | 5 - .../benchmark/query/QueryBenchmarkUtil.java | 5 - .../druid/benchmark/query/ScanBenchmark.java | 5 - .../benchmark/query/SearchBenchmark.java | 5 - .../query/SerializingQueryRunner.java | 5 - .../benchmark/query/SqlBaseBenchmark.java | 2 - .../benchmark/query/SqlVsNativeBenchmark.java | 5 - .../benchmark/query/TimeseriesBenchmark.java | 5 - .../druid/benchmark/query/TopNBenchmark.java | 5 - .../timecompare/TimeCompareBenchmark.java | 2 - .../DimensionRangeShardSpecBenchmark.java | 3 - ...igDecimalAggregatorTimeseriesTestBase.java | 5 - .../ddsketch/DDSketchAggregatorTest.java | 3 +- .../DatasourceOptimizerTest.java | 5 - ...terializedViewQueryQueryToolChestTest.java | 5 - .../MaterializedViewQueryTest.java | 9 - .../MomentsSketchAggregatorTest.java | 14 +- .../movingaverage/MovingAverageQuery.java | 9 +- .../MovingAverageIterableTest.java | 11 - .../movingaverage/MovingAverageQueryTest.java | 1 - .../PostAveragerAggregatorCalculatorTest.java | 5 +- .../queryTests/missingGroupByValues.yaml | 6 +- ...ortingWithNonMovingAndMovingAvgMetric.yaml | 6 +- .../sortingWithNonMovingAvgMetric.yaml | 6 +- .../TDigestSketchAggregatorTest.java | 9 +- .../sql/TDigestSketchSqlAggregatorTest.java | 13 +- .../MapVirtualColumnDimensionSelector.java | 11 +- .../MapVirtualColumnValueSelector.java | 11 +- .../segment/MapVirtualColumnGroupByTest.java | 19 +- .../datasketches/hll/HllSketchBuildUtil.java | 3 +- .../DoubleHllSketchBuildVectorProcessor.java | 5 +- .../LongHllSketchBuildVectorProcessor.java | 5 +- .../datasketches/theta/SketchAggregator.java | 3 +- .../hll/sql/HllSketchSqlAggregatorTest.java | 34 +- .../kll/KllDoublesSketchAggregatorTest.java | 9 +- .../kll/KllFloatsSketchAggregatorTest.java | 9 +- .../DoublesSketchAggregatorTest.java | 9 +- .../sql/DoublesSketchSqlAggregatorTest.java | 54 +- .../sql/ThetaSketchSqlAggregatorTest.java | 138 +- .../ArrayOfDoublesSketchAggregationTest.java | 33 +- .../bloom/DoubleBloomFilterAggregator.java | 7 +- .../bloom/FloatBloomFilterAggregator.java | 7 +- .../bloom/LongBloomFilterAggregator.java | 7 +- .../bloom/BloomFilterAggregatorTest.java | 14 +- .../sql/BloomFilterSqlAggregatorTest.java | 38 +- .../query/filter/BloomDimFilterTest.java | 56 +- .../filter/sql/BloomDimFilterSqlTest.java | 8 +- .../ApproximateHistogramAggregator.java | 6 +- .../histogram/FixedBucketsHistogram.java | 7 +- .../histogram/FixedBucketsHistogramSerde.java | 7 +- .../ApproximateHistogramAggregationTest.java | 30 - ...roximateHistogramVectorAggregatorTest.java | 2 - .../FixedBucketsHistogramAggregationTest.java | 13 +- ...dBucketsHistogramVectorAggregatorTest.java | 7 +- ...etsHistogramQuantileSqlAggregatorTest.java | 25 +- .../sql/QuantileSqlAggregatorTest.java | 39 +- .../kafkainput/KafkaInputFormatTest.java | 5 - .../input/kinesis/KinesisInputFormatTest.java | 6 - .../kinesis/KinesisSamplerSpecTest.java | 5 - .../NamespaceLookupExtractorFactoryTest.java | 5 - .../namespace/UriExtractionNamespaceTest.java | 5 - .../cache/JdbcExtractionNamespaceTest.java | 15 +- .../druid/server/lookup/LoadingLookup.java | 24 +- .../druid/server/lookup/PollingLookup.java | 20 +- .../server/lookup/jdbc/JdbcDataFetcher.java | 7 +- .../server/lookup/LoadingLookupTest.java | 14 +- .../server/lookup/PollingLookupTest.java | 15 +- .../apache/druid/msq/exec/MSQArraysTest.java | 35 +- .../druid/msq/exec/MSQComplexGroupByTest.java | 13 +- .../druid/msq/exec/MSQDataSketchesTest.java | 8 +- .../apache/druid/msq/exec/MSQInsertTest.java | 83 +- .../apache/druid/msq/exec/MSQReplaceTest.java | 70 +- .../apache/druid/msq/exec/MSQSelectTest.java | 214 +- .../apache/druid/msq/exec/MSQWindowTest.java | 22 +- .../msq/indexing/MSQCompactionRunnerTest.java | 9 - .../SortMergeJoinFrameProcessorTest.java | 39 +- .../SqlMSQStatementResourcePostTest.java | 5 +- .../DelegateOrMinKeyCollectorTest.java | 5 - .../statistics/DistinctKeyCollectorTest.java | 5 - .../QuantilesSketchKeyCollectorTest.java | 5 - .../msq/test/CalciteSelectQueryMSQTest.java | 19 +- .../msq/test/CalciteUnionQueryMSQTest.java | 5 - .../apache/druid/msq/test/MSQTestBase.java | 3 - .../protobuf/ProtobufInputFormatTest.java | 2 - .../StandardDeviationPostAggregator.java | 5 +- .../variance/VarianceAggregator.java | 10 +- .../variance/VarianceAggregatorCollector.java | 3 +- .../variance/VarianceAggregatorFactory.java | 3 +- .../variance/VarianceBufferAggregator.java | 10 +- .../VarianceDoubleVectorAggregator.java | 6 +- .../VarianceFloatVectorAggregator.java | 6 +- .../VarianceLongVectorAggregator.java | 6 +- .../StandardDeviationPostAggregatorTest.java | 3 +- .../VarianceAggregatorFactoryTest.java | 5 +- .../variance/VarianceAggregatorTest.java | 3 +- .../VarianceDoubleVectorAggregatorTest.java | 13 +- .../VarianceFloatVectorAggregatorTest.java | 13 +- .../VarianceLongVectorAggregatorTest.java | 13 +- .../variance/VarianceTimeseriesQueryTest.java | 5 +- .../sql/VarianceSqlAggregatorTest.java | 26 +- .../apache/druid/query/sql/SleepSqlTest.java | 3 +- .../apache/druid/indexer/InputRowSerde.java | 19 +- .../druid/indexer/InputRowSerdeTest.java | 34 +- .../hadoop/DatasourceIngestionSpecTest.java | 8 - .../ParallelIndexSupervisorTaskSerdeTest.java | 5 - ...rtitionMultiPhaseParallelIndexingTest.java | 10 - .../SeekableStreamIndexTaskTestBase.java | 5 - .../SeekableStreamSamplerSpecTest.java | 5 - .../leadership/ITHighAvailabilityTest.java | 6 +- .../cluster/HighAvailability/queries/sys.json | 4 +- .../leadership/ITHighAvailabilityTest.java | 6 +- .../AbstractAuthConfigurationTest.java | 2 - .../queries/high_availability_sys.json | 4 +- .../results/auth_test_sys_schema_servers.json | 4 +- .../druid/common/config/NullHandling.java | 255 +- .../config/NullValueHandlingConfig.java | 23 +- .../java/org/apache/druid/data/input/Row.java | 3 +- .../org/apache/druid/data/input/Rows.java | 10 +- .../druid/data/input/impl/CsvInputFormat.java | 9 +- .../druid/data/input/impl/DelimitedBytes.java | 8 +- .../data/input/impl/DelimitedInputFormat.java | 3 +- .../druid/frame/field/DoubleFieldReader.java | 3 +- .../druid/frame/field/FloatFieldReader.java | 3 +- .../druid/frame/field/LongFieldReader.java | 3 +- .../frame/field/NumericArrayFieldWriter.java | 19 +- .../druid/frame/field/StringFieldReader.java | 12 +- .../frame/key/FrameComparisonWidget.java | 6 - .../columnar/DoubleFrameColumnReader.java | 5 +- .../read/columnar/FloatFrameColumnReader.java | 5 +- .../read/columnar/LongFrameColumnReader.java | 5 +- .../StringArrayFrameColumnReader.java | 4 +- .../columnar/StringFrameColumnReader.java | 4 +- .../druid/frame/write/FrameWriterUtils.java | 5 +- .../ObjectToNumberColumnValueSelector.java | 7 +- .../java/util/common/parsers/ParserUtils.java | 8 +- .../apache/druid/math/expr/ApplyFunction.java | 3 +- .../druid/math/expr/BinaryEvalOpExprBase.java | 9 +- .../math/expr/BinaryLogicalOperatorExpr.java | 58 +- .../math/expr/BinaryMathOperatorExpr.java | 3 +- .../apache/druid/math/expr/ConstantExpr.java | 4 +- .../org/apache/druid/math/expr/Evals.java | 4 +- .../org/apache/druid/math/expr/ExprEval.java | 22 +- .../ExpressionPredicateIndexSupplier.java | 27 +- .../org/apache/druid/math/expr/Function.java | 63 +- .../druid/math/expr/UnaryOperatorExpr.java | 5 +- ...ivariateFunctionVectorObjectProcessor.java | 16 +- .../expr/vector/ExprEvalObjectVector.java | 3 +- ...ngOutObjectsInFunctionVectorProcessor.java | 5 +- .../math/expr/vector/VectorProcessors.java | 173 +- .../expr/vector/VectorStringProcessors.java | 51 +- .../ExpressionLambdaAggregatorFactory.java | 3 +- .../NullableNumericAggregatorFactory.java | 11 +- .../aggregation/SingleValueAggregator.java | 11 +- .../SingleValueBufferAggregator.java | 6 +- .../aggregation/any/NilVectorAggregator.java | 7 +- .../aggregation/any/NumericAnyAggregator.java | 6 +- .../any/NumericAnyBufferAggregator.java | 6 +- .../any/NumericAnyVectorAggregator.java | 10 +- ...alityAggregatorColumnSelectorStrategy.java | 11 +- ...alityAggregatorColumnSelectorStrategy.java | 11 +- ...alityAggregatorColumnSelectorStrategy.java | 11 +- ...alityAggregatorColumnSelectorStrategy.java | 27 +- .../DoubleCardinalityVectorProcessor.java | 5 +- .../FloatCardinalityVectorProcessor.java | 5 +- .../LongCardinalityVectorProcessor.java | 5 +- ...ValueStringCardinalityVectorProcessor.java | 3 +- ...ValueStringCardinalityVectorProcessor.java | 3 +- ...tringObjectCardinalityVectorProcessor.java | 3 +- .../DoubleFirstLastVectorAggregator.java | 10 +- .../firstlast/FirstLastVectorAggregator.java | 19 - .../FloatFirstLastVectorAggregator.java | 10 +- .../LongFirstLastVectorAggregator.java | 10 +- ...ingFirstLastDimensionVectorAggregator.java | 10 +- .../StringFirstLastVectorAggregator.java | 12 - .../first/NumericFirstAggregator.java | 6 +- .../first/NumericFirstBufferAggregator.java | 5 +- .../firstlast/last/NumericLastAggregator.java | 7 +- .../last/NumericLastBufferAggregator.java | 5 +- .../mean/DoubleMeanAggregator.java | 3 +- .../mean/DoubleMeanBufferAggregator.java | 3 +- .../mean/DoubleMeanVectorAggregator.java | 26 +- .../post/ArithmeticPostAggregator.java | 4 +- .../post/DoubleGreatestPostAggregator.java | 3 +- .../post/DoubleLeastPostAggregator.java | 3 +- .../post/LongGreatestPostAggregator.java | 3 +- .../post/LongLeastPostAggregator.java | 3 +- .../dimension/ListFilteredDimensionSpec.java | 5 +- .../query/dimension/LookupDimensionSpec.java | 3 +- .../PrefixFilteredDimensionSpec.java | 8 +- .../dimension/RegexFilteredDimensionSpec.java | 8 +- .../druid/query/expression/ContainsExpr.java | 3 +- .../druid/query/expression/ExprUtils.java | 20 +- .../expression/HyperUniqueExpressions.java | 16 +- .../druid/query/expression/LikeExprMacro.java | 3 +- .../query/expression/LookupExprMacro.java | 3 +- .../expression/RegexpExtractExprMacro.java | 5 +- .../query/expression/RegexpLikeExprMacro.java | 3 +- .../expression/RegexpReplaceExprMacro.java | 13 +- .../extraction/FunctionalExtraction.java | 7 +- .../extraction/IdentityExtractionFn.java | 6 +- .../extraction/JavaScriptExtractionFn.java | 5 +- .../query/extraction/LowerExtractionFn.java | 3 +- .../query/extraction/MapLookupExtractor.java | 14 +- .../extraction/MatchingDimExtractionFn.java | 3 +- .../extraction/RegexDimExtractionFn.java | 6 +- .../SearchQuerySpecDimExtractionFn.java | 3 +- .../extraction/StringFormatExtractionFn.java | 2 +- .../query/extraction/StrlenExtractionFn.java | 5 +- .../extraction/SubstringDimExtractionFn.java | 3 +- .../query/extraction/TimeDimExtractionFn.java | 3 +- .../query/extraction/UpperExtractionFn.java | 3 +- .../apache/druid/query/filter/DimFilter.java | 3 - .../org/apache/druid/query/filter/Filter.java | 2 - .../druid/query/filter/InDimFilter.java | 47 +- .../druid/query/filter/LikeDimFilter.java | 10 +- .../druid/query/filter/NotDimFilter.java | 3 +- .../druid/query/filter/SelectorDimFilter.java | 7 +- .../druid/query/filter/TypedInFilter.java | 7 - .../druid/query/filter/ValueMatcher.java | 3 +- .../MultiValueStringVectorValueMatcher.java | 10 +- .../SingleValueStringVectorValueMatcher.java | 11 +- .../filter/vector/VectorValueMatcher.java | 6 +- .../druid/query/groupby/GroupingEngine.java | 5 +- .../epinephelinae/GroupByQueryEngine.java | 3 +- .../epinephelinae/RowBasedGrouperHelper.java | 27 +- ...ltiValueGroupByColumnSelectorStrategy.java | 5 +- ...alueStringGroupByVectorColumnSelector.java | 3 +- .../groupby/orderby/DefaultLimitSpec.java | 5 +- .../query/lookup/ImmutableLookupMap.java | 25 +- .../druid/query/lookup/LookupExtractor.java | 11 +- .../druid/query/metadata/SegmentAnalyzer.java | 9 +- .../metadata/metadata/ColumnAnalysis.java | 6 - .../apache/druid/query/search/SearchHit.java | 3 +- ...eNumericTopNColumnAggregatesProcessor.java | 4 +- .../druid/segment/AutoTypeColumnIndexer.java | 15 +- .../segment/ConstantDimensionSelector.java | 3 +- .../segment/ConstantExprEvalSelector.java | 3 +- .../druid/segment/DimensionSelector.java | 9 +- .../druid/segment/DoubleDimensionIndexer.java | 9 +- .../druid/segment/FloatDimensionIndexer.java | 9 +- .../apache/druid/segment/IndexMergerV9.java | 115 +- .../druid/segment/LongDimensionIndexer.java | 9 +- .../druid/segment/NilColumnValueSelector.java | 45 +- .../RowBasedColumnSelectorFactory.java | 31 +- .../druid/segment/StringDimensionIndexer.java | 18 +- .../segment/StringDimensionMergerV9.java | 3 +- .../column/ColumnCapabilitiesImpl.java | 4 - .../druid/segment/data/ColumnarDoubles.java | 5 +- .../druid/segment/data/ColumnarFloats.java | 5 +- .../druid/segment/data/ColumnarLongs.java | 5 +- .../data/EncodedStringDictionaryWriter.java | 3 +- .../druid/segment/data/GenericIndexed.java | 13 +- .../segment/data/GenericIndexedWriter.java | 4 - .../druid/segment/filter/BoundFilter.java | 5 +- .../segment/filter/ExpressionFilter.java | 3 +- .../druid/segment/filter/IsBooleanFilter.java | 12 +- .../druid/segment/filter/LikeFilter.java | 9 +- .../druid/segment/filter/NotFilter.java | 20 +- .../filter/PredicateValueMatcherFactory.java | 4 +- .../druid/segment/filter/SelectorFilter.java | 3 +- .../StringConstantValueMatcherFactory.java | 3 +- .../druid/segment/filter/ValueMatchers.java | 6 +- .../segment/incremental/IncrementalIndex.java | 3 +- .../segment/index/BitmapColumnIndex.java | 4 +- ...ndexedUtf8LexicographicalRangeIndexes.java | 11 +- .../index/IndexedUtf8ValueIndexes.java | 7 +- .../join/PossiblyNullColumnValueSelector.java | 12 +- .../join/lookup/LookupJoinMatcher.java | 19 +- .../segment/join/lookup/LookupJoinable.java | 4 - .../IndexedTableColumnValueSelector.java | 20 +- .../join/table/IndexedTableJoinMatcher.java | 30 +- .../join/table/IndexedTableJoinable.java | 3 +- .../nested/NestedDataColumnSerializer.java | 2 - .../nested/NestedDataColumnSerializerV4.java | 2 - .../NestedFieldColumnIndexSupplier.java | 5 +- .../segment/nested/ScalarDoubleColumn.java | 7 - .../ScalarDoubleColumnAndIndexSupplier.java | 32 +- .../segment/nested/ScalarLongColumn.java | 7 - .../ScalarLongColumnAndIndexSupplier.java | 31 +- .../nested/ScalarStringColumnSerializer.java | 2 - .../nested/ScalarStringFieldColumnWriter.java | 3 +- .../druid/segment/nested/ValueDictionary.java | 7 - .../nested/VariantColumnSerializer.java | 2 - .../SettableDoubleColumnValueSelector.java | 3 +- .../SettableFloatColumnValueSelector.java | 3 +- .../SettableLongColumnValueSelector.java | 3 +- .../serde/CombineFirstTwoEntriesIndexed.java | 196 -- .../CombineFirstTwoValuesColumnarInts.java | 48 - ...ombineFirstTwoValuesColumnarMultiInts.java | 106 - .../CombineFirstTwoValuesIndexedInts.java | 97 - .../serde/DoubleNumericColumnPartSerdeV2.java | 10 +- .../serde/FloatNumericColumnPartSerdeV2.java | 12 +- .../serde/LongNumericColumnPartSerdeV2.java | 12 +- .../NestedCommonFormatColumnPartSerde.java | 10 +- .../ReplaceFirstValueWithNullIndexed.java | 131 - .../serde/StringUtf8ColumnIndexSupplier.java | 11 +- ...ngUtf8DictionaryEncodedColumnSupplier.java | 29 +- .../segment/vector/NilVectorSelector.java | 9 +- ...ExpressionMultiValueDimensionSelector.java | 3 +- .../segment/virtual/ExpressionSelectors.java | 17 +- ...xpressionSingleValueDimensionSelector.java | 5 +- .../virtual/ListFilteredVirtualColumn.java | 9 +- .../bitmap/BitmapOperationTestBase.java | 5 - .../druid/common/config/NullHandlingTest.java | 202 -- .../druid/data/input/impl/CsvReaderTest.java | 8 - .../data/input/impl/DelimitedBytesTest.java | 7 +- .../data/input/impl/DelimitedReaderTest.java | 8 - .../data/input/impl/FastLineIteratorTest.java | 8 - .../druid/data/input/impl/RowsTest.java | 33 +- .../frame/field/DoubleFieldReaderTest.java | 32 +- .../frame/field/FloatFieldReaderTest.java | 32 +- .../frame/field/LongFieldReaderTest.java | 32 +- .../field/StringArrayFieldWriterTest.java | 3 +- .../frame/field/StringFieldReaderTest.java | 4 +- .../frame/field/StringFieldWriterTest.java | 7 +- .../druid/frame/key/RowKeyReaderTest.java | 7 +- .../druid/frame/write/FrameWriterTest.java | 71 +- .../frame/write/FrameWriterTestData.java | 25 +- .../util/common/parsers/ParserUtilsTest.java | 13 +- .../druid/math/expr/ApplyFunctionTest.java | 10 +- .../org/apache/druid/math/expr/EvalTest.java | 98 +- .../apache/druid/math/expr/FunctionTest.java | 74 +- .../druid/math/expr/VectorExprSanityTest.java | 29 +- .../vector/FallbackVectorProcessorTest.java | 7 +- ...meBasedInlineDataSourceSerializerTest.java | 6 - .../druid/query/JoinDataSourceTest.java | 2 - .../druid/query/MultiValuedDimensionTest.java | 60 +- .../druid/query/SchemaEvolutionTest.java | 19 +- .../aggregation/DoubleMaxAggregationTest.java | 2 - .../aggregation/DoubleMinAggregationTest.java | 2 - .../aggregation/FilteredAggregatorTest.java | 12 +- .../aggregation/FloatMaxAggregationTest.java | 3 - .../aggregation/FloatMinAggregationTest.java | 3 - .../aggregation/LongMaxAggregationTest.java | 2 - .../aggregation/LongMinAggregationTest.java | 2 - ...ePairLongDoubleComplexMetricSerdeTest.java | 5 - ...lePairLongFloatComplexMetricSerdeTest.java | 5 - ...blePairLongLongComplexMetricSerdeTest.java | 5 - ...ePairLongStringComplexMetricSerdeTest.java | 5 - .../SingleValueAggregationTest.java | 22 +- .../any/DoubleAnyAggregatorFactoryTest.java | 3 +- .../any/FloatAnyAggregatorFactoryTest.java | 3 +- .../any/LongAnyAggregatorFactoryTest.java | 3 +- .../any/NumericAnyVectorAggregatorTest.java | 8 +- .../CardinalityAggregatorTest.java | 167 +- .../CardinalityVectorAggregatorTest.java | 23 +- .../first/FloatFirstVectorAggregatorTest.java | 7 +- .../first/LongFirstVectorAggregatorTest.java | 5 +- .../first/StringFirstAggregationTest.java | 2 - .../StringFirstVectorAggregatorTest.java | 5 +- .../last/FloatLastVectorAggregatorTest.java | 5 +- .../last/LongLastVectorAggregatorTest.java | 8 +- .../last/StringLastAggregationTest.java | 2 - .../last/StringLastVectorAggregatorTest.java | 5 +- .../HyperUniquesAggregatorFactoryTest.java | 5 - .../mean/DoubleMeanAggregationTest.java | 7 +- .../post/ArithmeticPostAggregatorTest.java | 3 +- .../ArrayQuantileExprMacroTest.java | 15 +- .../CaseInsensitiveExprMacroTest.java | 19 +- .../expression/ContainsExprMacroTest.java | 19 +- .../druid/query/expression/ExprMacroTest.java | 14 +- .../HyperUniqueExpressionsTest.java | 7 +- .../IPv4AddressStringifyExprMacroTest.java | 6 +- .../RegexpExtractExprMacroTest.java | 11 +- .../expression/RegexpLikeExprMacroTest.java | 19 +- .../RegexpReplaceExprMacroTest.java | 31 +- .../TimestampExtractExprMacroTest.java | 5 - .../expression/TimestampShiftMacroTest.java | 7 +- .../extraction/FunctionalExtractionTest.java | 25 +- .../JavaScriptExtractionFnTest.java | 7 +- .../extraction/LowerExtractionFnTest.java | 7 +- .../MapBasedLookupExtractorTest.java | 51 +- .../MapLookupExtractionFnSerDeTest.java | 2 - .../MatchingDimExtractionFnTest.java | 3 +- .../extraction/RegexDimExtractionFnTest.java | 19 +- .../StringFormatExtractionFnTest.java | 3 +- .../extraction/StrlenExtractionFnTest.java | 3 +- .../extraction/TimeDimExtractionFnTest.java | 7 +- .../extraction/UpperExtractionFnTest.java | 7 +- .../filter/GetDimensionRangeSetTest.java | 30 +- .../druid/query/filter/InDimFilterTest.java | 46 +- .../druid/query/filter/LikeDimFilterTest.java | 7 +- .../GroupByQueryQueryToolChestTest.java | 2 - .../query/groupby/GroupByQueryRunnerTest.java | 288 +-- .../GroupByTimeseriesQueryRunnerTest.java | 5 - .../groupby/NestedDataGroupByQueryTest.java | 25 +- .../groupby/NestedGroupByArrayQueryTest.java | 13 +- .../groupby/UnnestGroupByQueryRunnerTest.java | 23 +- .../epinephelinae/BufferArrayGrouperTest.java | 15 +- .../epinephelinae/BufferHashGrouperTest.java | 26 +- .../LimitedBufferHashGrouperTest.java | 104 +- .../StreamingMergeSortedGrouperTest.java | 7 +- ...idthGroupByColumnSelectorStrategyTest.java | 13 +- .../LookupExtractionFnExpectationsTest.java | 7 +- .../query/lookup/LookupExtractionFnTest.java | 15 +- .../metadata/SegmentMetadataQueryTest.java | 51 +- .../operator/ScanOperatorFactoryTest.java | 5 - .../WindowFramedAggregateProcessorTest.java | 5 - .../rowsandcols/RowsAndColumnsTestBase.java | 5 - .../ClusteredGroupPartitionerTest.java | 5 - .../semantic/SemanticTestBase.java | 5 - .../query/scan/NestedDataScanQueryTest.java | 35 +- .../scan/ScanQueryQueryToolChestTest.java | 2 - .../druid/query/scan/ScanQueryRunnerTest.java | 7 +- .../query/search/SearchQueryRunnerTest.java | 3 +- .../NestedDataTimeseriesQueryTest.java | 3 +- .../TimeseriesQueryQueryToolChestTest.java | 8 - .../timeseries/TimeseriesQueryRunnerTest.java | 225 +- .../query/topn/NestedDataTopNQueryTest.java | 3 +- .../topn/TopNQueryQueryToolChestTest.java | 8 - .../druid/query/topn/TopNQueryRunnerTest.java | 43 +- .../union/UnionQueryQueryToolChestTest.java | 8 - .../segment/AutoTypeColumnIndexerTest.java | 120 +- .../ConstantDimensionSelectorTest.java | 3 +- .../segment/CursorFactoryProjectionTest.java | 9 +- .../org/apache/druid/segment/IndexIOTest.java | 5 - .../segment/IndexMergerNullHandlingTest.java | 21 +- .../druid/segment/IndexMergerTestBase.java | 267 +- .../NestedDataColumnIndexerV4Test.java | 105 +- .../QueryableIndexColumnCapabilitiesTest.java | 3 +- .../segment/RowBasedCursorFactoryTest.java | 15 +- .../druid/segment/SchemalessTestFullTest.java | 27 +- .../segment/SchemalessTestSimpleTest.java | 19 +- .../TestNullableDoubleColumnSelector.java | 6 +- .../TestNullableFloatColumnSelector.java | 6 +- .../TestNullableLongColumnSelector.java | 6 +- .../UnnestColumnValueSelectorCursorTest.java | 8 - .../WrappingDimensionSelectorTest.java | 55 +- .../segment/column/SchemaPayloadPlusTest.java | 6 - .../segment/column/SchemaPayloadTest.java | 6 - .../column/SegmentSchemaMappingTest.java | 5 - .../data/GenericIndexedWriterTest.java | 8 - .../segment/data/IncrementalIndexTest.java | 13 +- .../ArrayContainsElementFilterTests.java | 83 +- .../druid/segment/filter/BaseFilterTest.java | 38 +- .../druid/segment/filter/BoundFilterTest.java | 278 +-- .../filter/ColumnComparisonFilterTest.java | 76 +- .../segment/filter/EqualityFilterTests.java | 785 ++---- .../segment/filter/ExpressionFilterTest.java | 155 +- .../segment/filter/FilterPartitionTest.java | 216 +- .../druid/segment/filter/InFilterTests.java | 389 +-- .../segment/filter/JavaScriptFilterTest.java | 32 +- .../druid/segment/filter/LikeFilterTest.java | 44 +- .../druid/segment/filter/NullFilterTests.java | 239 +- .../PredicateValueMatcherFactoryTest.java | 7 +- .../segment/filter/RangeFilterTests.java | 425 ++-- .../druid/segment/filter/RegexFilterTest.java | 27 +- .../segment/filter/SearchQueryFilterTest.java | 57 +- .../segment/filter/SelectorFilterTest.java | 147 +- .../segment/generator/SegmentGenerator.java | 5 - .../IncrementalIndexCursorFactoryTest.java | 10 +- .../IncrementalIndexRowSizeTest.java | 3 +- .../BaseHashJoinSegmentCursorFactoryTest.java | 4 +- .../HashJoinSegmentCursorFactoryTest.java | 51 +- .../join/JoinConditionAnalysisTest.java | 8 - .../segment/join/JoinFilterAnalyzerTest.java | 15 +- .../druid/segment/join/JoinTestHelper.java | 7 +- .../join/JoinableFactoryWrapperTest.java | 7 +- .../PossiblyNullDimensionSelectorTest.java | 8 - .../join/lookup/LookupJoinableTest.java | 5 +- .../BroadcastSegmentIndexedTableTest.java | 7 +- .../table/FrameBasedIndexedTableTest.java | 7 +- .../table/IndexedTableJoinMatcherTest.java | 8 +- .../join/table/IndexedTableJoinableTest.java | 5 - .../join/table/RowBasedIndexedTableTest.java | 8 - .../nested/DictionaryIdLookupTest.java | 35 +- .../nested/NestedDataColumnSupplierTest.java | 8 +- .../NestedDataColumnSupplierV4Test.java | 7 +- .../ScalarDoubleColumnSupplierTest.java | 39 +- .../nested/ScalarLongColumnSupplierTest.java | 35 +- .../ScalarStringColumnSupplierTest.java | 7 +- .../CombineFirstTwoEntriesIndexedTest.java | 162 -- ...CombineFirstTwoValuesColumnarIntsTest.java | 47 - ...neFirstTwoValuesColumnarMultiIntsTest.java | 119 - .../CombineFirstTwoValuesIndexedIntsTest.java | 101 - .../serde/NullColumnPartSerdeTest.java | 13 +- .../ReplaceFirstValueWithNullIndexedTest.java | 137 - .../segment/transform/TransformerTest.java | 22 +- .../segment/vector/NilVectorSelectorTest.java | 3 +- .../virtual/ExpressionPlannerTest.java | 13 +- .../virtual/ExpressionSelectorsTest.java | 6 +- .../virtual/ExpressionVirtualColumnTest.java | 158 +- .../virtual/FallbackVirtualColumnTest.java | 5 - .../testing/InitializedNullHandlingTest.java | 2 - .../KttmNestedComponentSupplierTest.java | 51 - .../druid/client/DirectDruidClientTest.java | 2 - ...ClientCompactionTaskTransformSpecTest.java | 3 - .../dimension/LookupDimensionSpecTest.java | 3 +- .../metadata/FingerprintGeneratorTest.java | 5 - .../SegmentSchemaBackFillQueueTest.java | 5 - .../metadata/SegmentSchemaManagerTest.java | 5 - .../BatchAppenderatorDriverTest.java | 5 - .../appenderator/BatchAppenderatorTest.java | 13 +- .../StreamAppenderatorDriverTest.java | 5 - .../appenderator/StreamAppenderatorTest.java | 13 +- .../server/ClientQuerySegmentWalkerTest.java | 5 +- .../NewestSegmentFirstPolicyTest.java | 4 - .../coordination/ServerManagerTest.java | 2 - .../DataSourceCompactionConfigTest.java | 2 - ...UserCompactionTaskTransformConfigTest.java | 2 - .../coordinator/duty/CompactSegmentsTest.java | 3 - .../org/apache/druid/cli/DumpSegmentTest.java | 31 +- .../builtin/BitwiseSqlAggregator.java | 3 +- .../builtin/StringSqlAggregator.java | 3 +- .../sql/calcite/expression/DruidLiteral.java | 5 +- .../sql/calcite/expression/Expressions.java | 85 +- .../ReductionOperatorConversionHelper.java | 8 +- .../filtration/ConvertSelectorsToIns.java | 68 +- .../sql/calcite/planner/PlannerContext.java | 6 +- .../druid/sql/calcite/rule/DruidJoinRule.java | 8 +- .../calcite/rule/DruidLogicalValuesRule.java | 3 +- .../rule/FilterDecomposeConcatRule.java | 60 +- .../FilterJoinExcludePushToChildRule.java | 11 +- .../sql/calcite/rule/FlattenConcatRule.java | 3 +- .../sql/calcite/rule/ReverseLookupRule.java | 11 +- .../druid/sql/calcite/run/SqlResults.java | 5 +- .../sql/calcite/schema/SystemSchema.java | 5 +- .../sql/calcite/table/RowSignatures.java | 4 +- .../druid/quidem/DruidQuidemTestBase.java | 7 - .../EnabledOnlyInSqlCompatibleMode.java | 43 - .../sql/avatica/DruidAvaticaHandlerTest.java | 30 +- .../druid/sql/avatica/DruidStatementTest.java | 9 +- .../sql/calcite/BaseCalciteQueryTest.java | 172 +- .../sql/calcite/CalciteArraysQueryTest.java | 1180 ++++----- .../calcite/CalciteCorrelatedQueryTest.java | 5 +- .../sql/calcite/CalciteExplainQueryTest.java | 56 +- .../sql/calcite/CalciteJoinQueryTest.java | 693 ++---- .../CalciteLookupFunctionQueryTest.java | 403 +-- .../CalciteMultiValueStringQueryTest.java | 430 +--- .../calcite/CalciteNestedDataQueryTest.java | 556 +---- .../calcite/CalciteParameterQueryTest.java | 66 +- .../druid/sql/calcite/CalciteQueryTest.java | 2214 +++++------------ .../sql/calcite/CalciteScanSignatureTest.java | 4 +- .../sql/calcite/CalciteSelectQueryTest.java | 1275 +++++----- .../sql/calcite/CalciteSimpleQueryTest.java | 116 +- .../sql/calcite/CalciteSubqueryTest.java | 140 +- .../sql/calcite/CalciteUnionQueryTest.java | 6 +- .../druid/sql/calcite/DecoupledExtension.java | 12 +- .../sql/calcite/DecoupledTestConfig.java | 2 - .../druid/sql/calcite/DisableUnless.java | 58 - .../sql/calcite/DrillWindowQueryTest.java | 10 - .../expression/DruidExpressionTest.java | 3 +- .../calcite/expression/ExpressionsTest.java | 44 +- .../druid/sql/calcite/rel/DruidQueryTest.java | 6 - .../sql/calcite/rule/DruidJoinRuleTest.java | 11 +- .../rule/DruidLogicalValuesRuleTest.java | 11 +- .../rule/FilterDecomposeConcatRuleTest.java | 27 +- .../FilterJoinExcludePushToChildRuleTest.java | 4 +- .../druid/sql/calcite/run/SqlResultsTest.java | 3 +- .../sql/calcite/schema/SystemSchemaTest.java | 3 +- .../sql/calcite/util/CalciteTestBase.java | 2 - .../druid/sql/http/SqlResourceTest.java | 51 +- ...dling=sql.iq => testUnnestExtractionFn.iq} | 2 +- ...UnnestExtractionFn@NullHandling=default.iq | 81 - ...ndling=sql.iq => testUnnestWithFilters.iq} | 2 +- ...tUnnestWithFilters@NullHandling=default.iq | 92 - ....iq => testUnnestWithFiltersInnerLimit.iq} | 2 +- ...hFiltersInnerLimit@NullHandling=default.iq | 95 - ... testUnnestWithFiltersInsideAndOutside.iq} | 2 +- ...rsInsideAndOutside@NullHandling=default.iq | 112 - ...tWithFiltersWithExpressionInInnerQuery.iq} | 2 +- ...essionInInnerQuery@NullHandling=default.iq | 92 - ...ithInFiltersWithExpressionInInnerQuery.iq} | 2 +- ...essionInInnerQuery@NullHandling=default.iq | 92 - ...OrFiltersOnVariationsOfUnnestedColumns.iq} | 2 +- ...sOfUnnestedColumns@NullHandling=default.iq | 75 - ...stUnnestWithNotFiltersOnUnnestedColumn.iq} | 2 +- ...rsOnUnnestedColumn@NullHandling=default.iq | 71 - ...q => testExactTopNOnInnerJoinWithLimit.iq} | 2 +- ...InnerJoinWithLimit@NullHandling=default.iq | 115 - ...ByLookupUsingJoinOperator@all_disabled.iq} | 2 +- ...rator@all_disabled@NullHandling=default.iq | 101 - ...pByLookupUsingJoinOperator@all_enabled.iq} | 2 +- ...erator@all_enabled@NullHandling=default.iq | 101 - ...GroupByLookupUsingJoinOperator@default.iq} | 2 +- ...inOperator@default@NullHandling=default.iq | 98 - ...erator@filter-on-value-column_disabled.iq} | 2 +- ...ue-column_disabled@NullHandling=default.iq | 101 - ...gJoinOperator@filter-rewrites-disabled.iq} | 2 +- ...-rewrites-disabled@NullHandling=default.iq | 101 - ...ookupUsingJoinOperator@filter-rewrites.iq} | 2 +- ...or@filter-rewrites@NullHandling=default.iq | 101 - ...LookupUsingJoinOperator@join-to-filter.iq} | 2 +- ...tor@join-to-filter@NullHandling=default.iq | 101 - ...singJoinOperatorBackwards@all_disabled.iq} | 2 +- ...wards@all_disabled@NullHandling=default.iq | 121 - ...UsingJoinOperatorBackwards@all_enabled.iq} | 2 +- ...kwards@all_enabled@NullHandling=default.iq | 121 - ...okupUsingJoinOperatorBackwards@default.iq} | 2 +- ...rBackwards@default@NullHandling=default.iq | 118 - ...kwards@filter-on-value-column_disabled.iq} | 2 +- ...ue-column_disabled@NullHandling=default.iq | 121 - ...atorBackwards@filter-rewrites-disabled.iq} | 2 +- ...-rewrites-disabled@NullHandling=default.iq | 121 - ...gJoinOperatorBackwards@filter-rewrites.iq} | 2 +- ...ds@filter-rewrites@NullHandling=default.iq | 121 - ...ngJoinOperatorBackwards@join-to-filter.iq} | 2 +- ...rds@join-to-filter@NullHandling=default.iq | 121 - ...JoinOperatorWithNotFilter@all_disabled.iq} | 2 +- ...ilter@all_disabled@NullHandling=default.iq | 104 - ...gJoinOperatorWithNotFilter@all_enabled.iq} | 2 +- ...Filter@all_enabled@NullHandling=default.iq | 104 - ...UsingJoinOperatorWithNotFilter@default.iq} | 2 +- ...hNotFilter@default@NullHandling=default.iq | 101 - ...Filter@filter-on-value-column_disabled.iq} | 2 +- ...ue-column_disabled@NullHandling=default.iq | 104 - ...WithNotFilter@filter-rewrites-disabled.iq} | 2 +- ...-rewrites-disabled@NullHandling=default.iq | 104 - ...nOperatorWithNotFilter@filter-rewrites.iq} | 2 +- ...er@filter-rewrites@NullHandling=default.iq | 104 - ...inOperatorWithNotFilter@join-to-filter.iq} | 2 +- ...ter@join-to-filter@NullHandling=default.iq | 104 - ...terPushdownMatchesNothing@all_disabled.iq} | 2 +- ...thing@all_disabled@NullHandling=default.iq | 100 - ...lterPushdownMatchesNothing@all_enabled.iq} | 2 +- ...othing@all_enabled@NullHandling=default.iq | 100 - ...ueFilterPushdownMatchesNothing@default.iq} | 2 +- ...hesNothing@default@NullHandling=default.iq | 97 - ...othing@filter-on-value-column_disabled.iq} | 2 +- ...ue-column_disabled@NullHandling=default.iq | 100 - ...atchesNothing@filter-rewrites-disabled.iq} | 2 +- ...-rewrites-disabled@NullHandling=default.iq | 100 - ...PushdownMatchesNothing@filter-rewrites.iq} | 2 +- ...ng@filter-rewrites@NullHandling=default.iq | 100 - ...rPushdownMatchesNothing@join-to-filter.iq} | 2 +- ...ing@join-to-filter@NullHandling=default.iq | 100 - ...oinOnTwoInlineDataSources@all_disabled.iq} | 2 +- ...urces@all_disabled@NullHandling=default.iq | 163 -- ...JoinOnTwoInlineDataSources@all_enabled.iq} | 2 +- ...ources@all_enabled@NullHandling=default.iq | 163 -- ...nnerJoinOnTwoInlineDataSources@default.iq} | 2 +- ...ataSources@default@NullHandling=default.iq | 160 -- ...ources@filter-on-value-column_disabled.iq} | 2 +- ...ue-column_disabled@NullHandling=default.iq | 163 -- ...neDataSources@filter-rewrites-disabled.iq} | 2 +- ...-rewrites-disabled@NullHandling=default.iq | 163 -- ...OnTwoInlineDataSources@filter-rewrites.iq} | 2 +- ...es@filter-rewrites@NullHandling=default.iq | 163 -- ...nOnTwoInlineDataSources@join-to-filter.iq} | 2 +- ...ces@join-to-filter@NullHandling=default.iq | 163 -- ... => testInnerJoinCastLeft@all_disabled.iq} | 2 +- ...tLeft@all_disabled@NullHandling=default.iq | 90 - ...q => testInnerJoinCastLeft@all_enabled.iq} | 2 +- ...stLeft@all_enabled@NullHandling=default.iq | 90 - ...ql.iq => testInnerJoinCastLeft@default.iq} | 2 +- ...inCastLeft@default@NullHandling=default.iq | 87 - ...stLeft@filter-on-value-column_disabled.iq} | 2 +- ...ue-column_disabled@NullHandling=default.iq | 90 - ...rJoinCastLeft@filter-rewrites-disabled.iq} | 2 +- ...-rewrites-disabled@NullHandling=default.iq | 90 - ... testInnerJoinCastLeft@filter-rewrites.iq} | 2 +- ...ft@filter-rewrites@NullHandling=default.iq | 90 - ...> testInnerJoinCastLeft@join-to-filter.iq} | 2 +- ...eft@join-to-filter@NullHandling=default.iq | 90 - ...here_withLeftDirectAccess@all_disabled.iq} | 2 +- ...ccess@all_disabled@NullHandling=default.iq | 133 - ...Where_withLeftDirectAccess@all_enabled.iq} | 2 +- ...Access@all_enabled@NullHandling=default.iq | 133 - ...uterWhere_withLeftDirectAccess@default.iq} | 2 +- ...rectAccess@default@NullHandling=default.iq | 130 - ...Access@filter-on-value-column_disabled.iq} | 2 +- ...ue-column_disabled@NullHandling=default.iq | 133 - ...tDirectAccess@filter-rewrites-disabled.iq} | 2 +- ...-rewrites-disabled@NullHandling=default.iq | 133 - ...e_withLeftDirectAccess@filter-rewrites.iq} | 2 +- ...ss@filter-rewrites@NullHandling=default.iq | 133 - ...re_withLeftDirectAccess@join-to-filter.iq} | 2 +- ...ess@join-to-filter@NullHandling=default.iq | 133 - ...rces_withLeftDirectAccess@all_disabled.iq} | 2 +- ...ccess@all_disabled@NullHandling=default.iq | 133 - ...urces_withLeftDirectAccess@all_enabled.iq} | 2 +- ...Access@all_enabled@NullHandling=default.iq | 133 - ...taSources_withLeftDirectAccess@default.iq} | 2 +- ...rectAccess@default@NullHandling=default.iq | 130 - ...Access@filter-on-value-column_disabled.iq} | 2 +- ...ue-column_disabled@NullHandling=default.iq | 133 - ...tDirectAccess@filter-rewrites-disabled.iq} | 2 +- ...-rewrites-disabled@NullHandling=default.iq | 133 - ...s_withLeftDirectAccess@filter-rewrites.iq} | 2 +- ...ss@filter-rewrites@NullHandling=default.iq | 133 - ...es_withLeftDirectAccess@join-to-filter.iq} | 2 +- ...ess@join-to-filter@NullHandling=default.iq | 133 - ...ubqueryWithSelectorFilter@all_disabled.iq} | 2 +- ...ilter@all_disabled@NullHandling=default.iq | 106 - ...SubqueryWithSelectorFilter@all_enabled.iq} | 2 +- ...Filter@all_enabled@NullHandling=default.iq | 106 - ...JoinSubqueryWithSelectorFilter@default.iq} | 2 +- ...ctorFilter@default@NullHandling=default.iq | 103 - ...Filter@filter-on-value-column_disabled.iq} | 2 +- ...ue-column_disabled@NullHandling=default.iq | 106 - ...electorFilter@filter-rewrites-disabled.iq} | 2 +- ...-rewrites-disabled@NullHandling=default.iq | 106 - ...ueryWithSelectorFilter@filter-rewrites.iq} | 2 +- ...er@filter-rewrites@NullHandling=default.iq | 106 - ...queryWithSelectorFilter@join-to-filter.iq} | 2 +- ...ter@join-to-filter@NullHandling=default.iq | 106 - ...pWithFilterWithOuterLimit@all_disabled.iq} | 2 +- ...Limit@all_disabled@NullHandling=default.iq | 115 - ...upWithFilterWithOuterLimit@all_enabled.iq} | 2 +- ...rLimit@all_enabled@NullHandling=default.iq | 115 - ...LookupWithFilterWithOuterLimit@default.iq} | 2 +- ...OuterLimit@default@NullHandling=default.iq | 112 - ...rLimit@filter-on-value-column_disabled.iq} | 2 +- ...ue-column_disabled@NullHandling=default.iq | 115 - ...ithOuterLimit@filter-rewrites-disabled.iq} | 2 +- ...-rewrites-disabled@NullHandling=default.iq | 115 - ...thFilterWithOuterLimit@filter-rewrites.iq} | 2 +- ...it@filter-rewrites@NullHandling=default.iq | 115 - ...ithFilterWithOuterLimit@join-to-filter.iq} | 2 +- ...mit@join-to-filter@NullHandling=default.iq | 115 - ...hOuterLimitWithAllColumns@all_disabled.iq} | 2 +- ...lumns@all_disabled@NullHandling=default.iq | 113 - ...thOuterLimitWithAllColumns@all_enabled.iq} | 2 +- ...olumns@all_enabled@NullHandling=default.iq | 113 - ...erWithOuterLimitWithAllColumns@default.iq} | 2 +- ...AllColumns@default@NullHandling=default.iq | 110 - ...olumns@filter-on-value-column_disabled.iq} | 2 +- ...ue-column_disabled@NullHandling=default.iq | 113 - ...ithAllColumns@filter-rewrites-disabled.iq} | 2 +- ...-rewrites-disabled@NullHandling=default.iq | 113 - ...terLimitWithAllColumns@filter-rewrites.iq} | 2 +- ...ns@filter-rewrites@NullHandling=default.iq | 113 - ...uterLimitWithAllColumns@join-to-filter.iq} | 2 +- ...mns@join-to-filter@NullHandling=default.iq | 113 - ...kupWithFilterWithoutLimit@all_disabled.iq} | 2 +- ...Limit@all_disabled@NullHandling=default.iq | 111 - ...okupWithFilterWithoutLimit@all_enabled.iq} | 2 +- ...tLimit@all_enabled@NullHandling=default.iq | 111 - ...upLookupWithFilterWithoutLimit@default.iq} | 2 +- ...thoutLimit@default@NullHandling=default.iq | 108 - ...tLimit@filter-on-value-column_disabled.iq} | 2 +- ...ue-column_disabled@NullHandling=default.iq | 111 - ...rWithoutLimit@filter-rewrites-disabled.iq} | 2 +- ...-rewrites-disabled@NullHandling=default.iq | 111 - ...WithFilterWithoutLimit@filter-rewrites.iq} | 2 +- ...it@filter-rewrites@NullHandling=default.iq | 111 - ...pWithFilterWithoutLimit@join-to-filter.iq} | 2 +- ...mit@join-to-filter@NullHandling=default.iq | 111 - ...ithoutLimitWithAllColumns@all_disabled.iq} | 2 +- ...lumns@all_disabled@NullHandling=default.iq | 109 - ...WithoutLimitWithAllColumns@all_enabled.iq} | 2 +- ...olumns@all_enabled@NullHandling=default.iq | 109 - ...lterWithoutLimitWithAllColumns@default.iq} | 2 +- ...AllColumns@default@NullHandling=default.iq | 106 - ...olumns@filter-on-value-column_disabled.iq} | 2 +- ...ue-column_disabled@NullHandling=default.iq | 109 - ...ithAllColumns@filter-rewrites-disabled.iq} | 2 +- ...-rewrites-disabled@NullHandling=default.iq | 109 - ...outLimitWithAllColumns@filter-rewrites.iq} | 2 +- ...ns@filter-rewrites@NullHandling=default.iq | 109 - ...houtLimitWithAllColumns@join-to-filter.iq} | 2 +- ...mns@join-to-filter@NullHandling=default.iq | 109 - ...ndManyFiltersEmptyResults@all_disabled.iq} | 2 +- ...sults@all_disabled@NullHandling=default.iq | 275 -- ...AndManyFiltersEmptyResults@all_enabled.iq} | 2 +- ...esults@all_enabled@NullHandling=default.iq | 275 -- ...downAndManyFiltersEmptyResults@default.iq} | 2 +- ...ptyResults@default@NullHandling=default.iq | 272 -- ...esults@filter-on-value-column_disabled.iq} | 2 +- ...ue-column_disabled@NullHandling=default.iq | 275 -- ...sEmptyResults@filter-rewrites-disabled.iq} | 2 +- ...-rewrites-disabled@NullHandling=default.iq | 275 -- ...anyFiltersEmptyResults@filter-rewrites.iq} | 2 +- ...ts@filter-rewrites@NullHandling=default.iq | 275 -- ...ManyFiltersEmptyResults@join-to-filter.iq} | 2 +- ...lts@join-to-filter@NullHandling=default.iq | 275 -- ...anyFiltersNonEmptyResults@all_disabled.iq} | 2 +- ...sults@all_disabled@NullHandling=default.iq | 276 -- ...ManyFiltersNonEmptyResults@all_enabled.iq} | 2 +- ...esults@all_enabled@NullHandling=default.iq | 276 -- ...nAndManyFiltersNonEmptyResults@default.iq} | 2 +- ...ptyResults@default@NullHandling=default.iq | 273 -- ...esults@filter-on-value-column_disabled.iq} | 2 +- ...ue-column_disabled@NullHandling=default.iq | 276 -- ...nEmptyResults@filter-rewrites-disabled.iq} | 2 +- ...-rewrites-disabled@NullHandling=default.iq | 276 -- ...FiltersNonEmptyResults@filter-rewrites.iq} | 2 +- ...ts@filter-rewrites@NullHandling=default.iq | 276 -- ...yFiltersNonEmptyResults@join-to-filter.iq} | 2 +- ...lts@join-to-filter@NullHandling=default.iq | 276 -- ...InnerJoinWithIsNullFilter@all_disabled.iq} | 2 +- ...ilter@all_disabled@NullHandling=default.iq | 89 - ...tInnerJoinWithIsNullFilter@all_enabled.iq} | 2 +- ...Filter@all_enabled@NullHandling=default.iq | 89 - ... testInnerJoinWithIsNullFilter@default.iq} | 2 +- ...NullFilter@default@NullHandling=default.iq | 86 - ...Filter@filter-on-value-column_disabled.iq} | 2 +- ...ue-column_disabled@NullHandling=default.iq | 89 - ...hIsNullFilter@filter-rewrites-disabled.iq} | 2 +- ...-rewrites-disabled@NullHandling=default.iq | 89 - ...erJoinWithIsNullFilter@filter-rewrites.iq} | 2 +- ...er@filter-rewrites@NullHandling=default.iq | 89 - ...nerJoinWithIsNullFilter@join-to-filter.iq} | 2 +- ...ter@join-to-filter@NullHandling=default.iq | 89 - ...upByInsteadOfTimeseriesWithFloorOnTime.iq} | 2 +- ...iesWithFloorOnTime@NullHandling=default.iq | 155 -- ...oorOnTimeWithNoAggregateMultipleValues.iq} | 2 +- ...gateMultipleValues@NullHandling=default.iq | 155 -- ...=> testJoinOnTimeseriesWithFloorOnTime.iq} | 2 +- ...iesWithFloorOnTime@NullHandling=default.iq | 138 - ...estJoinOuterGroupByAndSubqueryHasLimit.iq} | 2 +- ...ndSubqueryHasLimit@NullHandling=default.iq | 128 - ...stJoinUnionTablesOnLookup@all_disabled.iq} | 2 +- ...ookup@all_disabled@NullHandling=default.iq | 118 - ...estJoinUnionTablesOnLookup@all_enabled.iq} | 2 +- ...Lookup@all_enabled@NullHandling=default.iq | 118 - ...=> testJoinUnionTablesOnLookup@default.iq} | 2 +- ...esOnLookup@default@NullHandling=default.iq | 115 - ...Lookup@filter-on-value-column_disabled.iq} | 2 +- ...ue-column_disabled@NullHandling=default.iq | 118 - ...ablesOnLookup@filter-rewrites-disabled.iq} | 2 +- ...-rewrites-disabled@NullHandling=default.iq | 118 - ...oinUnionTablesOnLookup@filter-rewrites.iq} | 2 +- ...up@filter-rewrites@NullHandling=default.iq | 118 - ...JoinUnionTablesOnLookup@join-to-filter.iq} | 2 +- ...kup@join-to-filter@NullHandling=default.iq | 118 - ...ql.iq => testJoinWithInputRefCondition.iq} | 2 +- ...hInputRefCondition@NullHandling=default.iq | 126 - ...here_withLeftDirectAccess@all_disabled.iq} | 2 +- ...ccess@all_disabled@NullHandling=default.iq | 133 - ...Where_withLeftDirectAccess@all_enabled.iq} | 2 +- ...Access@all_enabled@NullHandling=default.iq | 133 - ...uterWhere_withLeftDirectAccess@default.iq} | 2 +- ...rectAccess@default@NullHandling=default.iq | 130 - ...Access@filter-on-value-column_disabled.iq} | 2 +- ...ue-column_disabled@NullHandling=default.iq | 133 - ...tDirectAccess@filter-rewrites-disabled.iq} | 2 +- ...-rewrites-disabled@NullHandling=default.iq | 133 - ...e_withLeftDirectAccess@filter-rewrites.iq} | 2 +- ...ss@filter-rewrites@NullHandling=default.iq | 133 - ...re_withLeftDirectAccess@join-to-filter.iq} | 2 +- ...ess@join-to-filter@NullHandling=default.iq | 133 - ...lter_withLeftDirectAccess@all_disabled.iq} | 2 +- ...ccess@all_disabled@NullHandling=default.iq | 139 -- ...ilter_withLeftDirectAccess@all_enabled.iq} | 2 +- ...Access@all_enabled@NullHandling=default.iq | 139 -- ...imeFilter_withLeftDirectAccess@default.iq} | 2 +- ...rectAccess@default@NullHandling=default.iq | 136 - ...Access@filter-on-value-column_disabled.iq} | 2 +- ...ue-column_disabled@NullHandling=default.iq | 139 -- ...tDirectAccess@filter-rewrites-disabled.iq} | 2 +- ...-rewrites-disabled@NullHandling=default.iq | 139 -- ...r_withLeftDirectAccess@filter-rewrites.iq} | 2 +- ...ss@filter-rewrites@NullHandling=default.iq | 139 -- ...er_withLeftDirectAccess@join-to-filter.iq} | 2 +- ...ess@join-to-filter@NullHandling=default.iq | 139 -- ...rces_withLeftDirectAccess@all_disabled.iq} | 2 +- ...ccess@all_disabled@NullHandling=default.iq | 133 - ...urces_withLeftDirectAccess@all_enabled.iq} | 2 +- ...Access@all_enabled@NullHandling=default.iq | 133 - ...taSources_withLeftDirectAccess@default.iq} | 2 +- ...rectAccess@default@NullHandling=default.iq | 130 - ...Access@filter-on-value-column_disabled.iq} | 2 +- ...ue-column_disabled@NullHandling=default.iq | 133 - ...tDirectAccess@filter-rewrites-disabled.iq} | 2 +- ...-rewrites-disabled@NullHandling=default.iq | 133 - ...s_withLeftDirectAccess@filter-rewrites.iq} | 2 +- ...ss@filter-rewrites@NullHandling=default.iq | 133 - ...es_withLeftDirectAccess@join-to-filter.iq} | 2 +- ...ess@join-to-filter@NullHandling=default.iq | 133 - ...ubqueryWithSelectorFilter@all_disabled.iq} | 2 +- ...ilter@all_disabled@NullHandling=default.iq | 111 - ...SubqueryWithSelectorFilter@all_enabled.iq} | 2 +- ...Filter@all_enabled@NullHandling=default.iq | 111 - ...JoinSubqueryWithSelectorFilter@default.iq} | 2 +- ...ctorFilter@default@NullHandling=default.iq | 108 - ...Filter@filter-on-value-column_disabled.iq} | 2 +- ...ue-column_disabled@NullHandling=default.iq | 111 - ...electorFilter@filter-rewrites-disabled.iq} | 2 +- ...-rewrites-disabled@NullHandling=default.iq | 111 - ...ueryWithSelectorFilter@filter-rewrites.iq} | 2 +- ...er@filter-rewrites@NullHandling=default.iq | 111 - ...queryWithSelectorFilter@join-to-filter.iq} | 2 +- ...ter@join-to-filter@NullHandling=default.iq | 111 - ...InnerJoinOnManyManyLookup@all_disabled.iq} | 2 +- ...ookup@all_disabled@NullHandling=default.iq | 400 --- ...yInnerJoinOnManyManyLookup@all_enabled.iq} | 2 +- ...Lookup@all_enabled@NullHandling=default.iq | 400 --- ...yManyInnerJoinOnManyManyLookup@default.iq} | 2 +- ...ManyLookup@default@NullHandling=default.iq | 397 --- ...Lookup@filter-on-value-column_disabled.iq} | 2 +- ...ue-column_disabled@NullHandling=default.iq | 400 --- ...anyManyLookup@filter-rewrites-disabled.iq} | 2 +- ...-rewrites-disabled@NullHandling=default.iq | 400 --- ...erJoinOnManyManyLookup@filter-rewrites.iq} | 2 +- ...up@filter-rewrites@NullHandling=default.iq | 400 --- ...nerJoinOnManyManyLookup@join-to-filter.iq} | 2 +- ...kup@join-to-filter@NullHandling=default.iq | 400 --- ...nlineDataSourceWithFilter@all_disabled.iq} | 2 +- ...ilter@all_disabled@NullHandling=default.iq | 159 -- ...InlineDataSourceWithFilter@all_enabled.iq} | 2 +- ...Filter@all_enabled@NullHandling=default.iq | 159 -- ...ByOnInlineDataSourceWithFilter@default.iq} | 2 +- ...WithFilter@default@NullHandling=default.iq | 156 -- ...Filter@filter-on-value-column_disabled.iq} | 2 +- ...ue-column_disabled@NullHandling=default.iq | 159 -- ...rceWithFilter@filter-rewrites-disabled.iq} | 2 +- ...-rewrites-disabled@NullHandling=default.iq | 159 -- ...neDataSourceWithFilter@filter-rewrites.iq} | 2 +- ...er@filter-rewrites@NullHandling=default.iq | 159 -- ...ineDataSourceWithFilter@join-to-filter.iq} | 2 +- ...ter@join-to-filter@NullHandling=default.iq | 159 -- ...kupUsingRightJoinOperator@all_disabled.iq} | 2 +- ...rator@all_disabled@NullHandling=default.iq | 102 - ...okupUsingRightJoinOperator@all_enabled.iq} | 2 +- ...erator@all_enabled@NullHandling=default.iq | 102 - ...OnLookupUsingRightJoinOperator@default.iq} | 2 +- ...inOperator@default@NullHandling=default.iq | 99 - ...erator@filter-on-value-column_disabled.iq} | 2 +- ...ue-column_disabled@NullHandling=default.iq | 102 - ...tJoinOperator@filter-rewrites-disabled.iq} | 2 +- ...-rewrites-disabled@NullHandling=default.iq | 102 - ...UsingRightJoinOperator@filter-rewrites.iq} | 2 +- ...or@filter-rewrites@NullHandling=default.iq | 102 - ...pUsingRightJoinOperator@join-to-filter.iq} | 2 +- ...tor@join-to-filter@NullHandling=default.iq | 102 - ...neouslyUsingExplicitJoins@all_disabled.iq} | 2 +- ...Joins@all_disabled@NullHandling=default.iq | 157 -- ...aneouslyUsingExplicitJoins@all_enabled.iq} | 2 +- ...tJoins@all_enabled@NullHandling=default.iq | 157 -- ...multaneouslyUsingExplicitJoins@default.iq} | 2 +- ...licitJoins@default@NullHandling=default.iq | 154 -- ...tJoins@filter-on-value-column_disabled.iq} | 2 +- ...ue-column_disabled@NullHandling=default.iq | 157 -- ...ExplicitJoins@filter-rewrites-disabled.iq} | 2 +- ...-rewrites-disabled@NullHandling=default.iq | 157 -- ...uslyUsingExplicitJoins@filter-rewrites.iq} | 2 +- ...ns@filter-rewrites@NullHandling=default.iq | 157 -- ...ouslyUsingExplicitJoins@join-to-filter.iq} | 2 +- ...ins@join-to-filter@NullHandling=default.iq | 157 -- ...ouslyUsingWhereInSubquery@all_disabled.iq} | 2 +- ...query@all_disabled@NullHandling=default.iq | 237 -- ...eouslyUsingWhereInSubquery@all_enabled.iq} | 2 +- ...bquery@all_enabled@NullHandling=default.iq | 237 -- ...ltaneouslyUsingWhereInSubquery@default.iq} | 2 +- ...InSubquery@default@NullHandling=default.iq | 234 -- ...bquery@filter-on-value-column_disabled.iq} | 2 +- ...ue-column_disabled@NullHandling=default.iq | 237 -- ...ereInSubquery@filter-rewrites-disabled.iq} | 2 +- ...-rewrites-disabled@NullHandling=default.iq | 237 -- ...lyUsingWhereInSubquery@filter-rewrites.iq} | 2 +- ...ry@filter-rewrites@NullHandling=default.iq | 237 -- ...slyUsingWhereInSubquery@join-to-filter.iq} | 2 +- ...ery@join-to-filter@NullHandling=default.iq | 237 -- ...thOuterTimeExtractAggregateWithOrderBy.iq} | 2 +- ...gregateWithOrderBy@NullHandling=default.iq | 154 -- ...> testSemiJoinWithOuterTimeExtractScan.iq} | 2 +- ...terTimeExtractScan@NullHandling=default.iq | 131 - ...woSemiJoinsSimultaneously@all_disabled.iq} | 2 +- ...ously@all_disabled@NullHandling=default.iq | 165 -- ...TwoSemiJoinsSimultaneously@all_enabled.iq} | 2 +- ...eously@all_enabled@NullHandling=default.iq | 165 -- ...testTwoSemiJoinsSimultaneously@default.iq} | 2 +- ...ltaneously@default@NullHandling=default.iq | 162 -- ...eously@filter-on-value-column_disabled.iq} | 2 +- ...ue-column_disabled@NullHandling=default.iq | 165 -- ...imultaneously@filter-rewrites-disabled.iq} | 2 +- ...-rewrites-disabled@NullHandling=default.iq | 165 -- ...emiJoinsSimultaneously@filter-rewrites.iq} | 2 +- ...ly@filter-rewrites@NullHandling=default.iq | 165 -- ...SemiJoinsSimultaneously@join-to-filter.iq} | 2 +- ...sly@join-to-filter@NullHandling=default.iq | 165 -- ...SubqueryAsPartOfAndFilter@all_disabled.iq} | 2 +- ...ilter@all_disabled@NullHandling=default.iq | 152 -- ...gSubqueryAsPartOfAndFilter@all_enabled.iq} | 2 +- ...Filter@all_enabled@NullHandling=default.iq | 152 -- ...UsingSubqueryAsPartOfAndFilter@default.iq} | 2 +- ...fAndFilter@default@NullHandling=default.iq | 149 -- ...Filter@filter-on-value-column_disabled.iq} | 2 +- ...ue-column_disabled@NullHandling=default.iq | 152 -- ...rtOfAndFilter@filter-rewrites-disabled.iq} | 2 +- ...-rewrites-disabled@NullHandling=default.iq | 152 -- ...queryAsPartOfAndFilter@filter-rewrites.iq} | 2 +- ...er@filter-rewrites@NullHandling=default.iq | 152 -- ...bqueryAsPartOfAndFilter@join-to-filter.iq} | 2 +- ...ter@join-to-filter@NullHandling=default.iq | 152 -- ...SubqueryWithExtractionFns@all_disabled.iq} | 2 +- ...onFns@all_disabled@NullHandling=default.iq | 139 -- ...gSubqueryWithExtractionFns@all_enabled.iq} | 2 +- ...ionFns@all_enabled@NullHandling=default.iq | 139 -- ...UsingSubqueryWithExtractionFns@default.iq} | 2 +- ...ractionFns@default@NullHandling=default.iq | 136 - ...ionFns@filter-on-value-column_disabled.iq} | 2 +- ...ue-column_disabled@NullHandling=default.iq | 139 -- ...ExtractionFns@filter-rewrites-disabled.iq} | 2 +- ...-rewrites-disabled@NullHandling=default.iq | 139 -- ...queryWithExtractionFns@filter-rewrites.iq} | 2 +- ...ns@filter-rewrites@NullHandling=default.iq | 139 -- ...bqueryWithExtractionFns@join-to-filter.iq} | 2 +- ...Fns@join-to-filter@NullHandling=default.iq | 139 -- ...istinctWithGroupingAndOtherAggregators.iq} | 2 +- ...ndOtherAggregators@NullHandling=default.iq | 108 - ... => testGroupByLimitPushdownExtraction.iq} | 2 +- ...PushdownExtraction@NullHandling=default.iq | 84 - ...imeFloorAndDimOnGroupByTimeFloorAndDim.iq} | 2 +- ...pByTimeFloorAndDim@NullHandling=default.iq | 147 -- ...thGroupingAndOtherAggregatorsUsingJoin.iq} | 2 +- ...gregatorsUsingJoin@NullHandling=default.iq | 231 -- ...> testSubqueryTypeMismatchWithLiterals.iq} | 2 +- ...smatchWithLiterals@NullHandling=default.iq | 110 - ...ing=sql.iq => testTimeFilterOnSubquery.iq} | 2 +- ...meFilterOnSubquery@NullHandling=default.iq | 92 - ...sql.iq => testWindowingWithScanAndSort.iq} | 2 +- ...ingWithScanAndSort@NullHandling=default.iq | 190 -- 1053 files changed, 5487 insertions(+), 47702 deletions(-) delete mode 100644 processing/src/main/java/org/apache/druid/segment/serde/CombineFirstTwoEntriesIndexed.java delete mode 100644 processing/src/main/java/org/apache/druid/segment/serde/CombineFirstTwoValuesColumnarInts.java delete mode 100644 processing/src/main/java/org/apache/druid/segment/serde/CombineFirstTwoValuesColumnarMultiInts.java delete mode 100644 processing/src/main/java/org/apache/druid/segment/serde/CombineFirstTwoValuesIndexedInts.java delete mode 100644 processing/src/main/java/org/apache/druid/segment/serde/ReplaceFirstValueWithNullIndexed.java delete mode 100644 processing/src/test/java/org/apache/druid/common/config/NullHandlingTest.java delete mode 100644 processing/src/test/java/org/apache/druid/segment/serde/CombineFirstTwoEntriesIndexedTest.java delete mode 100644 processing/src/test/java/org/apache/druid/segment/serde/CombineFirstTwoValuesColumnarIntsTest.java delete mode 100644 processing/src/test/java/org/apache/druid/segment/serde/CombineFirstTwoValuesColumnarMultiIntsTest.java delete mode 100644 processing/src/test/java/org/apache/druid/segment/serde/CombineFirstTwoValuesIndexedIntsTest.java delete mode 100644 processing/src/test/java/org/apache/druid/segment/serde/ReplaceFirstValueWithNullIndexedTest.java delete mode 100644 quidem-ut/src/test/java/org/apache/druid/quidem/KttmNestedComponentSupplierTest.java delete mode 100644 sql/src/test/java/org/apache/druid/quidem/EnabledOnlyInSqlCompatibleMode.java delete mode 100644 sql/src/test/java/org/apache/druid/sql/calcite/DisableUnless.java rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/{testUnnestExtractionFn@NullHandling=sql.iq => testUnnestExtractionFn.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/{testUnnestWithFilters@NullHandling=sql.iq => testUnnestWithFilters.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/{testUnnestWithFiltersInnerLimit@NullHandling=sql.iq => testUnnestWithFiltersInnerLimit.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInnerLimit@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/{testUnnestWithFiltersInsideAndOutside@NullHandling=sql.iq => testUnnestWithFiltersInsideAndOutside.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/{testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=sql.iq => testUnnestWithFiltersWithExpressionInInnerQuery.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/{testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=sql.iq => testUnnestWithInFiltersWithExpressionInInnerQuery.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/{testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=sql.iq => testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns.iq} (95%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/{testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=sql.iq => testUnnestWithNotFiltersOnUnnestedColumn.iq} (96%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testExactTopNOnInnerJoinWithLimit@NullHandling=sql.iq => testExactTopNOnInnerJoinWithLimit.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testFilterAndGroupByLookupUsingJoinOperator@all_disabled@NullHandling=sql.iq => testFilterAndGroupByLookupUsingJoinOperator@all_disabled.iq} (96%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@all_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testFilterAndGroupByLookupUsingJoinOperator@all_enabled@NullHandling=sql.iq => testFilterAndGroupByLookupUsingJoinOperator@all_enabled.iq} (96%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@all_enabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testFilterAndGroupByLookupUsingJoinOperator@default@NullHandling=sql.iq => testFilterAndGroupByLookupUsingJoinOperator@default.iq} (96%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@default@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testFilterAndGroupByLookupUsingJoinOperator@filter-on-value-column_disabled@NullHandling=sql.iq => testFilterAndGroupByLookupUsingJoinOperator@filter-on-value-column_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@filter-on-value-column_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testFilterAndGroupByLookupUsingJoinOperator@filter-rewrites-disabled@NullHandling=sql.iq => testFilterAndGroupByLookupUsingJoinOperator@filter-rewrites-disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@filter-rewrites-disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testFilterAndGroupByLookupUsingJoinOperator@filter-rewrites@NullHandling=sql.iq => testFilterAndGroupByLookupUsingJoinOperator@filter-rewrites.iq} (96%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@filter-rewrites@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testFilterAndGroupByLookupUsingJoinOperator@join-to-filter@NullHandling=sql.iq => testFilterAndGroupByLookupUsingJoinOperator@join-to-filter.iq} (96%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@join-to-filter@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testFilterAndGroupByLookupUsingJoinOperatorBackwards@all_disabled@NullHandling=sql.iq => testFilterAndGroupByLookupUsingJoinOperatorBackwards@all_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@all_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testFilterAndGroupByLookupUsingJoinOperatorBackwards@all_enabled@NullHandling=sql.iq => testFilterAndGroupByLookupUsingJoinOperatorBackwards@all_enabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@all_enabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testFilterAndGroupByLookupUsingJoinOperatorBackwards@default@NullHandling=sql.iq => testFilterAndGroupByLookupUsingJoinOperatorBackwards@default.iq} (96%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@default@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-on-value-column_disabled@NullHandling=sql.iq => testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-on-value-column_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-on-value-column_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-rewrites-disabled@NullHandling=sql.iq => testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-rewrites-disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-rewrites-disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-rewrites@NullHandling=sql.iq => testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-rewrites.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-rewrites@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testFilterAndGroupByLookupUsingJoinOperatorBackwards@join-to-filter@NullHandling=sql.iq => testFilterAndGroupByLookupUsingJoinOperatorBackwards@join-to-filter.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@join-to-filter@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@all_disabled@NullHandling=sql.iq => testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@all_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@all_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@all_enabled@NullHandling=sql.iq => testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@all_enabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@all_enabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@default@NullHandling=sql.iq => testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@default.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@default@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-on-value-column_disabled@NullHandling=sql.iq => testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-on-value-column_disabled.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-on-value-column_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-rewrites-disabled@NullHandling=sql.iq => testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-rewrites-disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-rewrites-disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-rewrites@NullHandling=sql.iq => testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-rewrites.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-rewrites@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@join-to-filter@NullHandling=sql.iq => testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@join-to-filter.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@join-to-filter@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@all_disabled@NullHandling=sql.iq => testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@all_disabled.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@all_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@all_enabled@NullHandling=sql.iq => testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@all_enabled.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@all_enabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@default@NullHandling=sql.iq => testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@default.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@default@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-on-value-column_disabled@NullHandling=sql.iq => testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-on-value-column_disabled.iq} (96%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-on-value-column_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-rewrites-disabled@NullHandling=sql.iq => testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-rewrites-disabled.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-rewrites-disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-rewrites@NullHandling=sql.iq => testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-rewrites.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-rewrites@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@join-to-filter@NullHandling=sql.iq => testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@join-to-filter.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@join-to-filter@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled@NullHandling=sql.iq => testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled@NullHandling=sql.iq => testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default@NullHandling=sql.iq => testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled@NullHandling=sql.iq => testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled@NullHandling=sql.iq => testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites@NullHandling=sql.iq => testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter@NullHandling=sql.iq => testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinCastLeft@all_disabled@NullHandling=sql.iq => testInnerJoinCastLeft@all_disabled.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinCastLeft@all_enabled@NullHandling=sql.iq => testInnerJoinCastLeft@all_enabled.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_enabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinCastLeft@default@NullHandling=sql.iq => testInnerJoinCastLeft@default.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@default@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinCastLeft@filter-on-value-column_disabled@NullHandling=sql.iq => testInnerJoinCastLeft@filter-on-value-column_disabled.iq} (96%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-on-value-column_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinCastLeft@filter-rewrites-disabled@NullHandling=sql.iq => testInnerJoinCastLeft@filter-rewrites-disabled.iq} (96%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites-disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinCastLeft@filter-rewrites@NullHandling=sql.iq => testInnerJoinCastLeft@filter-rewrites.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinCastLeft@join-to-filter@NullHandling=sql.iq => testInnerJoinCastLeft@join-to-filter.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@join-to-filter@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=sql.iq => testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=sql.iq => testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=sql.iq => testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq => testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq => testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq => testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq => testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=sql.iq => testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=sql.iq => testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=sql.iq => testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq => testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq => testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq => testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq => testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinSubqueryWithSelectorFilter@all_disabled@NullHandling=sql.iq => testInnerJoinSubqueryWithSelectorFilter@all_disabled.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@all_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinSubqueryWithSelectorFilter@all_enabled@NullHandling=sql.iq => testInnerJoinSubqueryWithSelectorFilter@all_enabled.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@all_enabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinSubqueryWithSelectorFilter@default@NullHandling=sql.iq => testInnerJoinSubqueryWithSelectorFilter@default.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@default@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinSubqueryWithSelectorFilter@filter-on-value-column_disabled@NullHandling=sql.iq => testInnerJoinSubqueryWithSelectorFilter@filter-on-value-column_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@filter-on-value-column_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinSubqueryWithSelectorFilter@filter-rewrites-disabled@NullHandling=sql.iq => testInnerJoinSubqueryWithSelectorFilter@filter-rewrites-disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@filter-rewrites-disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinSubqueryWithSelectorFilter@filter-rewrites@NullHandling=sql.iq => testInnerJoinSubqueryWithSelectorFilter@filter-rewrites.iq} (96%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@filter-rewrites@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinSubqueryWithSelectorFilter@join-to-filter@NullHandling=sql.iq => testInnerJoinSubqueryWithSelectorFilter@join-to-filter.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@join-to-filter@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinTableLookupLookupWithFilterWithOuterLimit@all_disabled@NullHandling=sql.iq => testInnerJoinTableLookupLookupWithFilterWithOuterLimit@all_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@all_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinTableLookupLookupWithFilterWithOuterLimit@all_enabled@NullHandling=sql.iq => testInnerJoinTableLookupLookupWithFilterWithOuterLimit@all_enabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@all_enabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinTableLookupLookupWithFilterWithOuterLimit@default@NullHandling=sql.iq => testInnerJoinTableLookupLookupWithFilterWithOuterLimit@default.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@default@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-on-value-column_disabled@NullHandling=sql.iq => testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-on-value-column_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-on-value-column_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-rewrites-disabled@NullHandling=sql.iq => testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-rewrites-disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-rewrites-disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-rewrites@NullHandling=sql.iq => testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-rewrites.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-rewrites@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinTableLookupLookupWithFilterWithOuterLimit@join-to-filter@NullHandling=sql.iq => testInnerJoinTableLookupLookupWithFilterWithOuterLimit@join-to-filter.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@join-to-filter@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@all_disabled@NullHandling=sql.iq => testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@all_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@all_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@all_enabled@NullHandling=sql.iq => testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@all_enabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@all_enabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@default@NullHandling=sql.iq => testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@default.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@default@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-on-value-column_disabled@NullHandling=sql.iq => testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-on-value-column_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-on-value-column_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-rewrites-disabled@NullHandling=sql.iq => testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-rewrites-disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-rewrites-disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-rewrites@NullHandling=sql.iq => testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-rewrites.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-rewrites@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@join-to-filter@NullHandling=sql.iq => testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@join-to-filter.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@join-to-filter@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinTableLookupLookupWithFilterWithoutLimit@all_disabled@NullHandling=sql.iq => testInnerJoinTableLookupLookupWithFilterWithoutLimit@all_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@all_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinTableLookupLookupWithFilterWithoutLimit@all_enabled@NullHandling=sql.iq => testInnerJoinTableLookupLookupWithFilterWithoutLimit@all_enabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@all_enabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinTableLookupLookupWithFilterWithoutLimit@default@NullHandling=sql.iq => testInnerJoinTableLookupLookupWithFilterWithoutLimit@default.iq} (96%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@default@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-on-value-column_disabled@NullHandling=sql.iq => testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-on-value-column_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-on-value-column_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-rewrites-disabled@NullHandling=sql.iq => testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-rewrites-disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-rewrites-disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-rewrites@NullHandling=sql.iq => testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-rewrites.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-rewrites@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinTableLookupLookupWithFilterWithoutLimit@join-to-filter@NullHandling=sql.iq => testInnerJoinTableLookupLookupWithFilterWithoutLimit@join-to-filter.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@join-to-filter@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@all_disabled@NullHandling=sql.iq => testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@all_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@all_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@all_enabled@NullHandling=sql.iq => testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@all_enabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@all_enabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@default@NullHandling=sql.iq => testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@default.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@default@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-on-value-column_disabled@NullHandling=sql.iq => testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-on-value-column_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-on-value-column_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-rewrites-disabled@NullHandling=sql.iq => testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-rewrites-disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-rewrites-disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-rewrites@NullHandling=sql.iq => testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-rewrites.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-rewrites@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@join-to-filter@NullHandling=sql.iq => testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@join-to-filter.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@join-to-filter@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_disabled@NullHandling=sql.iq => testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_disabled.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_enabled@NullHandling=sql.iq => testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_enabled.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_enabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@default@NullHandling=sql.iq => testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@default.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@default@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-on-value-column_disabled@NullHandling=sql.iq => testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-on-value-column_disabled.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-on-value-column_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites-disabled@NullHandling=sql.iq => testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites-disabled.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites-disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites@NullHandling=sql.iq => testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@join-to-filter@NullHandling=sql.iq => testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@join-to-filter.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@join-to-filter@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_disabled@NullHandling=sql.iq => testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_disabled.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_enabled@NullHandling=sql.iq => testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_enabled.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_enabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@default@NullHandling=sql.iq => testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@default.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@default@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-on-value-column_disabled@NullHandling=sql.iq => testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-on-value-column_disabled.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-on-value-column_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites-disabled@NullHandling=sql.iq => testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites-disabled.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites-disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites@NullHandling=sql.iq => testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@join-to-filter@NullHandling=sql.iq => testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@join-to-filter.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@join-to-filter@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinWithIsNullFilter@all_disabled@NullHandling=sql.iq => testInnerJoinWithIsNullFilter@all_disabled.iq} (96%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinWithIsNullFilter@all_enabled@NullHandling=sql.iq => testInnerJoinWithIsNullFilter@all_enabled.iq} (96%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_enabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinWithIsNullFilter@default@NullHandling=sql.iq => testInnerJoinWithIsNullFilter@default.iq} (96%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@default@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinWithIsNullFilter@filter-on-value-column_disabled@NullHandling=sql.iq => testInnerJoinWithIsNullFilter@filter-on-value-column_disabled.iq} (96%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-on-value-column_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinWithIsNullFilter@filter-rewrites-disabled@NullHandling=sql.iq => testInnerJoinWithIsNullFilter@filter-rewrites-disabled.iq} (96%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites-disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinWithIsNullFilter@filter-rewrites@NullHandling=sql.iq => testInnerJoinWithIsNullFilter@filter-rewrites.iq} (96%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testInnerJoinWithIsNullFilter@join-to-filter@NullHandling=sql.iq => testInnerJoinWithIsNullFilter@join-to-filter.iq} (96%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@join-to-filter@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime@NullHandling=sql.iq => testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues@NullHandling=sql.iq => testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testJoinOnTimeseriesWithFloorOnTime@NullHandling=sql.iq => testJoinOnTimeseriesWithFloorOnTime.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnTimeseriesWithFloorOnTime@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testJoinOuterGroupByAndSubqueryHasLimit@NullHandling=sql.iq => testJoinOuterGroupByAndSubqueryHasLimit.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOuterGroupByAndSubqueryHasLimit@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testJoinUnionTablesOnLookup@all_disabled@NullHandling=sql.iq => testJoinUnionTablesOnLookup@all_disabled.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@all_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testJoinUnionTablesOnLookup@all_enabled@NullHandling=sql.iq => testJoinUnionTablesOnLookup@all_enabled.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@all_enabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testJoinUnionTablesOnLookup@default@NullHandling=sql.iq => testJoinUnionTablesOnLookup@default.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@default@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testJoinUnionTablesOnLookup@filter-on-value-column_disabled@NullHandling=sql.iq => testJoinUnionTablesOnLookup@filter-on-value-column_disabled.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@filter-on-value-column_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testJoinUnionTablesOnLookup@filter-rewrites-disabled@NullHandling=sql.iq => testJoinUnionTablesOnLookup@filter-rewrites-disabled.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@filter-rewrites-disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testJoinUnionTablesOnLookup@filter-rewrites@NullHandling=sql.iq => testJoinUnionTablesOnLookup@filter-rewrites.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@filter-rewrites@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testJoinUnionTablesOnLookup@join-to-filter@NullHandling=sql.iq => testJoinUnionTablesOnLookup@join-to-filter.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@join-to-filter@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testJoinWithInputRefCondition@NullHandling=sql.iq => testJoinWithInputRefCondition.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=sql.iq => testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=sql.iq => testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=sql.iq => testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq => testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq => testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq => testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq => testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled@NullHandling=sql.iq => testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled@NullHandling=sql.iq => testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default@NullHandling=sql.iq => testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq => testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq => testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq => testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq => testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=sql.iq => testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=sql.iq => testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=sql.iq => testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq => testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq => testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq => testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq => testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testLeftJoinSubqueryWithSelectorFilter@all_disabled@NullHandling=sql.iq => testLeftJoinSubqueryWithSelectorFilter@all_disabled.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@all_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testLeftJoinSubqueryWithSelectorFilter@all_enabled@NullHandling=sql.iq => testLeftJoinSubqueryWithSelectorFilter@all_enabled.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@all_enabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testLeftJoinSubqueryWithSelectorFilter@default@NullHandling=sql.iq => testLeftJoinSubqueryWithSelectorFilter@default.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@default@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testLeftJoinSubqueryWithSelectorFilter@filter-on-value-column_disabled@NullHandling=sql.iq => testLeftJoinSubqueryWithSelectorFilter@filter-on-value-column_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@filter-on-value-column_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testLeftJoinSubqueryWithSelectorFilter@filter-rewrites-disabled@NullHandling=sql.iq => testLeftJoinSubqueryWithSelectorFilter@filter-rewrites-disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@filter-rewrites-disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testLeftJoinSubqueryWithSelectorFilter@filter-rewrites@NullHandling=sql.iq => testLeftJoinSubqueryWithSelectorFilter@filter-rewrites.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@filter-rewrites@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testLeftJoinSubqueryWithSelectorFilter@join-to-filter@NullHandling=sql.iq => testLeftJoinSubqueryWithSelectorFilter@join-to-filter.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@join-to-filter@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testManyManyInnerJoinOnManyManyLookup@all_disabled@NullHandling=sql.iq => testManyManyInnerJoinOnManyManyLookup@all_disabled.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@all_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testManyManyInnerJoinOnManyManyLookup@all_enabled@NullHandling=sql.iq => testManyManyInnerJoinOnManyManyLookup@all_enabled.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@all_enabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testManyManyInnerJoinOnManyManyLookup@default@NullHandling=sql.iq => testManyManyInnerJoinOnManyManyLookup@default.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@default@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testManyManyInnerJoinOnManyManyLookup@filter-on-value-column_disabled@NullHandling=sql.iq => testManyManyInnerJoinOnManyManyLookup@filter-on-value-column_disabled.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@filter-on-value-column_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testManyManyInnerJoinOnManyManyLookup@filter-rewrites-disabled@NullHandling=sql.iq => testManyManyInnerJoinOnManyManyLookup@filter-rewrites-disabled.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@filter-rewrites-disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testManyManyInnerJoinOnManyManyLookup@filter-rewrites@NullHandling=sql.iq => testManyManyInnerJoinOnManyManyLookup@filter-rewrites.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@filter-rewrites@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testManyManyInnerJoinOnManyManyLookup@join-to-filter@NullHandling=sql.iq => testManyManyInnerJoinOnManyManyLookup@join-to-filter.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@join-to-filter@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=sql.iq => testNestedGroupByOnInlineDataSourceWithFilter@all_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=sql.iq => testNestedGroupByOnInlineDataSourceWithFilter@all_enabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=sql.iq => testNestedGroupByOnInlineDataSourceWithFilter@default.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=sql.iq => testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=sql.iq => testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=sql.iq => testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=sql.iq => testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testSelectOnLookupUsingRightJoinOperator@all_disabled@NullHandling=sql.iq => testSelectOnLookupUsingRightJoinOperator@all_disabled.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@all_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testSelectOnLookupUsingRightJoinOperator@all_enabled@NullHandling=sql.iq => testSelectOnLookupUsingRightJoinOperator@all_enabled.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@all_enabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testSelectOnLookupUsingRightJoinOperator@default@NullHandling=sql.iq => testSelectOnLookupUsingRightJoinOperator@default.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@default@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testSelectOnLookupUsingRightJoinOperator@filter-on-value-column_disabled@NullHandling=sql.iq => testSelectOnLookupUsingRightJoinOperator@filter-on-value-column_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@filter-on-value-column_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testSelectOnLookupUsingRightJoinOperator@filter-rewrites-disabled@NullHandling=sql.iq => testSelectOnLookupUsingRightJoinOperator@filter-rewrites-disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@filter-rewrites-disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testSelectOnLookupUsingRightJoinOperator@filter-rewrites@NullHandling=sql.iq => testSelectOnLookupUsingRightJoinOperator@filter-rewrites.iq} (96%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@filter-rewrites@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testSelectOnLookupUsingRightJoinOperator@join-to-filter@NullHandling=sql.iq => testSelectOnLookupUsingRightJoinOperator@join-to-filter.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@join-to-filter@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=sql.iq => testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=sql.iq => testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=sql.iq => testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=sql.iq => testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=sql.iq => testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=sql.iq => testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=sql.iq => testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=sql.iq => testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=sql.iq => testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=sql.iq => testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=sql.iq => testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=sql.iq => testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=sql.iq => testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=sql.iq => testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=sql.iq => testSemiJoinWithOuterTimeExtractAggregateWithOrderBy.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testSemiJoinWithOuterTimeExtractScan@NullHandling=sql.iq => testSemiJoinWithOuterTimeExtractScan.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=sql.iq => testTwoSemiJoinsSimultaneously@all_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=sql.iq => testTwoSemiJoinsSimultaneously@all_enabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testTwoSemiJoinsSimultaneously@default@NullHandling=sql.iq => testTwoSemiJoinsSimultaneously@default.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@default@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=sql.iq => testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=sql.iq => testTwoSemiJoinsSimultaneously@filter-rewrites-disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=sql.iq => testTwoSemiJoinsSimultaneously@filter-rewrites.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=sql.iq => testTwoSemiJoinsSimultaneously@join-to-filter.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=sql.iq => testUsingSubqueryAsPartOfAndFilter@all_disabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=sql.iq => testUsingSubqueryAsPartOfAndFilter@all_enabled.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testUsingSubqueryAsPartOfAndFilter@default@NullHandling=sql.iq => testUsingSubqueryAsPartOfAndFilter@default.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@default@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=sql.iq => testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=sql.iq => testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=sql.iq => testUsingSubqueryAsPartOfAndFilter@filter-rewrites.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=sql.iq => testUsingSubqueryAsPartOfAndFilter@join-to-filter.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testUsingSubqueryWithExtractionFns@all_disabled@NullHandling=sql.iq => testUsingSubqueryWithExtractionFns@all_disabled.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testUsingSubqueryWithExtractionFns@all_enabled@NullHandling=sql.iq => testUsingSubqueryWithExtractionFns@all_enabled.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_enabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testUsingSubqueryWithExtractionFns@default@NullHandling=sql.iq => testUsingSubqueryWithExtractionFns@default.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@default@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled@NullHandling=sql.iq => testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testUsingSubqueryWithExtractionFns@filter-rewrites-disabled@NullHandling=sql.iq => testUsingSubqueryWithExtractionFns@filter-rewrites-disabled.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites-disabled@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testUsingSubqueryWithExtractionFns@filter-rewrites@NullHandling=sql.iq => testUsingSubqueryWithExtractionFns@filter-rewrites.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/{testUsingSubqueryWithExtractionFns@join-to-filter@NullHandling=sql.iq => testUsingSubqueryWithExtractionFns@join-to-filter.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@join-to-filter@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/{testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=sql.iq => testExactCountDistinctWithGroupingAndOtherAggregators.iq} (96%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/{testGroupByLimitPushdownExtraction@NullHandling=sql.iq => testGroupByLimitPushdownExtraction.iq} (96%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/{testGroupByTimeFloorAndDimOnGroupByTimeFloorAndDim@NullHandling=sql.iq => testGroupByTimeFloorAndDimOnGroupByTimeFloorAndDim.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByTimeFloorAndDimOnGroupByTimeFloorAndDim@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/{testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=sql.iq => testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/{testSubqueryTypeMismatchWithLiterals@NullHandling=sql.iq => testSubqueryTypeMismatchWithLiterals.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/{testTimeFilterOnSubquery@NullHandling=sql.iq => testTimeFilterOnSubquery.iq} (97%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/{testWindowingWithScanAndSort@NullHandling=sql.iq => testWindowingWithScanAndSort.iq} (98%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=default.iq diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/BoundFilterBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/BoundFilterBenchmark.java index e1dd7fe4f2fb..9b1c4a32964f 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/BoundFilterBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/BoundFilterBenchmark.java @@ -25,7 +25,6 @@ import org.apache.druid.collections.bitmap.ImmutableBitmap; import org.apache.druid.collections.bitmap.MutableBitmap; import org.apache.druid.collections.bitmap.RoaringBitmapFactory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.extendedset.intset.ConciseSetUtils; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.query.filter.BoundDimFilter; @@ -60,10 +59,6 @@ @Measurement(iterations = 10) public class BoundFilterBenchmark { - static { - NullHandling.initializeForTests(); - } - private static final int START_INT = 1_000_000_000; private static final int END_INT = ConciseSetUtils.MAX_ALLOWED_INTEGER; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/DataSketchesHllBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/DataSketchesHllBenchmark.java index 28dc5db99054..9b75df49c3f8 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/DataSketchesHllBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/DataSketchesHllBenchmark.java @@ -20,7 +20,6 @@ package org.apache.druid.benchmark; import org.apache.datasketches.hll.HllSketch; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.aggregation.AggregatorFactory; import org.apache.druid.query.aggregation.BufferAggregator; import org.apache.druid.query.aggregation.datasketches.hll.HllSketchMergeAggregatorFactory; @@ -55,10 +54,6 @@ @State(Scope.Benchmark) public class DataSketchesHllBenchmark { - static { - NullHandling.initializeForTests(); - } - private final AggregatorFactory aggregatorFactory = new HllSketchMergeAggregatorFactory( "hll", "hll", diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/DelimitedInputFormatBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/DelimitedInputFormatBenchmark.java index 008dcd9600a0..a3b1808e9227 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/DelimitedInputFormatBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/DelimitedInputFormatBenchmark.java @@ -20,7 +20,6 @@ package org.apache.druid.benchmark; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.ColumnsFilter; import org.apache.druid.data.input.InputEntityReader; import org.apache.druid.data.input.InputRow; @@ -83,10 +82,6 @@ public class DelimitedInputFormatBenchmark "delta" ); - static { - NullHandling.initializeForTests(); - } - @Param({"false", "true"}) private boolean fromHeader; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/DictionaryEncodedStringIndexSupplierBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/DictionaryEncodedStringIndexSupplierBenchmark.java index 8491a1283296..9e869eb71f2a 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/DictionaryEncodedStringIndexSupplierBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/DictionaryEncodedStringIndexSupplierBenchmark.java @@ -24,7 +24,6 @@ import org.apache.druid.collections.bitmap.ImmutableBitmap; import org.apache.druid.collections.bitmap.MutableBitmap; import org.apache.druid.collections.bitmap.RoaringBitmapFactory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.ByteBufferUtils; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.segment.data.BitmapSerdeFactory; @@ -64,10 +63,6 @@ @Measurement(iterations = 10) public class DictionaryEncodedStringIndexSupplierBenchmark { - static { - NullHandling.initializeForTests(); - } - @State(Scope.Benchmark) public static class BenchmarkState { diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/DimensionPredicateFilterBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/DimensionPredicateFilterBenchmark.java index 20f61bc12e2e..94a052f5a526 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/DimensionPredicateFilterBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/DimensionPredicateFilterBenchmark.java @@ -25,7 +25,6 @@ import org.apache.druid.collections.bitmap.ImmutableBitmap; import org.apache.druid.collections.bitmap.MutableBitmap; import org.apache.druid.collections.bitmap.RoaringBitmapFactory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.query.filter.ColumnIndexSelector; import org.apache.druid.query.filter.DruidDoublePredicate; @@ -63,10 +62,6 @@ @Measurement(iterations = 10) public class DimensionPredicateFilterBenchmark { - static { - NullHandling.initializeForTests(); - } - private static final int START_INT = 1_000_000_000; private static final DimensionPredicateFilter IS_EVEN = new DimensionPredicateFilter( diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/ExpressionAggregationBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/ExpressionAggregationBenchmark.java index cda80475f53f..b24f2415b520 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/ExpressionAggregationBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/ExpressionAggregationBenchmark.java @@ -20,7 +20,6 @@ package org.apache.druid.benchmark; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.io.Closer; @@ -70,10 +69,6 @@ @OutputTimeUnit(TimeUnit.MILLISECONDS) public class ExpressionAggregationBenchmark { - static { - NullHandling.initializeForTests(); - } - @Param({"1000000"}) private int rowsPerSegment; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/ExpressionFilterBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/ExpressionFilterBenchmark.java index 6672edc5c42c..bc2e2dcad7b9 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/ExpressionFilterBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/ExpressionFilterBenchmark.java @@ -20,7 +20,6 @@ package org.apache.druid.benchmark; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.io.Closer; @@ -69,7 +68,6 @@ public class ExpressionFilterBenchmark { static { - NullHandling.initializeForTests(); ExpressionProcessing.initializeForTests(); } diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/ExpressionSelectorBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/ExpressionSelectorBenchmark.java index f4dce839cd57..9cd89cdfaac0 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/ExpressionSelectorBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/ExpressionSelectorBenchmark.java @@ -20,7 +20,6 @@ package org.apache.druid.benchmark; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.java.util.common.granularity.Granularities; @@ -81,7 +80,6 @@ public class ExpressionSelectorBenchmark { static { - NullHandling.initializeForTests(); ExpressionProcessing.initializeForTests(); } diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/ExpressionVectorSelectorBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/ExpressionVectorSelectorBenchmark.java index 2e9ffb644d56..f5655a5cbb8b 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/ExpressionVectorSelectorBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/ExpressionVectorSelectorBenchmark.java @@ -20,7 +20,6 @@ package org.apache.druid.benchmark; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.io.Closer; import org.apache.druid.math.expr.Expr; @@ -73,10 +72,6 @@ @OutputTimeUnit(TimeUnit.MILLISECONDS) public class ExpressionVectorSelectorBenchmark { - static { - NullHandling.initializeForTests(); - } - @Param({"1000000"}) private int rowsPerSegment; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/FilterPartitionBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/FilterPartitionBenchmark.java index 2c0f26901983..dcf4edf74a01 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/FilterPartitionBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/FilterPartitionBenchmark.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.java.util.common.FileUtils; @@ -99,10 +98,6 @@ @Measurement(iterations = 25) public class FilterPartitionBenchmark { - static { - NullHandling.initializeForTests(); - } - @Param({"750000"}) private int rowsPerSegment; @@ -548,14 +543,12 @@ public Filter toFilter() if (extractionFn == null) { return new NoBitmapSelectorFilter(dimension, value); } else { - final String valueOrNull = NullHandling.emptyToNullIfNeeded(value); - final DruidPredicateFactory predicateFactory = new DruidPredicateFactory() { @Override public DruidObjectPredicate makeStringPredicate() { - return valueOrNull == null ? DruidObjectPredicate.isNull() : DruidObjectPredicate.equalTo(valueOrNull); + return value == null ? DruidObjectPredicate.isNull() : DruidObjectPredicate.equalTo(value); } @Override diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/FilteredAggregatorBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/FilteredAggregatorBenchmark.java index ac6d568ec446..b524aaad958d 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/FilteredAggregatorBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/FilteredAggregatorBenchmark.java @@ -23,7 +23,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableMap; import org.apache.druid.benchmark.query.QueryBenchmarkUtil; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.java.util.common.FileUtils; @@ -104,10 +103,6 @@ @Measurement(iterations = 25) public class FilteredAggregatorBenchmark { - static { - NullHandling.initializeForTests(); - } - @Param({"75000"}) private int rowsPerSegment; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/FixedHistogramAddBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/FixedHistogramAddBenchmark.java index c5010bbccef0..39ef26c46e2e 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/FixedHistogramAddBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/FixedHistogramAddBenchmark.java @@ -20,7 +20,6 @@ package org.apache.druid.benchmark; import org.apache.commons.math3.distribution.NormalDistribution; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.aggregation.histogram.FixedBucketsHistogram; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; @@ -47,10 +46,6 @@ @OutputTimeUnit(TimeUnit.MICROSECONDS) public class FixedHistogramAddBenchmark { - static { - NullHandling.initializeForTests(); - } - private static final int LOWER_LIMIT = 0; private static final int UPPER_LIMIT = 100000; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/FixedHistogramBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/FixedHistogramBenchmark.java index 747b645816d4..8e0e6de4682d 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/FixedHistogramBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/FixedHistogramBenchmark.java @@ -19,7 +19,6 @@ package org.apache.druid.benchmark; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.logger.Logger; import org.apache.druid.query.aggregation.histogram.FixedBucketsHistogram; import org.openjdk.jmh.annotations.Benchmark; @@ -47,10 +46,6 @@ @OutputTimeUnit(TimeUnit.MICROSECONDS) public class FixedHistogramBenchmark { - static { - NullHandling.initializeForTests(); - } - private static final Logger log = new Logger(FixedHistogramBenchmark.class); private static final int LOWER_LIMIT = 0; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/FrontCodedIndexedBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/FrontCodedIndexedBenchmark.java index d09d501a050e..023806e73a84 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/FrontCodedIndexedBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/FrontCodedIndexedBenchmark.java @@ -21,7 +21,6 @@ import com.google.common.base.Preconditions; import org.apache.druid.benchmark.compression.EncodingSizeProfiler; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.FileUtils; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.java.util.common.io.smoosh.FileSmoosher; @@ -76,10 +75,6 @@ @State(Scope.Benchmark) public class FrontCodedIndexedBenchmark { - static { - NullHandling.initializeForTests(); - } - @Param({"10000", "100000"}) public int numElements; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/GenericIndexedBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/GenericIndexedBenchmark.java index afbcb97b19f8..8ddb283ac8ff 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/GenericIndexedBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/GenericIndexedBenchmark.java @@ -20,7 +20,6 @@ package org.apache.druid.benchmark; import com.google.common.primitives.Ints; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.FileUtils; import org.apache.druid.java.util.common.io.smoosh.FileSmoosher; import org.apache.druid.java.util.common.io.smoosh.SmooshedFileMapper; @@ -61,10 +60,6 @@ @State(Scope.Benchmark) public class GenericIndexedBenchmark { - static { - NullHandling.initializeForTests(); - } - public static final int ITERATIONS = 10000; static final ObjectStrategy BYTE_ARRAY_STRATEGY = new ObjectStrategy<>() diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/GroupByDeserializationBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/GroupByDeserializationBenchmark.java index a80228c019bb..95e0f1b19aac 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/GroupByDeserializationBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/GroupByDeserializationBenchmark.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.guice.BuiltInTypesModule; import org.apache.druid.jackson.AggregatorsModule; import org.apache.druid.java.util.common.DateTimes; @@ -66,9 +65,7 @@ @Measurement(iterations = 5) public class GroupByDeserializationBenchmark { - static { - NullHandling.initializeForTests(); BuiltInTypesModule.registerHandlersAndSerde(); AggregatorsModule.registerComplexMetricsAndSerde(); } diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/GroupByTypeInterfaceBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/GroupByTypeInterfaceBenchmark.java index 07fc6a1eca3c..6e085e162870 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/GroupByTypeInterfaceBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/GroupByTypeInterfaceBenchmark.java @@ -28,7 +28,6 @@ import org.apache.druid.collections.DefaultBlockingPool; import org.apache.druid.collections.NonBlockingPool; import org.apache.druid.collections.StupidPool; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.java.util.common.FileUtils; @@ -109,10 +108,6 @@ @Measurement(iterations = 30) public class GroupByTypeInterfaceBenchmark { - static { - NullHandling.initializeForTests(); - } - private static final SegmentId Q_INDEX_SEGMENT_ID = SegmentId.dummy("qIndex"); @Param({"4"}) diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/InFilterBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/InFilterBenchmark.java index 821209f6d8a4..89cf1c9c12f8 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/InFilterBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/InFilterBenchmark.java @@ -24,7 +24,6 @@ import org.apache.druid.collections.bitmap.ImmutableBitmap; import org.apache.druid.collections.bitmap.MutableBitmap; import org.apache.druid.collections.bitmap.RoaringBitmapFactory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.query.filter.ColumnIndexSelector; import org.apache.druid.query.filter.InDimFilter; @@ -59,10 +58,6 @@ @Measurement(iterations = 3) public class InFilterBenchmark { - static { - NullHandling.initializeForTests(); - } - private static final int START_INT = 10_000_000; private InDimFilter inFilter; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/IncrementalIndexRowTypeBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/IncrementalIndexRowTypeBenchmark.java index e411fc92b1ed..83eb0533d7a6 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/IncrementalIndexRowTypeBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/IncrementalIndexRowTypeBenchmark.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.data.input.MapBasedInputRow; import org.apache.druid.java.util.common.StringUtils; @@ -52,10 +51,6 @@ @State(Scope.Benchmark) public class IncrementalIndexRowTypeBenchmark { - static { - NullHandling.initializeForTests(); - } - @Param({"250000"}) private int rowsPerSegment; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/IndexedTableJoinCursorBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/IndexedTableJoinCursorBenchmark.java index e654b033dee3..1c0a53358253 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/IndexedTableJoinCursorBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/IndexedTableJoinCursorBenchmark.java @@ -22,7 +22,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.IAE; import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.StringUtils; @@ -92,10 +91,6 @@ @Measurement(iterations = 5) public class IndexedTableJoinCursorBenchmark { - static { - NullHandling.initializeForTests(); - } - private static final List> PROJECTIONS = ImmutableList.of( // 0 string key rhs ImmutableSet.of("j0.stringKey"), diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/JoinAndLookupBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/JoinAndLookupBenchmark.java index d9a98b467d89..73919effeaa5 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/JoinAndLookupBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/JoinAndLookupBenchmark.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.FileUtils; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.math.expr.ExprMacroTable; @@ -88,10 +87,6 @@ public class JoinAndLookupBenchmark private static final String LOOKUP_COUNTRY_CODE_TO_NAME = "country_code_to_name"; private static final String LOOKUP_COUNTRY_NUMBER_TO_NAME = "country_number_to_name"; - static { - NullHandling.initializeForTests(); - } - @Param({"500000"}) int rows; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/LikeFilterBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/LikeFilterBenchmark.java index 086d46dfb5e1..c0f797d05b1d 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/LikeFilterBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/LikeFilterBenchmark.java @@ -24,7 +24,6 @@ import org.apache.druid.collections.bitmap.ImmutableBitmap; import org.apache.druid.collections.bitmap.MutableBitmap; import org.apache.druid.collections.bitmap.RoaringBitmapFactory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.query.filter.BoundDimFilter; import org.apache.druid.query.filter.ColumnIndexSelector; @@ -61,10 +60,6 @@ @Measurement(iterations = 10) public class LikeFilterBenchmark { - static { - NullHandling.initializeForTests(); - } - private static final int START_INT = 1_000_000; private static final int END_INT = 9_999_999; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/MemoryBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/MemoryBenchmark.java index 44a7d08c8fe9..294a6ed046e3 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/MemoryBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/MemoryBenchmark.java @@ -20,7 +20,6 @@ package org.apache.druid.benchmark; import org.apache.datasketches.memory.WritableMemory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.groupby.epinephelinae.collection.HashTableUtils; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; @@ -46,10 +45,6 @@ @Measurement(iterations = 15) public class MemoryBenchmark { - static { - NullHandling.initializeForTests(); - } - @Param({"4", "5", "8", "9", "12", "16", "31", "32", "64", "128"}) public int numBytes; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/ProtobufParserBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/ProtobufParserBenchmark.java index 22786beeb603..4cbfaa2dbba3 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/ProtobufParserBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/ProtobufParserBenchmark.java @@ -21,7 +21,6 @@ import com.google.common.collect.Lists; import com.google.common.io.Files; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.data.input.impl.DimensionsSpec; import org.apache.druid.data.input.impl.JSONParseSpec; @@ -64,10 +63,6 @@ public class ProtobufParserBenchmark private static final Logger log = new Logger(ProtobufParserBenchmark.class); - static { - NullHandling.initializeForTests(); - } - private ParseSpec nestedParseSpec; private ProtobufInputRowParser nestedParser; private ParseSpec flatParseSpec; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/SinkQuerySegmentWalkerBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/SinkQuerySegmentWalkerBenchmark.java index 8342dd565ca1..6b36d72c672e 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/SinkQuerySegmentWalkerBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/SinkQuerySegmentWalkerBenchmark.java @@ -22,7 +22,6 @@ import com.google.common.base.Suppliers; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.MapBasedInputRow; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.java.util.common.DateTimes; @@ -72,10 +71,6 @@ @OutputTimeUnit(TimeUnit.MILLISECONDS) public class SinkQuerySegmentWalkerBenchmark { - static { - NullHandling.initializeForTests(); - } - @Param({"10", "50", "100", "200"}) private int numFireHydrants; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/TopNTypeInterfaceBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/TopNTypeInterfaceBenchmark.java index df66a36a553f..f4db1495aa65 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/TopNTypeInterfaceBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/TopNTypeInterfaceBenchmark.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.druid.benchmark.query.QueryBenchmarkUtil; import org.apache.druid.collections.StupidPool; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.java.util.common.FileUtils; @@ -101,10 +100,6 @@ @Measurement(iterations = 25) public class TopNTypeInterfaceBenchmark { - static { - NullHandling.initializeForTests(); - } - private static final SegmentId Q_INDEX_SEGMENT_ID = SegmentId.dummy("qIndex"); @Param({"1"}) diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/bitmap/BitmapBenchmarkWithVaryingOrder.java b/benchmarks/src/test/java/org/apache/druid/benchmark/bitmap/BitmapBenchmarkWithVaryingOrder.java index 445b46729e82..302a0e88a3c4 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/bitmap/BitmapBenchmarkWithVaryingOrder.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/bitmap/BitmapBenchmarkWithVaryingOrder.java @@ -27,7 +27,6 @@ import org.apache.druid.collections.bitmap.ImmutableBitmap; import org.apache.druid.collections.bitmap.MutableBitmap; import org.apache.druid.collections.bitmap.RoaringBitmapFactory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.IAE; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; @@ -78,10 +77,6 @@ public class BitmapBenchmarkWithVaryingOrder private List reverseBitmaps; private BitmapFactory bitmapFactory; - static { - NullHandling.initializeForTests(); - } - @Setup(Level.Trial) public void setup() throws IOException { diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/bitmap/RangeBitmapBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/bitmap/RangeBitmapBenchmark.java index 34faa9072913..002fa9c2e8d0 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/bitmap/RangeBitmapBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/bitmap/RangeBitmapBenchmark.java @@ -24,7 +24,6 @@ import org.apache.druid.collections.bitmap.ImmutableBitmap; import org.apache.druid.collections.bitmap.MutableBitmap; import org.apache.druid.collections.bitmap.RoaringBitmapFactory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.IAE; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; @@ -74,10 +73,6 @@ public class RangeBitmapBenchmark private List bitmaps; private BitmapFactory bitmapFactory; - static { - NullHandling.initializeForTests(); - } - @Setup(Level.Trial) public void setup() throws IOException { diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/bitmap/UniformBitmapBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/bitmap/UniformBitmapBenchmark.java index d8ea33eb619a..cb917f767798 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/bitmap/UniformBitmapBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/bitmap/UniformBitmapBenchmark.java @@ -24,7 +24,6 @@ import org.apache.druid.collections.bitmap.ImmutableBitmap; import org.apache.druid.collections.bitmap.MutableBitmap; import org.apache.druid.collections.bitmap.RoaringBitmapFactory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.IAE; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; @@ -74,10 +73,6 @@ public class UniformBitmapBenchmark private List bitmaps; private BitmapFactory bitmapFactory; - static { - NullHandling.initializeForTests(); - } - @Setup(Level.Trial) public void setup() throws IOException { diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/compression/CompressedColumnarIntsBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/compression/CompressedColumnarIntsBenchmark.java index bbcd2fc13950..5db092ba02ab 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/compression/CompressedColumnarIntsBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/compression/CompressedColumnarIntsBenchmark.java @@ -20,7 +20,6 @@ package org.apache.druid.benchmark.compression; import it.unimi.dsi.fastutil.ints.IntArrayList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.io.Closer; import org.apache.druid.segment.data.ColumnarInts; import org.apache.druid.segment.data.CompressedVSizeColumnarIntsSupplier; @@ -50,10 +49,6 @@ @State(Scope.Benchmark) public class CompressedColumnarIntsBenchmark { - static { - NullHandling.initializeForTests(); - } - private IndexedInts uncompressed; private IndexedInts compressed; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/compression/CompressedVSizeColumnarMultiIntsBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/compression/CompressedVSizeColumnarMultiIntsBenchmark.java index 5eb88195f92e..87665ab9597b 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/compression/CompressedVSizeColumnarMultiIntsBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/compression/CompressedVSizeColumnarMultiIntsBenchmark.java @@ -21,7 +21,6 @@ import com.google.common.base.Function; import com.google.common.collect.Iterables; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.io.Closer; import org.apache.druid.segment.data.ColumnarInts; import org.apache.druid.segment.data.ColumnarMultiInts; @@ -55,10 +54,6 @@ @State(Scope.Benchmark) public class CompressedVSizeColumnarMultiIntsBenchmark { - static { - NullHandling.initializeForTests(); - } - private ColumnarMultiInts uncompressed; private ColumnarMultiInts compressed; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/compression/FloatCompressionBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/compression/FloatCompressionBenchmark.java index a8063ab667a4..c74415c5a43d 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/compression/FloatCompressionBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/compression/FloatCompressionBenchmark.java @@ -20,7 +20,6 @@ package org.apache.druid.benchmark.compression; import com.google.common.base.Supplier; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.FileUtils; import org.apache.druid.java.util.common.MappedByteBufferHandler; import org.apache.druid.segment.data.ColumnarFloats; @@ -56,10 +55,6 @@ @OutputTimeUnit(TimeUnit.MILLISECONDS) public class FloatCompressionBenchmark { - static { - NullHandling.initializeForTests(); - } - @Param("floatCompress/") private static String dirPath; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/compression/FloatCompressionBenchmarkFileGenerator.java b/benchmarks/src/test/java/org/apache/druid/benchmark/compression/FloatCompressionBenchmarkFileGenerator.java index 9715db49e0ed..abb48f194e88 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/compression/FloatCompressionBenchmarkFileGenerator.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/compression/FloatCompressionBenchmarkFileGenerator.java @@ -20,7 +20,6 @@ package org.apache.druid.benchmark.compression; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.logger.Logger; import org.apache.druid.segment.column.ValueType; import org.apache.druid.segment.data.ColumnarFloatsSerializer; @@ -46,10 +45,6 @@ public class FloatCompressionBenchmarkFileGenerator { - static { - NullHandling.initializeForTests(); - } - private static final Logger log = new Logger(FloatCompressionBenchmarkFileGenerator.class); public static final int ROW_NUM = 5000000; public static final List COMPRESSIONS = diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/compression/LongCompressionBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/compression/LongCompressionBenchmark.java index e76cfc5b425b..d327eaf91a05 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/compression/LongCompressionBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/compression/LongCompressionBenchmark.java @@ -20,7 +20,6 @@ package org.apache.druid.benchmark.compression; import com.google.common.base.Supplier; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.FileUtils; import org.apache.druid.java.util.common.MappedByteBufferHandler; import org.apache.druid.query.QueryContexts; @@ -57,10 +56,6 @@ @OutputTimeUnit(TimeUnit.MILLISECONDS) public class LongCompressionBenchmark { - static { - NullHandling.initializeForTests(); - } - @Param("longCompress/") private static String dirPath; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/compression/LongCompressionBenchmarkFileGenerator.java b/benchmarks/src/test/java/org/apache/druid/benchmark/compression/LongCompressionBenchmarkFileGenerator.java index b1786e82f45c..2e68498a7088 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/compression/LongCompressionBenchmarkFileGenerator.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/compression/LongCompressionBenchmarkFileGenerator.java @@ -20,7 +20,6 @@ package org.apache.druid.benchmark.compression; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.logger.Logger; import org.apache.druid.segment.column.ValueType; import org.apache.druid.segment.data.ColumnarLongsSerializer; @@ -46,10 +45,6 @@ public class LongCompressionBenchmarkFileGenerator { - static { - NullHandling.initializeForTests(); - } - private static final Logger log = new Logger(LongCompressionBenchmarkFileGenerator.class); public static final int ROW_NUM = 5000000; public static final List COMPRESSIONS = diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/compression/VSizeSerdeBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/compression/VSizeSerdeBenchmark.java index 995925e2d69f..93feb616e7c1 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/compression/VSizeSerdeBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/compression/VSizeSerdeBenchmark.java @@ -19,7 +19,6 @@ package org.apache.druid.benchmark.compression; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.FileUtils; import org.apache.druid.java.util.common.MappedByteBufferHandler; import org.apache.druid.java.util.common.logger.Logger; @@ -54,10 +53,6 @@ @OutputTimeUnit(TimeUnit.MILLISECONDS) public class VSizeSerdeBenchmark { - static { - NullHandling.initializeForTests(); - } - private static final Logger log = new Logger(VSizeSerdeBenchmark.class); @Param({"500000"}) private int values; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/frame/FrameChannelMergerBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/frame/FrameChannelMergerBenchmark.java index 25f9015de2b9..161de8a217d7 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/frame/FrameChannelMergerBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/frame/FrameChannelMergerBenchmark.java @@ -23,7 +23,6 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningExecutorService; import com.google.common.util.concurrent.MoreExecutors; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.guava.FutureUtils; import org.apache.druid.frame.Frame; import org.apache.druid.frame.FrameType; @@ -85,7 +84,6 @@ public class FrameChannelMergerBenchmark { static { - NullHandling.initializeForTests(); BuiltInTypesModule.registerHandlersAndSerde(); } diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/indexing/IncrementalIndexReadBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/indexing/IncrementalIndexReadBenchmark.java index 56a41e0fb9b0..533c9541b265 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/indexing/IncrementalIndexReadBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/indexing/IncrementalIndexReadBenchmark.java @@ -19,7 +19,6 @@ package org.apache.druid.benchmark.indexing; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.logger.Logger; import org.apache.druid.js.JavaScriptConfig; import org.apache.druid.query.aggregation.hyperloglog.HyperUniquesSerde; @@ -90,10 +89,6 @@ public class IncrementalIndexReadBenchmark private static final Logger log = new Logger(IncrementalIndexReadBenchmark.class); private static final int RNG_SEED = 9999; - static { - NullHandling.initializeForTests(); - } - private AppendableIndexSpec appendableIndexSpec; private IncrementalIndex incIndex; private GeneratorSchemaInfo schemaInfo; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/indexing/IndexIngestionBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/indexing/IndexIngestionBenchmark.java index ddac83b44ad3..d03cc74f66fa 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/indexing/IndexIngestionBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/indexing/IndexIngestionBenchmark.java @@ -20,7 +20,6 @@ package org.apache.druid.benchmark.indexing; import com.fasterxml.jackson.core.JsonProcessingException; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.java.util.common.logger.Logger; import org.apache.druid.query.aggregation.hyperloglog.HyperUniquesSerde; @@ -74,10 +73,6 @@ public class IndexIngestionBenchmark private static final Logger log = new Logger(IndexIngestionBenchmark.class); private static final int RNG_SEED = 9999; - static { - NullHandling.initializeForTests(); - } - private AppendableIndexSpec appendableIndexSpec; private IncrementalIndex incIndex; private List rows; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/indexing/IndexMergeBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/indexing/IndexMergeBenchmark.java index b9e43059c57a..09b265e60e7c 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/indexing/IndexMergeBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/indexing/IndexMergeBenchmark.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.databind.InjectableValues; import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.java.util.common.FileUtils; import org.apache.druid.java.util.common.logger.Logger; @@ -92,10 +91,6 @@ public class IndexMergeBenchmark private static final IndexIO INDEX_IO; public static final ObjectMapper JSON_MAPPER; - static { - NullHandling.initializeForTests(); - } - private List indexesToMerge; private GeneratorSchemaInfo schemaInfo; private File tmpDir; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/indexing/IndexPersistBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/indexing/IndexPersistBenchmark.java index 14d296fda615..9dbc0e31a14e 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/indexing/IndexPersistBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/indexing/IndexPersistBenchmark.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.java.util.common.FileUtils; @@ -73,7 +72,6 @@ public class IndexPersistBenchmark private static final IndexIO INDEX_IO; static { - NullHandling.initializeForTests(); JSON_MAPPER = new DefaultObjectMapper(); INDEX_IO = new IndexIO(JSON_MAPPER, ColumnConfig.DEFAULT); INDEX_MERGER_V9 = new IndexMergerV9(JSON_MAPPER, INDEX_IO, OffHeapMemorySegmentWriteOutMediumFactory.instance()); diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/indexing/OnheapIncrementalIndexBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/indexing/OnheapIncrementalIndexBenchmark.java index 8f662f273a34..c678495018c8 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/indexing/OnheapIncrementalIndexBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/indexing/OnheapIncrementalIndexBenchmark.java @@ -26,7 +26,6 @@ import com.google.common.util.concurrent.ListeningExecutorService; import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.ThreadFactoryBuilder; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.MapBasedInputRow; import org.apache.druid.java.util.common.ISE; import org.apache.druid.java.util.common.Intervals; @@ -90,10 +89,6 @@ public class OnheapIncrementalIndexBenchmark { static final int DIMENSION_COUNT = 5; - static { - NullHandling.initializeForTests(); - } - /** * Number of index and query tasks. */ diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/indexing/StringDimensionIndexerBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/indexing/StringDimensionIndexerBenchmark.java index e9df76b39c81..00bc119b2f5a 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/indexing/StringDimensionIndexerBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/indexing/StringDimensionIndexerBenchmark.java @@ -19,7 +19,6 @@ package org.apache.druid.benchmark.indexing; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.impl.DimensionSchema; import org.apache.druid.segment.StringDimensionIndexer; import org.openjdk.jmh.annotations.Benchmark; @@ -44,10 +43,6 @@ @Measurement(iterations = 10) public class StringDimensionIndexerBenchmark { - static { - NullHandling.initializeForTests(); - } - StringDimensionIndexer indexer; int[] exampleArray; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/indexing/StringDimensionIndexerProcessBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/indexing/StringDimensionIndexerProcessBenchmark.java index 0f44b15018c8..c328e6967f69 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/indexing/StringDimensionIndexerProcessBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/indexing/StringDimensionIndexerProcessBenchmark.java @@ -19,7 +19,6 @@ package org.apache.druid.benchmark.indexing; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.impl.DimensionSchema; import org.apache.druid.segment.StringDimensionIndexer; import org.openjdk.jmh.annotations.Benchmark; @@ -48,10 +47,6 @@ @Measurement(iterations = 10) public class StringDimensionIndexerProcessBenchmark { - static { - NullHandling.initializeForTests(); - } - String[] inputData; StringDimensionIndexer emptyIndexer; StringDimensionIndexer fullIndexer; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/lookup/LookupExtractorBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/lookup/LookupExtractorBenchmark.java index 4f9e7f140979..c70432d4aa60 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/lookup/LookupExtractorBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/lookup/LookupExtractorBenchmark.java @@ -21,7 +21,6 @@ import com.google.common.base.Preconditions; import com.google.common.collect.Iterators; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.ISE; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.query.lookup.LookupExtractor; @@ -53,10 +52,6 @@ @Measurement(iterations = 5) public class LookupExtractorBenchmark { - static { - NullHandling.initializeForTests(); - } - /** * Type of lookup to benchmark. All are members of enum {@link LookupBenchmarkUtil.LookupType}. */ diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/lookup/SqlReverseLookupBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/lookup/SqlReverseLookupBenchmark.java index 38bcfdea0eeb..bd97113ba80a 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/lookup/SqlReverseLookupBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/lookup/SqlReverseLookupBenchmark.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableMap; import org.apache.druid.benchmark.query.SqlBaseBenchmark; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.Pair; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.java.util.common.granularity.Granularities; @@ -66,10 +65,6 @@ @Measurement(iterations = 5) public class SqlReverseLookupBenchmark { - static { - NullHandling.initializeForTests(); - } - /** * Type of lookup to benchmark. All are members of enum {@link LookupBenchmarkUtil.LookupType}. */ diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/query/CachingClusteredClientBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/query/CachingClusteredClientBenchmark.java index 02a0beaac17c..fdb072187d93 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/query/CachingClusteredClientBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/query/CachingClusteredClientBenchmark.java @@ -44,7 +44,6 @@ import org.apache.druid.collections.DefaultBlockingPool; import org.apache.druid.collections.NonBlockingPool; import org.apache.druid.collections.StupidPool; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.guice.http.DruidHttpClientConfig; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.java.util.common.concurrent.Execs; @@ -150,10 +149,6 @@ public class CachingClusteredClientBenchmark public static final ObjectMapper JSON_MAPPER; - static { - NullHandling.initializeForTests(); - } - @Param({"8", "24"}) private int numServers; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/query/GroupByBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/query/GroupByBenchmark.java index 080854553b4b..44ef5c60e2ed 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/query/GroupByBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/query/GroupByBenchmark.java @@ -31,7 +31,6 @@ import org.apache.druid.collections.DefaultBlockingPool; import org.apache.druid.collections.NonBlockingPool; import org.apache.druid.collections.StupidPool; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.java.util.common.FileUtils; import org.apache.druid.java.util.common.HumanReadableBytes; @@ -151,10 +150,6 @@ public class GroupByBenchmark private static final IndexIO INDEX_IO; public static final ObjectMapper JSON_MAPPER; - static { - NullHandling.initializeForTests(); - } - private AppendableIndexSpec appendableIndexSpec; private DataGenerator generator; private QueryRunnerFactory factory; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/query/InPlanningBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/query/InPlanningBenchmark.java index 046da2574235..f691d2cebecb 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/query/InPlanningBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/query/InPlanningBenchmark.java @@ -23,7 +23,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.impl.DimensionSchema; import org.apache.druid.data.input.impl.DimensionsSpec; import org.apache.druid.java.util.common.ISE; @@ -92,7 +91,6 @@ public class InPlanningBenchmark private static final Logger log = new Logger(InPlanningBenchmark.class); static { - NullHandling.initializeForTests(); ExpressionProcessing.initializeForTests(); } diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/query/MSQWindowFunctionsBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/query/MSQWindowFunctionsBenchmark.java index 0b2691d4bb7c..51380dc9192a 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/query/MSQWindowFunctionsBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/query/MSQWindowFunctionsBenchmark.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableMap; import com.google.inject.Injector; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.io.Closer; import org.apache.druid.java.util.common.logger.Logger; import org.apache.druid.msq.sql.MSQTaskSqlEngine; @@ -70,10 +69,6 @@ @SqlTestFrameworkConfig.ComponentSupplier(MSQWindowFunctionsBenchmark.MSQComponentSupplier.class) public class MSQWindowFunctionsBenchmark extends BaseCalciteQueryTest { - static { - NullHandling.initializeForTests(); - } - private static final Logger log = new Logger(MSQWindowFunctionsBenchmark.class); private final Closer closer = Closer.create(); diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/query/QueryBenchmarkUtil.java b/benchmarks/src/test/java/org/apache/druid/benchmark/query/QueryBenchmarkUtil.java index d3f10f40444e..21061898031c 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/query/QueryBenchmarkUtil.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/query/QueryBenchmarkUtil.java @@ -19,7 +19,6 @@ package org.apache.druid.benchmark.query; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.BySegmentQueryRunner; import org.apache.druid.query.FinalizeResultsQueryRunner; import org.apache.druid.query.Query; @@ -32,10 +31,6 @@ public class QueryBenchmarkUtil { - static { - NullHandling.initializeForTests(); - } - public static > QueryRunner makeQueryRunner( QueryRunnerFactory factory, SegmentId segmentId, diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/query/ScanBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/query/ScanBenchmark.java index 8143e4e8c757..a4e8162861aa 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/query/ScanBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/query/ScanBenchmark.java @@ -23,7 +23,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.Row; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.java.util.common.FileUtils; @@ -125,10 +124,6 @@ public class ScanBenchmark private static final IndexMergerV9 INDEX_MERGER_V9; private static final IndexIO INDEX_IO; - static { - NullHandling.initializeForTests(); - } - private AppendableIndexSpec appendableIndexSpec; private DataGenerator generator; private QueryRunnerFactory factory; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/query/SearchBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/query/SearchBenchmark.java index 9a383f119cb3..7c3a62da0410 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/query/SearchBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/query/SearchBenchmark.java @@ -25,7 +25,6 @@ import com.google.common.base.Suppliers; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.Row; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.java.util.common.FileUtils; @@ -126,10 +125,6 @@ public class SearchBenchmark private static final IndexIO INDEX_IO; public static final ObjectMapper JSON_MAPPER; - static { - NullHandling.initializeForTests(); - } - private AppendableIndexSpec appendableIndexSpec; private DataGenerator generator; private QueryRunnerFactory factory; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/query/SerializingQueryRunner.java b/benchmarks/src/test/java/org/apache/druid/benchmark/query/SerializingQueryRunner.java index 334621ba6007..2e22cb0da826 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/query/SerializingQueryRunner.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/query/SerializingQueryRunner.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.guava.Sequence; import org.apache.druid.java.util.common.guava.Sequences; import org.apache.druid.java.util.common.jackson.JacksonUtils; @@ -32,10 +31,6 @@ public class SerializingQueryRunner implements QueryRunner { - static { - NullHandling.initializeForTests(); - } - private final ObjectMapper smileMapper; private final QueryRunner baseRunner; private final Class clazz; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/query/SqlBaseBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/query/SqlBaseBenchmark.java index 430a6167c33c..05a31dda89d3 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/query/SqlBaseBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/query/SqlBaseBenchmark.java @@ -27,7 +27,6 @@ import com.google.inject.Injector; import com.google.inject.Key; import com.google.inject.multibindings.MapBinder; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.frame.FrameType; import org.apache.druid.frame.read.FrameReader; import org.apache.druid.frame.segment.FrameSegment; @@ -127,7 +126,6 @@ public class SqlBaseBenchmark private static final String STORAGE_FRAME_COLUMNAR = "FRAME_COLUMNAR"; static { - NullHandling.initializeForTests(); ExpressionProcessing.initializeForTests(); HllSketchModule.registerSerde(); SketchModule.registerSerde(); diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/query/SqlVsNativeBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/query/SqlVsNativeBenchmark.java index 2150b2100fb0..d9017cb4f28c 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/query/SqlVsNativeBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/query/SqlVsNativeBenchmark.java @@ -20,7 +20,6 @@ package org.apache.druid.benchmark.query; import com.google.common.collect.ImmutableSet; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.guava.Sequence; @@ -85,10 +84,6 @@ public class SqlVsNativeBenchmark private static final Logger log = new Logger(SqlVsNativeBenchmark.class); - static { - NullHandling.initializeForTests(); - } - private SpecificSegmentsQuerySegmentWalker walker; private SqlEngine engine; private PlannerFactory plannerFactory; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/query/TimeseriesBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/query/TimeseriesBenchmark.java index 5ea82211091f..e1657127e5b6 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/query/TimeseriesBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/query/TimeseriesBenchmark.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.java.util.common.FileUtils; import org.apache.druid.java.util.common.Intervals; @@ -123,10 +122,6 @@ public class TimeseriesBenchmark private static final IndexIO INDEX_IO; public static final ObjectMapper JSON_MAPPER; - static { - NullHandling.initializeForTests(); - } - private AppendableIndexSpec appendableIndexSpec; private DataGenerator generator; private QueryRunnerFactory factory; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/query/TopNBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/query/TopNBenchmark.java index 655b0d2a423f..4d3c9309dbee 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/query/TopNBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/query/TopNBenchmark.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.druid.collections.StupidPool; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.java.util.common.FileUtils; import org.apache.druid.java.util.common.concurrent.Execs; @@ -120,10 +119,6 @@ public class TopNBenchmark private static final IndexIO INDEX_IO; public static final ObjectMapper JSON_MAPPER; - static { - NullHandling.initializeForTests(); - } - private AppendableIndexSpec appendableIndexSpec; private DataGenerator generator; private QueryRunnerFactory factory; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/query/timecompare/TimeCompareBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/query/timecompare/TimeCompareBenchmark.java index 6baf2478ada1..99d4a02a712f 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/query/timecompare/TimeCompareBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/query/timecompare/TimeCompareBenchmark.java @@ -23,7 +23,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.druid.benchmark.query.QueryBenchmarkUtil; import org.apache.druid.collections.StupidPool; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.java.util.common.FileUtils; @@ -120,7 +119,6 @@ public class TimeCompareBenchmark protected static final Map SCRIPT_DOUBLE_SUM = new HashMap<>(); static { - NullHandling.initializeForTests(); SCRIPT_DOUBLE_SUM.put("fnAggregate", "function aggregate(current, a) { return current + a }"); SCRIPT_DOUBLE_SUM.put("fnReset", "function reset() { return 0 }"); SCRIPT_DOUBLE_SUM.put("fnCombine", "function combine(a,b) { return a + b }"); diff --git a/benchmarks/src/test/java/org/apache/druid/timeline/DimensionRangeShardSpecBenchmark.java b/benchmarks/src/test/java/org/apache/druid/timeline/DimensionRangeShardSpecBenchmark.java index d3a1c4c765d3..9ea11e48eef8 100644 --- a/benchmarks/src/test/java/org/apache/druid/timeline/DimensionRangeShardSpecBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/timeline/DimensionRangeShardSpecBenchmark.java @@ -23,7 +23,6 @@ import com.google.common.collect.ImmutableRangeSet; import com.google.common.collect.Range; import com.google.common.collect.RangeSet; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.StringTuple; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.query.filter.InDimFilter; @@ -101,8 +100,6 @@ public class DimensionRangeShardSpecBenchmark @Setup public void setUp() { - NullHandling.initializeForTests(); - final Set strings5k = new HashSet<>(); final Random random = new Random(0); // Random... ish. diff --git a/extensions-contrib/compressed-bigdecimal/src/test/java/org/apache/druid/compressedbigdecimal/CompressedBigDecimalAggregatorTimeseriesTestBase.java b/extensions-contrib/compressed-bigdecimal/src/test/java/org/apache/druid/compressedbigdecimal/CompressedBigDecimalAggregatorTimeseriesTestBase.java index 9231d2c7dffb..f12ebab406e9 100644 --- a/extensions-contrib/compressed-bigdecimal/src/test/java/org/apache/druid/compressedbigdecimal/CompressedBigDecimalAggregatorTimeseriesTestBase.java +++ b/extensions-contrib/compressed-bigdecimal/src/test/java/org/apache/druid/compressedbigdecimal/CompressedBigDecimalAggregatorTimeseriesTestBase.java @@ -21,7 +21,6 @@ import com.google.common.collect.Iterables; import com.google.common.io.Resources; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.guava.Sequence; import org.apache.druid.query.Result; @@ -51,10 +50,6 @@ public abstract class CompressedBigDecimalAggregatorTimeseriesTestBase extends I { private final AggregationTestHelper helper; - static { - NullHandling.initializeForTests(); - } - @Rule public final TemporaryFolder tempFolder = new TemporaryFolder(new File("target")); diff --git a/extensions-contrib/ddsketch/src/test/java/org/apache/druid/query/aggregation/ddsketch/DDSketchAggregatorTest.java b/extensions-contrib/ddsketch/src/test/java/org/apache/druid/query/aggregation/ddsketch/DDSketchAggregatorTest.java index 4cdcf5b6e9ba..96cb9e66f92a 100644 --- a/extensions-contrib/ddsketch/src/test/java/org/apache/druid/query/aggregation/ddsketch/DDSketchAggregatorTest.java +++ b/extensions-contrib/ddsketch/src/test/java/org/apache/druid/query/aggregation/ddsketch/DDSketchAggregatorTest.java @@ -20,7 +20,6 @@ package org.apache.druid.query.aggregation.ddsketch; import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.guava.Sequence; @@ -139,7 +138,7 @@ public void buildingSketchesAtIngestionTime() throws Exception double[] quantiles = (double[]) quantilesObject; Assert.assertEquals(0.001, quantiles[0], 0.0006); // min value - Assert.assertEquals(NullHandling.replaceWithDefault() ? 0.47 : 0.5, quantiles[1], 0.05); // median value + Assert.assertEquals(0.5, quantiles[1], 0.05); // median value Assert.assertEquals(1, quantiles[2], 0.05); // max value } diff --git a/extensions-contrib/materialized-view-selection/src/test/java/org/apache/druid/query/materializedview/DatasourceOptimizerTest.java b/extensions-contrib/materialized-view-selection/src/test/java/org/apache/druid/query/materializedview/DatasourceOptimizerTest.java index f67c9794b57a..2f2717365f19 100644 --- a/extensions-contrib/materialized-view-selection/src/test/java/org/apache/druid/query/materializedview/DatasourceOptimizerTest.java +++ b/extensions-contrib/materialized-view-selection/src/test/java/org/apache/druid/query/materializedview/DatasourceOptimizerTest.java @@ -35,7 +35,6 @@ import org.apache.druid.client.DruidServer; import org.apache.druid.client.selector.HighestPriorityTierSelectorStrategy; import org.apache.druid.client.selector.RandomServerSelectorStrategy; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.curator.CuratorTestBase; import org.apache.druid.indexing.materializedview.DerivativeDataSourceMetadata; import org.apache.druid.jackson.DefaultObjectMapper; @@ -77,10 +76,6 @@ public class DatasourceOptimizerTest extends CuratorTestBase { - static { - NullHandling.initializeForTests(); - } - @Rule public final TestDerbyConnector.DerbyConnectorRule derbyConnectorRule = new TestDerbyConnector.DerbyConnectorRule(); private DerivativeDataSourceManager derivativesManager; diff --git a/extensions-contrib/materialized-view-selection/src/test/java/org/apache/druid/query/materializedview/MaterializedViewQueryQueryToolChestTest.java b/extensions-contrib/materialized-view-selection/src/test/java/org/apache/druid/query/materializedview/MaterializedViewQueryQueryToolChestTest.java index 5fe15b63b630..ba534070da50 100644 --- a/extensions-contrib/materialized-view-selection/src/test/java/org/apache/druid/query/materializedview/MaterializedViewQueryQueryToolChestTest.java +++ b/extensions-contrib/materialized-view-selection/src/test/java/org/apache/druid/query/materializedview/MaterializedViewQueryQueryToolChestTest.java @@ -23,7 +23,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.base.Function; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.MapBasedRow; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.java.util.common.DateTimes; @@ -57,10 +56,6 @@ public class MaterializedViewQueryQueryToolChestTest extends InitializedNullHandlingTest { - static { - NullHandling.initializeForTests(); - } - private static final ObjectMapper JSON_MAPPER = new DefaultObjectMapper(); @Test diff --git a/extensions-contrib/materialized-view-selection/src/test/java/org/apache/druid/query/materializedview/MaterializedViewQueryTest.java b/extensions-contrib/materialized-view-selection/src/test/java/org/apache/druid/query/materializedview/MaterializedViewQueryTest.java index 8532574880a9..ad9913eca555 100644 --- a/extensions-contrib/materialized-view-selection/src/test/java/org/apache/druid/query/materializedview/MaterializedViewQueryTest.java +++ b/extensions-contrib/materialized-view-selection/src/test/java/org/apache/druid/query/materializedview/MaterializedViewQueryTest.java @@ -25,7 +25,6 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.HumanReadableBytes; import org.apache.druid.math.expr.ExprMacroTable; import org.apache.druid.query.Query; @@ -46,17 +45,9 @@ public class MaterializedViewQueryTest { - static { - NullHandling.initializeForTests(); - } - private static final ObjectMapper JSON_MAPPER = TestHelper.makeJsonMapper(); private DataSourceOptimizer optimizer; - static { - NullHandling.initializeForTests(); - } - @Before public void setUp() { diff --git a/extensions-contrib/momentsketch/src/test/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentsSketchAggregatorTest.java b/extensions-contrib/momentsketch/src/test/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentsSketchAggregatorTest.java index c764620d763f..c741b68074c3 100644 --- a/extensions-contrib/momentsketch/src/test/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentsSketchAggregatorTest.java +++ b/extensions-contrib/momentsketch/src/test/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentsSketchAggregatorTest.java @@ -20,7 +20,6 @@ package org.apache.druid.query.aggregation.momentsketch.aggregator; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.initialization.DruidModule; import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.guava.Sequence; @@ -46,7 +45,6 @@ @RunWith(Parameterized.class) public class MomentsSketchAggregatorTest extends InitializedNullHandlingTest { - private final boolean hasNulls = !NullHandling.replaceWithDefault(); private final AggregationTestHelper helper; @Rule @@ -133,7 +131,7 @@ public void buildingSketchesAtIngestionTime() throws Exception MomentSketchWrapper sketchObjectWithNulls = (MomentSketchWrapper) row.get(1); // "sketchWithNulls" // 23 null values (377 when nulls are not replaced with default) Assert.assertEquals( - NullHandling.replaceWithDefault() ? 400.0 : 377.0, + 377.0, sketchObjectWithNulls.getPowerSums()[0], 1e-10 ); @@ -150,16 +148,16 @@ public void buildingSketchesAtIngestionTime() throws Exception Assert.assertEquals(0.9969, maxValue, 0.0001); double[] quantilesArrayWithNulls = (double[]) row.get(5); // "quantilesWithNulls" - Assert.assertEquals(NullHandling.replaceWithDefault() ? 0.0 : 5.0, quantilesArrayWithNulls[0], 0.05); + Assert.assertEquals(5.0, quantilesArrayWithNulls[0], 0.05); Assert.assertEquals( - NullHandling.replaceWithDefault() ? 7.721400294818661d : 7.57, + 7.57, quantilesArrayWithNulls[1], 0.05 ); Assert.assertEquals(10.0, quantilesArrayWithNulls[2], 0.05); Double minValueWithNulls = (Double) row.get(6); // "minWithNulls" - Assert.assertEquals(NullHandling.replaceWithDefault() ? 0.0 : 5.0164, minValueWithNulls, 0.0001); + Assert.assertEquals(5.0164, minValueWithNulls, 0.0001); Double maxValueWithNulls = (Double) row.get(7); // "maxWithNulls" Assert.assertEquals(9.9788, maxValueWithNulls, 0.0001); @@ -217,9 +215,7 @@ public void buildingSketchesAtQueryTime() throws Exception MomentSketchWrapper sketchObjectWithNulls = (MomentSketchWrapper) row.get(1); // "sketchWithNulls" - // in default mode, all 385 rows have a number value so will be computed, but only 377 rows have actual values in - // sql null mode - Assert.assertEquals(hasNulls ? 377.0 : 385.0, sketchObjectWithNulls.getPowerSums()[0], 1e-10); + Assert.assertEquals(377.0, sketchObjectWithNulls.getPowerSums()[0], 1e-10); } } diff --git a/extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/MovingAverageQuery.java b/extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/MovingAverageQuery.java index cbd9272dd8d8..26cac80950c6 100644 --- a/extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/MovingAverageQuery.java +++ b/extensions-contrib/moving-average-query/src/main/java/org/apache/druid/query/movingaverage/MovingAverageQuery.java @@ -30,12 +30,12 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Iterables; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.Row; import org.apache.druid.java.util.common.IAE; import org.apache.druid.java.util.common.granularity.Granularity; import org.apache.druid.java.util.common.guava.Sequence; import org.apache.druid.java.util.common.guava.Sequences; +import org.apache.druid.java.util.common.logger.Logger; import org.apache.druid.query.BaseQuery; import org.apache.druid.query.DataSource; import org.apache.druid.query.Query; @@ -63,6 +63,7 @@ @JsonTypeName("movingAverage") public class MovingAverageQuery extends BaseQuery { + private static final Logger LOG = new Logger(MovingAverageQuery.class); public static final String MOVING_AVG_QUERY_TYPE = "movingAverage"; public static final String CTX_KEY_SORT_BY_DIMS_FIRST = "sortByDimsFirst"; @@ -105,12 +106,6 @@ public MovingAverageQuery( { super(dataSource, querySegmentSpec, context); - //TBD: Implement null awareness to respect the contract of this flag. - Preconditions.checkArgument( - NullHandling.replaceWithDefault(), - "movingAverage does not support druid.generic.useDefaultValueForNull=false" - ); - this.dimFilter = dimFilter; this.granularity = granularity; this.dimensions = dimensions == null ? ImmutableList.of() : dimensions; diff --git a/extensions-contrib/moving-average-query/src/test/java/org/apache/druid/query/movingaverage/MovingAverageIterableTest.java b/extensions-contrib/moving-average-query/src/test/java/org/apache/druid/query/movingaverage/MovingAverageIterableTest.java index 589b03d6d20e..9463bd87f71f 100644 --- a/extensions-contrib/moving-average-query/src/test/java/org/apache/druid/query/movingaverage/MovingAverageIterableTest.java +++ b/extensions-contrib/moving-average-query/src/test/java/org/apache/druid/query/movingaverage/MovingAverageIterableTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.movingaverage; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.MapBasedRow; import org.apache.druid.data.input.Row; import org.apache.druid.java.util.common.guava.Sequence; @@ -613,8 +612,6 @@ public void testMissingDaysAtBegining() @Test public void testMissingDaysInMiddle() { - System.setProperty("druid.generic.useDefaultValueForNull", "true"); - NullHandling.initializeForTests(); Map event1 = new HashMap<>(); Map event2 = new HashMap<>(); @@ -733,8 +730,6 @@ public void testWithFilteredAggregation() @Test public void testMissingDaysAtEnd() { - System.setProperty("druid.generic.useDefaultValueForNull", "true"); - NullHandling.initializeForTests(); Map event1 = new HashMap<>(); Map event2 = new HashMap<>(); @@ -799,12 +794,6 @@ public void testMissingDaysAtEnd() Assert.assertEquals("m", (result.getDimension("gender")).get(0)); Assert.assertEquals(5.0f, result.getMetric("movingAvgPageViews").floatValue(), 0.0f); - Assert.assertTrue(iter.hasNext()); - result = iter.next(); - Assert.assertEquals(JAN_6, result.getTimestamp()); - Assert.assertEquals("m", (result.getDimension("gender")).get(0)); - Assert.assertEquals(0.0f, result.getMetric("movingAvgPageViews").floatValue(), 0.0f); - Assert.assertFalse(iter.hasNext()); } } diff --git a/extensions-contrib/moving-average-query/src/test/java/org/apache/druid/query/movingaverage/MovingAverageQueryTest.java b/extensions-contrib/moving-average-query/src/test/java/org/apache/druid/query/movingaverage/MovingAverageQueryTest.java index d86b6913cfb0..1d645b2c7fd7 100644 --- a/extensions-contrib/moving-average-query/src/test/java/org/apache/druid/query/movingaverage/MovingAverageQueryTest.java +++ b/extensions-contrib/moving-average-query/src/test/java/org/apache/druid/query/movingaverage/MovingAverageQueryTest.java @@ -161,7 +161,6 @@ public QueryRunner getQueryRunnerForSegments(Query query, Iterable implements ColumnValueSelector @@ -36,22 +36,19 @@ abstract class MapVirtualColumnValueSelector implements ColumnValueSelector result = runner.run(QueryPlus.wrap(query)).toList(); - final List expected; - if (NullHandling.sqlCompatible()) { - expected = Collections.emptyList(); - } else { - expected = ImmutableList.of( - new MapBasedRow(DateTimes.of("2011-01-12T00:00:00.000Z"), MapVirtualColumnTestBase.mapOf("count", 2L)) - ).stream().map(row -> ResultRow.fromLegacyRow(row, query)).collect(Collectors.toList()); - } + final List expected = Collections.emptyList(); Assert.assertEquals(expected, result); } @@ -293,14 +285,7 @@ public void testWithSubColumnWithNotPredicateFilter() ); final List result = runner.run(QueryPlus.wrap(query)).toList(); - final List expected; - if (NullHandling.sqlCompatible()) { - expected = Collections.emptyList(); - } else { - expected = ImmutableList.of( - new MapBasedRow(DateTimes.of("2011-01-12T00:00:00.000Z"), MapVirtualColumnTestBase.mapOf("count", 2L)) - ).stream().map(row -> ResultRow.fromLegacyRow(row, query)).collect(Collectors.toList()); - } + final List expected = Collections.emptyList(); Assert.assertEquals(expected, result); } diff --git a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchBuildUtil.java b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchBuildUtil.java index bcd4c4eb6d90..e8a4a6ea8ee2 100644 --- a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchBuildUtil.java +++ b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchBuildUtil.java @@ -20,7 +20,6 @@ package org.apache.druid.query.aggregation.datasketches.hll; import org.apache.datasketches.hll.HllSketch; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.IAE; import org.apache.druid.java.util.common.StringEncoding; import org.apache.druid.java.util.common.StringUtils; @@ -85,7 +84,7 @@ private static void updateSketchWithString( @Nullable final String value ) { - if (NullHandling.isNullOrEquivalent(value)) { + if (value == null) { return; } diff --git a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/DoubleHllSketchBuildVectorProcessor.java b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/DoubleHllSketchBuildVectorProcessor.java index 7655a19992c0..f7645a1e1eb3 100644 --- a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/DoubleHllSketchBuildVectorProcessor.java +++ b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/DoubleHllSketchBuildVectorProcessor.java @@ -20,7 +20,6 @@ package org.apache.druid.query.aggregation.datasketches.hll.vector; import org.apache.datasketches.hll.HllSketch; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.aggregation.datasketches.hll.HllSketchBuildBufferAggregatorHelper; import org.apache.druid.segment.vector.VectorValueSelector; @@ -50,7 +49,7 @@ public void aggregate(ByteBuffer buf, int position, int startRow, int endRow) final HllSketch sketch = helper.getSketchAtPosition(buf, position); for (int i = startRow; i < endRow; i++) { - if (NullHandling.replaceWithDefault() || nullVector == null || !nullVector[i]) { + if (nullVector == null || !nullVector[i]) { sketch.update(vector[i]); } } @@ -64,7 +63,7 @@ public void aggregate(ByteBuffer buf, int numRows, int[] positions, @Nullable in for (int i = 0; i < numRows; i++) { final int idx = rows != null ? rows[i] : i; - if (NullHandling.replaceWithDefault() || nullVector == null || !nullVector[idx]) { + if (nullVector == null || !nullVector[idx]) { final int position = positions[i] + positionOffset; final HllSketch sketch = helper.getSketchAtPosition(buf, position); sketch.update(vector[idx]); diff --git a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/LongHllSketchBuildVectorProcessor.java b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/LongHllSketchBuildVectorProcessor.java index 398aef660b7c..81305050f689 100644 --- a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/LongHllSketchBuildVectorProcessor.java +++ b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/vector/LongHllSketchBuildVectorProcessor.java @@ -20,7 +20,6 @@ package org.apache.druid.query.aggregation.datasketches.hll.vector; import org.apache.datasketches.hll.HllSketch; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.aggregation.datasketches.hll.HllSketchBuildBufferAggregatorHelper; import org.apache.druid.segment.vector.VectorValueSelector; @@ -50,7 +49,7 @@ public void aggregate(ByteBuffer buf, int position, int startRow, int endRow) final HllSketch sketch = helper.getSketchAtPosition(buf, position); for (int i = startRow; i < endRow; i++) { - if (NullHandling.replaceWithDefault() || nullVector == null || !nullVector[i]) { + if (nullVector == null || !nullVector[i]) { sketch.update(vector[i]); } } @@ -64,7 +63,7 @@ public void aggregate(ByteBuffer buf, int numRows, int[] positions, @Nullable in for (int i = 0; i < numRows; i++) { final int idx = rows != null ? rows[i] : i; - if (NullHandling.replaceWithDefault() || nullVector == null || !nullVector[idx]) { + if (nullVector == null || !nullVector[idx]) { final int position = positions[i] + positionOffset; final HllSketch sketch = helper.getSketchAtPosition(buf, position); sketch.update(vector[idx]); diff --git a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchAggregator.java b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchAggregator.java index 32344e408294..8e55f1324354 100644 --- a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchAggregator.java +++ b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchAggregator.java @@ -22,7 +22,6 @@ import org.apache.datasketches.common.Family; import org.apache.datasketches.theta.SetOperation; import org.apache.datasketches.theta.Union; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.ISE; import org.apache.druid.query.aggregation.Aggregator; import org.apache.druid.segment.BaseObjectColumnValueSelector; @@ -152,7 +151,7 @@ static void updateUnion(Union union, Object update) for (Object entry : (List) update) { if (entry != null) { final String asString = entry.toString(); - if (!NullHandling.isNullOrEquivalent(asString)) { + if (asString != null) { union.update(asString); } } diff --git a/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchSqlAggregatorTest.java b/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchSqlAggregatorTest.java index 986fc4520ee3..aa6a05469fe7 100644 --- a/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchSqlAggregatorTest.java +++ b/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchSqlAggregatorTest.java @@ -23,7 +23,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.inject.Injector; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; import org.apache.druid.initialization.DruidModule; import org.apache.druid.java.util.common.Intervals; @@ -103,10 +102,6 @@ @SqlTestFrameworkConfig.ComponentSupplier(HllSketchComponentSupplier.class) public class HllSketchSqlAggregatorTest extends BaseCalciteQueryTest { - static { - NullHandling.initializeForTests(); - } - private static final boolean ROUND = true; // For testHllSketchPostAggsGroupBy, testHllSketchPostAggsTimeseries @@ -334,17 +329,9 @@ public void testApproxCountDistinctHllSketch() + " APPROX_COUNT_DISTINCT_DS_HLL(hllsketch_dim1, CAST(21 AS BIGINT))\n" // also native column + "FROM druid.foo"; - final List expectedResults; - - if (NullHandling.replaceWithDefault()) { - expectedResults = ImmutableList.of( - new Object[]{6L, 2L, 2L, 1L, 2L, 5L, 5L, 5L} - ); - } else { - expectedResults = ImmutableList.of( - new Object[]{6L, 2L, 2L, 1L, 1L, 5L, 5L, 5L} - ); - } + final List expectedResults = ImmutableList.of( + new Object[]{6L, 2L, 2L, 1L, 1L, 5L, 5L, 5L} + ); testQuery( sql, @@ -456,12 +443,7 @@ public void testAvgDailyCountDistinctHllSketch() .setInterval(new MultipleIntervalSegmentSpec(ImmutableList.of(Filtration.eternity()))) .setGranularity(Granularities.ALL) .setAggregatorSpecs( - NullHandling.replaceWithDefault() - ? Arrays.asList( - new DoubleSumAggregatorFactory("_a0:sum", "a0"), - new CountAggregatorFactory("_a0:count") - ) - : Arrays.asList( + Arrays.asList( new DoubleSumAggregatorFactory("_a0:sum", "a0"), new FilteredAggregatorFactory( new CountAggregatorFactory("_a0:count"), @@ -513,14 +495,10 @@ public void testApproxCountDistinctHllSketchIsRounded() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.sqlCompatible() - ? ImmutableList.of( + ImmutableList.of( new Object[]{null, 2L}, new Object[]{"a", 2L} ) - : ImmutableList.of( - new Object[]{"a", 2L} - ) ); } @@ -904,7 +882,7 @@ public void testEmptyTimeseriesResults() ImmutableList.of(Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE1) .intervals(querySegmentSpec(Filtration.eternity())) - .filters(numericEquality("dim2", 0L, ColumnType.LONG)) + .filters(equality("dim2", 0L, ColumnType.LONG)) .granularity(Granularities.ALL) .aggregators( aggregators( diff --git a/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchAggregatorTest.java b/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchAggregatorTest.java index f0efcab2dcfb..c59e8944e645 100644 --- a/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchAggregatorTest.java +++ b/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/kll/KllDoublesSketchAggregatorTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.guava.Sequence; @@ -363,7 +362,7 @@ public void buildingSketchesAtQueryTime() throws Exception Object sketchObjectWithNulls = row.get(1); Assert.assertTrue(sketchObjectWithNulls instanceof Long); long sketchValueWithNulls = (long) sketchObjectWithNulls; - Assert.assertEquals(NullHandling.replaceWithDefault() ? 400 : 355, sketchValueWithNulls); + Assert.assertEquals(355, sketchValueWithNulls); // post agg Object quantileObject = row.get(2); @@ -391,7 +390,7 @@ public void buildingSketchesAtQueryTime() throws Exception Object quantileObjectWithNulls = row.get(5); Assert.assertTrue(quantileObjectWithNulls instanceof Double); Assert.assertEquals( - NullHandling.replaceWithDefault() ? 7.2 : 7.5, + 7.5, (double) quantileObjectWithNulls, 0.1 ); // median value @@ -400,8 +399,8 @@ public void buildingSketchesAtQueryTime() throws Exception Object quantilesObjectWithNulls = row.get(6); Assert.assertTrue(quantilesObjectWithNulls instanceof double[]); double[] quantilesWithNulls = (double[]) quantilesObjectWithNulls; - Assert.assertEquals(NullHandling.replaceWithDefault() ? 0.0 : 5.0, quantilesWithNulls[0], 0.05); // min value - Assert.assertEquals(NullHandling.replaceWithDefault() ? 7.2 : 7.5, quantilesWithNulls[1], 0.1); // median value + Assert.assertEquals(5.0, quantilesWithNulls[0], 0.05); // min value + Assert.assertEquals(7.5, quantilesWithNulls[1], 0.1); // median value Assert.assertEquals(10.0, quantilesWithNulls[2], 0.05); // max value // post agg with nulls diff --git a/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchAggregatorTest.java b/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchAggregatorTest.java index a7fd46af258f..3885c5bc33ff 100644 --- a/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchAggregatorTest.java +++ b/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/kll/KllFloatsSketchAggregatorTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.guava.Sequence; @@ -363,7 +362,7 @@ public void buildingSketchesAtQueryTime() throws Exception Object sketchObjectWithNulls = row.get(1); Assert.assertTrue(sketchObjectWithNulls instanceof Long); long sketchValueWithNulls = (long) sketchObjectWithNulls; - Assert.assertEquals(NullHandling.replaceWithDefault() ? 400 : 355, sketchValueWithNulls); + Assert.assertEquals(355, sketchValueWithNulls); // post agg Object quantileObject = row.get(2); @@ -391,7 +390,7 @@ public void buildingSketchesAtQueryTime() throws Exception Object quantileObjectWithNulls = row.get(5); Assert.assertTrue(quantileObjectWithNulls instanceof Float); Assert.assertEquals( - NullHandling.replaceWithDefault() ? 7.2f : 7.5f, + 7.5f, (float) quantileObjectWithNulls, 0.1 ); // median value @@ -400,8 +399,8 @@ public void buildingSketchesAtQueryTime() throws Exception Object quantilesObjectWithNulls = row.get(6); Assert.assertTrue(quantilesObjectWithNulls instanceof float[]); float[] quantilesWithNulls = (float[]) quantilesObjectWithNulls; - Assert.assertEquals(NullHandling.replaceWithDefault() ? 0 : 5f, quantilesWithNulls[0], 0.05); // min value - Assert.assertEquals(NullHandling.replaceWithDefault() ? 7.2f : 7.5f, quantilesWithNulls[1], 0.1); // median value + Assert.assertEquals(5f, quantilesWithNulls[0], 0.05); // min value + Assert.assertEquals(7.5f, quantilesWithNulls[1], 0.1); // median value Assert.assertEquals(10f, quantilesWithNulls[2], 0.05); // max value // post agg with nulls diff --git a/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchAggregatorTest.java b/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchAggregatorTest.java index 5173c492dd7c..b4892297bed1 100644 --- a/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchAggregatorTest.java +++ b/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchAggregatorTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.guava.Sequence; @@ -362,7 +361,7 @@ public void buildingSketchesAtQueryTime() throws Exception Object sketchObjectWithNulls = row.get(1); Assert.assertTrue(sketchObjectWithNulls instanceof Long); long sketchValueWithNulls = (long) sketchObjectWithNulls; - Assert.assertEquals(NullHandling.replaceWithDefault() ? 400 : 377, sketchValueWithNulls); + Assert.assertEquals(377, sketchValueWithNulls); // post agg Object quantileObject = row.get(2); @@ -390,7 +389,7 @@ public void buildingSketchesAtQueryTime() throws Exception Object quantileObjectWithNulls = row.get(5); Assert.assertTrue(quantileObjectWithNulls instanceof Double); Assert.assertEquals( - NullHandling.replaceWithDefault() ? 7.4 : 7.5, + 7.5, (double) quantileObjectWithNulls, 0.1 ); // median value @@ -399,8 +398,8 @@ public void buildingSketchesAtQueryTime() throws Exception Object quantilesObjectWithNulls = row.get(6); Assert.assertTrue(quantilesObjectWithNulls instanceof double[]); double[] quantilesWithNulls = (double[]) quantilesObjectWithNulls; - Assert.assertEquals(NullHandling.replaceWithDefault() ? 0.0 : 5.0, quantilesWithNulls[0], 0.05); // min value - Assert.assertEquals(NullHandling.replaceWithDefault() ? 7.4 : 7.5, quantilesWithNulls[1], 0.1); // median value + Assert.assertEquals(5.0, quantilesWithNulls[0], 0.05); // min value + Assert.assertEquals(7.5, quantilesWithNulls[1], 0.1); // median value Assert.assertEquals(10.0, quantilesWithNulls[2], 0.05); // max value // post agg with nulls diff --git a/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchSqlAggregatorTest.java b/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchSqlAggregatorTest.java index f35c16b8097a..26fffde8deb7 100644 --- a/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchSqlAggregatorTest.java +++ b/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/quantiles/sql/DoublesSketchSqlAggregatorTest.java @@ -22,7 +22,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.inject.Injector; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.initialization.DruidModule; import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.granularity.Granularities; @@ -412,34 +411,18 @@ public void testSubqueryWithNestedGroupBy() @Test public void testQuantileOnCastedString() { - final List expectedResults; - if (NullHandling.replaceWithDefault()) { - expectedResults = ImmutableList.of( - new Object[]{ - 0.0, - 0.0, - 10.1, - 10.1, - 20.2, - 0.0, - 10.1, - 0.0 - } - ); - } else { - expectedResults = ImmutableList.of( - new Object[]{ - 1.0, - 2.0, - 10.1, - 10.1, - 20.2, - Double.NaN, - 2.0, - Double.NaN - } - ); - } + final List expectedResults = ImmutableList.of( + new Object[]{ + 1.0, + 2.0, + 10.1, + 10.1, + 20.2, + Double.NaN, + 2.0, + Double.NaN + } + ); testQuery( "SELECT\n" @@ -505,12 +488,7 @@ public void testQuantileOnCastedString() @Test public void testQuantileOnInnerQuery() { - final List expectedResults; - if (NullHandling.replaceWithDefault()) { - expectedResults = ImmutableList.of(new Object[]{7.0, 11.0}); - } else { - expectedResults = ImmutableList.of(new Object[]{5.25, 8.0}); - } + final List expectedResults = ImmutableList.of(new Object[]{5.25, 8.0}); testQuery( "SELECT AVG(x), APPROX_QUANTILE_DS(x, 0.98)\n" @@ -537,8 +515,6 @@ public void testQuantileOnInnerQuery() .setGranularity(Granularities.ALL) .setAggregatorSpecs( new DoubleSumAggregatorFactory("_a0:sum", "a0"), - NullHandling.replaceWithDefault() ? - new CountAggregatorFactory("_a0:count") : new FilteredAggregatorFactory( new CountAggregatorFactory("_a0:count"), notNull("a0") @@ -892,7 +868,7 @@ public void testEmptyTimeseriesResults() .dataSource(CalciteTests.DATASOURCE1) .intervals(new MultipleIntervalSegmentSpec(ImmutableList.of(Filtration.eternity()))) .granularity(Granularities.ALL) - .filters(numericEquality("dim2", 0L, ColumnType.LONG)) + .filters(equality("dim2", 0L, ColumnType.LONG)) .aggregators(ImmutableList.of( new DoublesSketchAggregatorFactory("a0:agg", "m1", null), new DoublesSketchAggregatorFactory("a1:agg", "qsketch_m1", null), @@ -939,7 +915,7 @@ public void testEmptyTimeseriesResultsWithFinalizeSketches() .dataSource(CalciteTests.DATASOURCE1) .intervals(new MultipleIntervalSegmentSpec(ImmutableList.of(Filtration.eternity()))) .granularity(Granularities.ALL) - .filters(numericEquality("dim2", 0L, ColumnType.LONG)) + .filters(equality("dim2", 0L, ColumnType.LONG)) .aggregators(ImmutableList.of( new DoublesSketchAggregatorFactory("a0:agg", "m1", null), new DoublesSketchAggregatorFactory("a1:agg", "qsketch_m1", null), diff --git a/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/theta/sql/ThetaSketchSqlAggregatorTest.java b/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/theta/sql/ThetaSketchSqlAggregatorTest.java index 2bc06042f23c..70a9d8c762c7 100644 --- a/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/theta/sql/ThetaSketchSqlAggregatorTest.java +++ b/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/theta/sql/ThetaSketchSqlAggregatorTest.java @@ -22,7 +22,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.inject.Injector; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; import org.apache.druid.initialization.DruidModule; import org.apache.druid.java.util.common.Intervals; @@ -194,33 +193,17 @@ public void testApproxCountDistinctThetaSketch() // on native theta sketch column + "FROM druid.foo"; - final List expectedResults; - - if (NullHandling.replaceWithDefault()) { - expectedResults = ImmutableList.of( - new Object[]{ - 6L, - 2L, - 2L, - 1L, - 2L, - 5L, - 5L - } - ); - } else { - expectedResults = ImmutableList.of( - new Object[]{ - 6L, - 2L, - 2L, - 1L, - 1L, - 5L, - 5L - } - ); - } + final List expectedResults = ImmutableList.of( + new Object[]{ + 6L, + 2L, + 2L, + 1L, + 1L, + 5L, + 5L + } + ); testQuery( sql, @@ -354,12 +337,7 @@ public void testAvgDailyCountDistinctThetaSketch() .setInterval(new MultipleIntervalSegmentSpec(ImmutableList.of(Filtration.eternity()))) .setGranularity(Granularities.ALL) .setAggregatorSpecs( - NullHandling.replaceWithDefault() - ? Arrays.asList( - new DoubleSumAggregatorFactory("_a0:sum", "a0"), - new CountAggregatorFactory("_a0:count") - ) - : Arrays.asList( + Arrays.asList( new DoubleSumAggregatorFactory("_a0:sum", "a0"), new FilteredAggregatorFactory( new CountAggregatorFactory("_a0:count"), @@ -416,37 +394,19 @@ public void testApproxCountDistinctFunctionOnUnsupportedComplexColumn() @Test public void testThetaSketchPostAggs() { - final List expectedResults; - - if (NullHandling.replaceWithDefault()) { - expectedResults = ImmutableList.of( - new Object[]{ - 6L, - 2.0d, - 3.0d, - "{\"estimate\":2.0,\"highBound\":2.0,\"lowBound\":2.0,\"numStdDev\":10}", - "\"AQMDAAA6zJOQxkPsNomrZQ==\"", - "\"AgMDAAAazJMGAAAAAACAP1XTBztMIcMJ+HOoBBne1zKQxkPsNomrZUeWbJt3n+VpF8EdUoUHAXvxsLkOSE0lfQ==\"", - "\"AQMDAAA6zJMXwR1ShQcBew==\"", - "\"AQMDAAA6zJOQxkPsNomrZQ==\"", - 1.0d - } - ); - } else { - expectedResults = ImmutableList.of( - new Object[]{ - 6L, - 2.0d, - 3.0d, - "{\"estimate\":2.0,\"highBound\":2.0,\"lowBound\":2.0,\"numStdDev\":10}", - "\"AQMDAAA6zJOQxkPsNomrZQ==\"", - "\"AgMDAAAazJMGAAAAAACAP1XTBztMIcMJ+HOoBBne1zKQxkPsNomrZUeWbJt3n+VpF8EdUoUHAXvxsLkOSE0lfQ==\"", - "\"AQMDAAA6zJMXwR1ShQcBew==\"", - "\"AQMDAAA6zJOQxkPsNomrZQ==\"", - 1.0d - } - ); - } + final List expectedResults = ImmutableList.of( + new Object[]{ + 6L, + 2.0d, + 3.0d, + "{\"estimate\":2.0,\"highBound\":2.0,\"lowBound\":2.0,\"numStdDev\":10}", + "\"AQMDAAA6zJOQxkPsNomrZQ==\"", + "\"AgMDAAAazJMGAAAAAACAP1XTBztMIcMJ+HOoBBne1zKQxkPsNomrZUeWbJt3n+VpF8EdUoUHAXvxsLkOSE0lfQ==\"", + "\"AQMDAAA6zJMXwR1ShQcBew==\"", + "\"AQMDAAA6zJOQxkPsNomrZQ==\"", + 1.0d + } + ); testQuery( "SELECT\n" @@ -592,37 +552,19 @@ public void testThetaSketchPostAggsFinalizeOuterSketches() .put(SketchQueryContext.CTX_FINALIZE_OUTER_SKETCHES, true) .build(); - final List expectedResults; - - if (NullHandling.replaceWithDefault()) { - expectedResults = ImmutableList.of( - new Object[]{ - 6L, - 2.0d, - 3.0d, - "{\"estimate\":2.0,\"highBound\":2.0,\"lowBound\":2.0,\"numStdDev\":10}", - "\"AQMDAAA6zJOQxkPsNomrZQ==\"", - "\"AgMDAAAazJMGAAAAAACAP1XTBztMIcMJ+HOoBBne1zKQxkPsNomrZUeWbJt3n+VpF8EdUoUHAXvxsLkOSE0lfQ==\"", - "\"AQMDAAA6zJMXwR1ShQcBew==\"", - "\"AQMDAAA6zJOQxkPsNomrZQ==\"", - 1.0d - } - ); - } else { - expectedResults = ImmutableList.of( - new Object[]{ - 6L, - 2.0d, - 3.0d, - "{\"estimate\":2.0,\"highBound\":2.0,\"lowBound\":2.0,\"numStdDev\":10}", - "\"AQMDAAA6zJOQxkPsNomrZQ==\"", - "\"AgMDAAAazJMGAAAAAACAP1XTBztMIcMJ+HOoBBne1zKQxkPsNomrZUeWbJt3n+VpF8EdUoUHAXvxsLkOSE0lfQ==\"", - "\"AQMDAAA6zJMXwR1ShQcBew==\"", - "\"AQMDAAA6zJOQxkPsNomrZQ==\"", - 1.0d - } - ); - } + final List expectedResults = ImmutableList.of( + new Object[]{ + 6L, + 2.0d, + 3.0d, + "{\"estimate\":2.0,\"highBound\":2.0,\"lowBound\":2.0,\"numStdDev\":10}", + "\"AQMDAAA6zJOQxkPsNomrZQ==\"", + "\"AgMDAAAazJMGAAAAAACAP1XTBztMIcMJ+HOoBBne1zKQxkPsNomrZUeWbJt3n+VpF8EdUoUHAXvxsLkOSE0lfQ==\"", + "\"AQMDAAA6zJMXwR1ShQcBew==\"", + "\"AQMDAAA6zJOQxkPsNomrZQ==\"", + 1.0d + } + ); testQuery( "SELECT\n" @@ -880,7 +822,7 @@ public void testEmptyTimeseriesResults() .dataSource(CalciteTests.DATASOURCE1) .intervals(new MultipleIntervalSegmentSpec(ImmutableList.of(Filtration.eternity()))) .granularity(Granularities.ALL) - .filters(numericEquality("dim2", 0L, ColumnType.LONG)) + .filters(equality("dim2", 0L, ColumnType.LONG)) .aggregators( ImmutableList.of( new SketchMergeAggregatorFactory( @@ -1113,7 +1055,7 @@ public void testThetaSketchEstimateAsVirtualColumn() .build() ), ImmutableList.of( - NullHandling.replaceWithDefault() ? new Object[]{null} : new Object[]{0.0D}, + new Object[]{0.0D}, new Object[]{1.0D}, new Object[]{1.0D}, new Object[]{1.0D}, diff --git a/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchAggregationTest.java b/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchAggregationTest.java index e0e419a0b7c0..bcf17bb3ae99 100755 --- a/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchAggregationTest.java +++ b/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchAggregationTest.java @@ -20,7 +20,6 @@ package org.apache.druid.query.aggregation.datasketches.tuple; import org.apache.datasketches.quantiles.DoublesSketch; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.initialization.DruidModule; import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.guava.Sequence; @@ -663,10 +662,10 @@ public void buildingSketchesAtIngestionTimeThreeValuesAndNulls() throws Exceptio List results = seq.toList(); Assert.assertEquals(1, results.size()); ResultRow row = results.get(0); - Assert.assertEquals("sketch", NullHandling.replaceWithDefault() ? 40.0 : 30.0, (double) row.get(0), 0); - Assert.assertEquals("estimate", NullHandling.replaceWithDefault() ? 40.0 : 30.0, (double) row.get(1), 0); - Assert.assertEquals("union", NullHandling.replaceWithDefault() ? 40.0 : 30.0, (double) row.get(3), 0); - Assert.assertEquals("intersection", NullHandling.replaceWithDefault() ? 40.0 : 30.0, (double) row.get(4), 0); + Assert.assertEquals("sketch", 30.0, (double) row.get(0), 0); + Assert.assertEquals("estimate", 30.0, (double) row.get(1), 0); + Assert.assertEquals("union", 30.0, (double) row.get(3), 0); + Assert.assertEquals("intersection", 30.0, (double) row.get(4), 0); Assert.assertEquals("anotb", 0, (double) row.get(5), 0); Object meansObj = row.get(6); // means @@ -675,20 +674,20 @@ public void buildingSketchesAtIngestionTimeThreeValuesAndNulls() throws Exceptio Assert.assertEquals(3, means.length); Assert.assertEquals(1.0, means[0], 0); Assert.assertEquals(2.0, means[1], 0); - Assert.assertEquals(NullHandling.replaceWithDefault() ? 2.25 : 3.0, means[2], 0.1); + Assert.assertEquals(3.0, means[2], 0.1); Object obj = row.get(2); // quantiles-sketch Assert.assertTrue(obj instanceof DoublesSketch); DoublesSketch ds = (DoublesSketch) obj; - Assert.assertEquals(NullHandling.replaceWithDefault() ? 40 : 30, ds.getN()); + Assert.assertEquals(30, ds.getN()); Assert.assertEquals(2.0, ds.getMinItem(), 0); Assert.assertEquals(2.0, ds.getMaxItem(), 0); Object objSketch2 = row.get(7); // quantiles-sketch-with-nulls Assert.assertTrue(objSketch2 instanceof DoublesSketch); DoublesSketch ds2 = (DoublesSketch) objSketch2; - Assert.assertEquals(NullHandling.replaceWithDefault() ? 40 : 30, ds2.getN()); - Assert.assertEquals(NullHandling.replaceWithDefault() ? 0.0 : 3.0, ds2.getMinItem(), 0); + Assert.assertEquals(30, ds2.getN()); + Assert.assertEquals(3.0, ds2.getMinItem(), 0); Assert.assertEquals(3.0, ds2.getMaxItem(), 0); } @@ -1207,12 +1206,12 @@ public void buildingSketchesAtQueryTimeWithNullsTest() throws Exception List results = seq.toList(); Assert.assertEquals(1, results.size()); ResultRow row = results.get(0); - Assert.assertEquals("sketch", NullHandling.replaceWithDefault() ? 40.0 : 30.0, (double) row.get(0), 0); + Assert.assertEquals("sketch", 30.0, (double) row.get(0), 0); Assert.assertEquals("sketchNoNulls", 40.0, (double) row.get(1), 0); - Assert.assertEquals("estimate", NullHandling.replaceWithDefault() ? 40.0 : 30.0, (double) row.get(2), 0); + Assert.assertEquals("estimate", 30.0, (double) row.get(2), 0); Assert.assertEquals("estimateNoNulls", 40.0, (double) row.get(3), 0); - Assert.assertEquals("union", NullHandling.replaceWithDefault() ? 40.0 : 30.0, (double) row.get(5), 0); - Assert.assertEquals("intersection", NullHandling.replaceWithDefault() ? 40.0 : 30.0, (double) row.get(6), 0); + Assert.assertEquals("union", 30.0, (double) row.get(5), 0); + Assert.assertEquals("intersection", 30.0, (double) row.get(6), 0); Assert.assertEquals("anotb", 0, (double) row.get(7), 0); Object meansObj = row.get(8); // means @@ -1221,20 +1220,20 @@ public void buildingSketchesAtQueryTimeWithNullsTest() throws Exception Assert.assertEquals(3, means.length); Assert.assertEquals(1.0, means[0], 0); Assert.assertEquals(2.0, means[1], 0); - Assert.assertEquals(NullHandling.replaceWithDefault() ? 2.25 : 3.0, means[2], 0.1); + Assert.assertEquals(3.0, means[2], 0.1); Object obj = row.get(4); // quantiles-sketch Assert.assertTrue(obj instanceof DoublesSketch); DoublesSketch ds = (DoublesSketch) obj; - Assert.assertEquals(NullHandling.replaceWithDefault() ? 40 : 30, ds.getN()); + Assert.assertEquals(30, ds.getN()); Assert.assertEquals(2.0, ds.getMinItem(), 0); Assert.assertEquals(2.0, ds.getMaxItem(), 0); Object objSketch2 = row.get(9); // quantiles-sketch-with-nulls Assert.assertTrue(objSketch2 instanceof DoublesSketch); DoublesSketch ds2 = (DoublesSketch) objSketch2; - Assert.assertEquals(NullHandling.replaceWithDefault() ? 40 : 30, ds2.getN()); - Assert.assertEquals(NullHandling.replaceWithDefault() ? 0.0 : 3.0, ds2.getMinItem(), 0); + Assert.assertEquals(30, ds2.getN()); + Assert.assertEquals(3.0, ds2.getMinItem(), 0); Assert.assertEquals(3.0, ds2.getMaxItem(), 0); Object objSketch3 = row.get(10); // quantiles-sketch-no-nulls diff --git a/extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/aggregation/bloom/DoubleBloomFilterAggregator.java b/extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/aggregation/bloom/DoubleBloomFilterAggregator.java index 8aa899e1633d..94615079e191 100644 --- a/extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/aggregation/bloom/DoubleBloomFilterAggregator.java +++ b/extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/aggregation/bloom/DoubleBloomFilterAggregator.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.bloom; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.filter.BloomKFilter; import org.apache.druid.segment.BaseDoubleColumnValueSelector; @@ -35,10 +34,10 @@ public final class DoubleBloomFilterAggregator extends BaseBloomFilterAggregator @Override public void bufferAdd(ByteBuffer buf) { - if (NullHandling.replaceWithDefault() || !selector.isNull()) { - BloomKFilter.addDouble(buf, selector.getDouble()); - } else { + if (selector.isNull()) { BloomKFilter.addBytes(buf, null, 0, 0); + } else { + BloomKFilter.addDouble(buf, selector.getDouble()); } } } diff --git a/extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/aggregation/bloom/FloatBloomFilterAggregator.java b/extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/aggregation/bloom/FloatBloomFilterAggregator.java index 0a7c042144a9..47f34a75204a 100644 --- a/extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/aggregation/bloom/FloatBloomFilterAggregator.java +++ b/extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/aggregation/bloom/FloatBloomFilterAggregator.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.bloom; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.filter.BloomKFilter; import org.apache.druid.segment.BaseFloatColumnValueSelector; @@ -35,10 +34,10 @@ public final class FloatBloomFilterAggregator extends BaseBloomFilterAggregator< @Override public void bufferAdd(ByteBuffer buf) { - if (NullHandling.replaceWithDefault() || !selector.isNull()) { - BloomKFilter.addFloat(buf, selector.getFloat()); - } else { + if (selector.isNull()) { BloomKFilter.addBytes(buf, null, 0, 0); + } else { + BloomKFilter.addFloat(buf, selector.getFloat()); } } } diff --git a/extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/aggregation/bloom/LongBloomFilterAggregator.java b/extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/aggregation/bloom/LongBloomFilterAggregator.java index 3e232ce5082b..b4a7e2aac900 100644 --- a/extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/aggregation/bloom/LongBloomFilterAggregator.java +++ b/extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/aggregation/bloom/LongBloomFilterAggregator.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.bloom; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.filter.BloomKFilter; import org.apache.druid.segment.BaseLongColumnValueSelector; @@ -35,10 +34,10 @@ public final class LongBloomFilterAggregator extends BaseBloomFilterAggregator VALUES1 = dimensionValues( "a", "b", "c", "a", "a", - NULLISH, + null, "b", "b", "b", @@ -81,8 +79,8 @@ public class BloomFilterAggregatorTest extends InitializedNullHandlingTest "a", "e", "b", - new String[]{NULLISH, "x"}, - new String[]{"x", NULLISH}, + new String[]{null, "x"}, + new String[]{"x", null}, new String[]{"y", "x"}, new String[]{"x", "y"}, new String[]{"x", "y", "a"} @@ -144,12 +142,12 @@ private static void createStringFilter(List values, BloomKFilter filte { for (String[] vals : values) { for (String val : vals) { - if (!NullHandling.replaceWithDefault() && val == null) { + if (val == null) { filter.addBytes(null, 0, 0); combinedValuesFilter.addBytes(null, 0, 0); } else { - filter.addString(NullHandling.nullToEmptyIfNeeded(val)); - combinedValuesFilter.addString(NullHandling.nullToEmptyIfNeeded(val)); + filter.addString(val); + combinedValuesFilter.addString(val); } } } diff --git a/extensions-core/druid-bloom-filter/src/test/java/org/apache/druid/query/aggregation/bloom/sql/BloomFilterSqlAggregatorTest.java b/extensions-core/druid-bloom-filter/src/test/java/org/apache/druid/query/aggregation/bloom/sql/BloomFilterSqlAggregatorTest.java index d0e5690e25e9..35abc25de464 100644 --- a/extensions-core/druid-bloom-filter/src/test/java/org/apache/druid/query/aggregation/bloom/sql/BloomFilterSqlAggregatorTest.java +++ b/extensions-core/druid-bloom-filter/src/test/java/org/apache/druid/query/aggregation/bloom/sql/BloomFilterSqlAggregatorTest.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableList; import com.google.inject.Injector; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.guice.BloomFilterExtensionModule; import org.apache.druid.initialization.DruidModule; @@ -127,7 +126,7 @@ public void testBloomFilterAgg() throws Exception BloomKFilter expectedbl1 = new BloomKFilter(TEST_NUM_ENTRIES); for (InputRow row : TestDataBuilder.ROWS1_WITH_NUMERIC_DIMS) { - String raw = NullHandling.emptyToNullIfNeeded((String) row.getRaw("dim1")); + String raw = (String) row.getRaw("dim1"); if (raw == null) { expectedbl1.addBytes(null, 0, 0); } else { @@ -174,7 +173,7 @@ public void testBloomFilterTwoAggs() throws Exception BloomKFilter expectedbl1 = new BloomKFilter(TEST_NUM_ENTRIES); BloomKFilter expected2 = new BloomKFilter(TEST_NUM_ENTRIES); for (InputRow row : TestDataBuilder.ROWS1_WITH_NUMERIC_DIMS) { - String raw = NullHandling.emptyToNullIfNeeded((String) row.getRaw("dim1")); + String raw = (String) row.getRaw("dim1"); if (raw == null) { expectedbl1.addBytes(null, 0, 0); } else { @@ -185,11 +184,10 @@ public void testBloomFilterTwoAggs() throws Exception expected2.addBytes(null, 0, 0); } for (String s : lst) { - String val = NullHandling.emptyToNullIfNeeded(s); - if (val == null) { + if (s == null) { expected2.addBytes(null, 0, 0); } else { - expected2.addString(val); + expected2.addString(s); } } } @@ -237,7 +235,7 @@ public void testBloomFilterAggExtractionFn() throws Exception BloomKFilter expectedbl1 = new BloomKFilter(TEST_NUM_ENTRIES); for (InputRow row : TestDataBuilder.ROWS1_WITH_NUMERIC_DIMS) { - String raw = NullHandling.emptyToNullIfNeeded((String) row.getRaw("dim1")); + String raw = (String) row.getRaw("dim1"); // empty string extractionFn produces null if (raw == null || "".equals(raw)) { expectedbl1.addBytes(null, 0, 0); @@ -286,11 +284,7 @@ public void testBloomFilterAggLong() throws Exception for (InputRow row : TestDataBuilder.ROWS1_WITH_NUMERIC_DIMS) { Object raw = row.getRaw("l1"); if (raw == null) { - if (NullHandling.replaceWithDefault()) { - expected3.addLong(NullHandling.defaultLongValue()); - } else { - expected3.addBytes(null, 0, 0); - } + expected3.addBytes(null, 0, 0); } else { expected3.addLong(((Number) raw).longValue()); } @@ -331,11 +325,7 @@ public void testBloomFilterAggLongVirtualColumn() throws Exception for (InputRow row : TestDataBuilder.ROWS1_WITH_NUMERIC_DIMS) { Object raw = row.getRaw("l1"); if (raw == null) { - if (NullHandling.replaceWithDefault()) { - expectedbl1.addLong(NullHandling.defaultLongValue()); - } else { - expectedbl1.addBytes(null, 0, 0); - } + expectedbl1.addBytes(null, 0, 0); } else { expectedbl1.addLong(2 * ((Number) raw).longValue()); } @@ -385,11 +375,7 @@ public void testBloomFilterAggFloatVirtualColumn() throws Exception for (InputRow row : TestDataBuilder.ROWS1_WITH_NUMERIC_DIMS) { Object raw = row.getRaw("f1"); if (raw == null) { - if (NullHandling.replaceWithDefault()) { - expectedbl1.addFloat(NullHandling.defaultFloatValue()); - } else { - expectedbl1.addBytes(null, 0, 0); - } + expectedbl1.addBytes(null, 0, 0); } else { expectedbl1.addFloat(2 * ((Number) raw).floatValue()); } @@ -439,11 +425,7 @@ public void testBloomFilterAggDoubleVirtualColumn() throws Exception for (InputRow row : TestDataBuilder.ROWS1_WITH_NUMERIC_DIMS) { Object raw = row.getRaw("dbl1"); if (raw == null) { - if (NullHandling.replaceWithDefault()) { - expectedbl1.addDouble(NullHandling.defaultDoubleValue()); - } else { - expectedbl1.addBytes(null, 0, 0); - } + expectedbl1.addBytes(null, 0, 0); } else { expectedbl1.addDouble(2 * ((Number) raw).doubleValue()); } @@ -504,7 +486,7 @@ public void testEmptyTimeseriesResults() throws Exception .dataSource(CalciteTests.DATASOURCE3) .intervals(new MultipleIntervalSegmentSpec(ImmutableList.of(Filtration.eternity()))) .granularity(Granularities.ALL) - .filters(numericEquality("dim2", 0L, ColumnType.LONG)) + .filters(equality("dim2", 0L, ColumnType.LONG)) .aggregators( ImmutableList.of( new BloomFilterAggregatorFactory( diff --git a/extensions-core/druid-bloom-filter/src/test/java/org/apache/druid/query/filter/BloomDimFilterTest.java b/extensions-core/druid-bloom-filter/src/test/java/org/apache/druid/query/filter/BloomDimFilterTest.java index 9184d2b14fee..71c1718ffff3 100644 --- a/extensions-core/druid-bloom-filter/src/test/java/org/apache/druid/query/filter/BloomDimFilterTest.java +++ b/extensions-core/druid-bloom-filter/src/test/java/org/apache/druid/query/filter/BloomDimFilterTest.java @@ -22,7 +22,6 @@ import com.google.common.base.Function; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.data.input.impl.DimensionsSpec; import org.apache.druid.data.input.impl.InputRowParser; @@ -179,12 +178,8 @@ public void testSingleValueStringColumnWithoutNulls() throws IOException @Test public void testSingleValueStringColumnWithNulls() throws IOException { - if (NullHandling.replaceWithDefault()) { - assertFilterMatches(new BloomDimFilter("dim1", bloomKFilter(1000, (String) null), null), ImmutableList.of("0")); - } else { - assertFilterMatches(new BloomDimFilter("dim1", bloomKFilter(1000, (String) null), null), ImmutableList.of()); - assertFilterMatches(new BloomDimFilter("dim1", bloomKFilter(1000, ""), null), ImmutableList.of("0")); - } + assertFilterMatches(new BloomDimFilter("dim1", bloomKFilter(1000, (String) null), null), ImmutableList.of()); + assertFilterMatches(new BloomDimFilter("dim1", bloomKFilter(1000, ""), null), ImmutableList.of("0")); assertFilterMatches(new BloomDimFilter("dim1", bloomKFilter(1000, "10"), null), ImmutableList.of("1")); assertFilterMatches(new BloomDimFilter("dim1", bloomKFilter(1000, "2"), null), ImmutableList.of("2")); assertFilterMatches(new BloomDimFilter("dim1", bloomKFilter(1000, "1"), null), ImmutableList.of("3")); @@ -196,21 +191,14 @@ public void testSingleValueStringColumnWithNulls() throws IOException @Test public void testMultiValueStringColumn() throws IOException { - if (NullHandling.replaceWithDefault()) { - assertFilterMatchesSkipArrays( - new BloomDimFilter("dim2", bloomKFilter(1000, (String) null), null), - ImmutableList.of("1", "2", "5") - ); - } else { - assertFilterMatchesSkipArrays( - new BloomDimFilter("dim2", bloomKFilter(1000, (String) null), null), - ImmutableList.of("1", "5") - ); - assertFilterMatchesSkipArrays( - new BloomDimFilter("dim2", bloomKFilter(1000, ""), null), - ImmutableList.of("2") - ); - } + assertFilterMatchesSkipArrays( + new BloomDimFilter("dim2", bloomKFilter(1000, (String) null), null), + ImmutableList.of("1", "5") + ); + assertFilterMatchesSkipArrays( + new BloomDimFilter("dim2", bloomKFilter(1000, ""), null), + ImmutableList.of("2") + ); assertFilterMatchesSkipArrays(new BloomDimFilter("dim2", bloomKFilter(1000, "a"), null), ImmutableList.of("0", "3")); assertFilterMatchesSkipArrays(new BloomDimFilter("dim2", bloomKFilter(1000, "b"), null), ImmutableList.of("0")); assertFilterMatchesSkipArrays(new BloomDimFilter("dim2", bloomKFilter(1000, "c"), null), ImmutableList.of("4")); @@ -320,22 +308,14 @@ public void testSelectorWithLookupExtractionFn() throws IOException ); LookupExtractor mapExtractor3 = new MapLookupExtractor(stringMap3, false); LookupExtractionFn lookupFn3 = new LookupExtractionFn(mapExtractor3, false, null, false, true); - if (NullHandling.replaceWithDefault()) { - // Nulls and empty strings are considered equivalent - assertFilterMatches( - new BloomDimFilter("dim0", bloomKFilter(1000, (String) null), lookupFn3), - ImmutableList.of("0", "1", "2", "3", "4", "5") - ); - } else { - assertFilterMatches( - new BloomDimFilter("dim0", bloomKFilter(1000, (String) null), lookupFn3), - ImmutableList.of("0", "2", "3", "4", "5") - ); - assertFilterMatches( - new BloomDimFilter("dim0", bloomKFilter(1000, ""), lookupFn3), - ImmutableList.of("1") - ); - } + assertFilterMatches( + new BloomDimFilter("dim0", bloomKFilter(1000, (String) null), lookupFn3), + ImmutableList.of("0", "2", "3", "4", "5") + ); + assertFilterMatches( + new BloomDimFilter("dim0", bloomKFilter(1000, ""), lookupFn3), + ImmutableList.of("1") + ); } @Test diff --git a/extensions-core/druid-bloom-filter/src/test/java/org/apache/druid/query/filter/sql/BloomDimFilterSqlTest.java b/extensions-core/druid-bloom-filter/src/test/java/org/apache/druid/query/filter/sql/BloomDimFilterSqlTest.java index 14b75fa44651..16a250ea65be 100644 --- a/extensions-core/druid-bloom-filter/src/test/java/org/apache/druid/query/filter/sql/BloomDimFilterSqlTest.java +++ b/extensions-core/druid-bloom-filter/src/test/java/org/apache/druid/query/filter/sql/BloomDimFilterSqlTest.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableList; import org.apache.calcite.avatica.SqlType; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.guice.BloomFilterExtensionModule; import org.apache.druid.guice.BloomFilterSerializersModule; import org.apache.druid.initialization.DruidModule; @@ -104,9 +103,7 @@ public void testBloomFilterExprFilter() throws IOException BloomKFilter filter = new BloomKFilter(1500); filter.addString("a-foo"); filter.addString("-foo"); - if (!NullHandling.replaceWithDefault()) { - filter.addBytes(null, 0, 0); - } + filter.addBytes(null, 0, 0); byte[] bytes = BloomFilterSerializersModule.bloomKFilterToBytes(filter); String base64 = StringUtils.encodeBase64String(bytes); @@ -316,8 +313,7 @@ public void testBloomFilterNullParameter() throws IOException ImmutableList.of( new Object[]{6L} ), - // there are no empty strings in the druid expression language since empty is coerced into a null when parsed - ImmutableList.of(new SqlParameter(SqlType.VARCHAR, NullHandling.defaultStringValue()), new SqlParameter(SqlType.VARCHAR, base64)) + ImmutableList.of(new SqlParameter(SqlType.VARCHAR, null), new SqlParameter(SqlType.VARCHAR, base64)) ); } } diff --git a/extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramAggregator.java b/extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramAggregator.java index 07846ddf6ea9..ba93ab479af7 100644 --- a/extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramAggregator.java +++ b/extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramAggregator.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.histogram; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.aggregation.Aggregator; import org.apache.druid.segment.BaseFloatColumnValueSelector; @@ -53,10 +52,7 @@ public ApproximateHistogramAggregator( @Override public void aggregate() { - // In case of ExpressionColumnValueSelector isNull will compute the expression and then give the result, - // the check for is NullHandling.replaceWithDefault is there to not have any performance impact of calling - // isNull for default case. - if (NullHandling.replaceWithDefault() || !selector.isNull()) { + if (!selector.isNull()) { histogram.offer(selector.getFloat()); } } diff --git a/extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogram.java b/extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogram.java index 754e0df2f9eb..ceeb87da6ec5 100644 --- a/extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogram.java +++ b/extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogram.java @@ -25,7 +25,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.ISE; import org.apache.druid.java.util.common.StringUtils; @@ -445,11 +444,7 @@ public void incrementMissing() public void combine(@Nullable Object val) { if (val == null) { - if (NullHandling.replaceWithDefault()) { - add(NullHandling.defaultDoubleValue()); - } else { - incrementMissing(); - } + incrementMissing(); } else if (val instanceof String) { combineHistogram(fromBase64((String) val)); } else if (val instanceof FixedBucketsHistogram) { diff --git a/extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogramSerde.java b/extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogramSerde.java index 06e629544163..0a63041828e9 100644 --- a/extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogramSerde.java +++ b/extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogramSerde.java @@ -20,7 +20,6 @@ package org.apache.druid.query.aggregation.histogram; import com.google.common.collect.Ordering; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.data.input.Rows; import org.apache.druid.java.util.common.parsers.ParseException; @@ -84,11 +83,7 @@ public FixedBucketsHistogram extractValue(InputRow inputRow, String metricName, aggregatorFactory.getNumBuckets(), aggregatorFactory.getOutlierHandlingMode() ); - if (NullHandling.replaceWithDefault()) { - fbh.add(NullHandling.defaultDoubleValue()); - } else { - fbh.incrementMissing(); - } + fbh.incrementMissing(); return fbh; } else if (rawValue instanceof Number) { FixedBucketsHistogram fbh = new FixedBucketsHistogram( diff --git a/extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramAggregationTest.java b/extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramAggregationTest.java index c38b3350a1a8..2f6882b83b64 100644 --- a/extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramAggregationTest.java +++ b/extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramAggregationTest.java @@ -20,7 +20,6 @@ package org.apache.druid.query.aggregation.histogram; import com.google.common.collect.Lists; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.MapBasedRow; import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.guava.Sequence; @@ -105,35 +104,6 @@ public void testIngestWithNullsIgnoredAndQuery() throws Exception ); } - @Test - public void testIngestWithNullsToZeroAndQuery() throws Exception - { - // Nulls are ignored and not replaced with default for SQL compatible null handling. - // This is already tested in testIngestWithNullsIgnoredAndQuery() - if (NullHandling.replaceWithDefault()) { - MapBasedRow row = ingestAndQuery(false); - Assert.assertEquals(0.0F, row.getMetric("index_min")); - Assert.assertEquals(135.109191, row.getMetric("index_max").floatValue(), 0.0001); - Assert.assertEquals(131.428176, row.getMetric("index_quantile").floatValue(), 0.0001); - Assert.assertEquals( - new Quantiles(new float[]{0.2f, 0.7f}, new float[]{0.0f, 92.95146f}, 0.0f, 135.109191f), - row.getRaw("index_quantiles") - ); - Assert.assertEquals( - "Histogram{breaks=[-2.0, 92.0, 94.0, 96.0, 98.0, 100.0, 106.0, 108.0, 134.0, 136.0], counts=[8.0, 1.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0]}", - row.getRaw("index_buckets").toString() - ); - Assert.assertEquals( - "Histogram{breaks=[50.0, 100.0], counts=[3.0]}", - row.getRaw("index_custom").toString() - ); - Assert.assertEquals( - "Histogram{breaks=[-67.55459594726562, 0.0, 67.55459594726562, 135.10919189453125], counts=[8.0, 0.0, 5.0]}", - row.getRaw("index_equal").toString() - ); - } - } - private MapBasedRow ingestAndQuery(boolean ignoreNulls) throws Exception { String ingestionAgg = ignoreNulls ? "approxHistogramFold" : "approxHistogram"; diff --git a/extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramVectorAggregatorTest.java b/extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramVectorAggregatorTest.java index da4d079c06c3..ade91819f038 100644 --- a/extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramVectorAggregatorTest.java +++ b/extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramVectorAggregatorTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.histogram; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.aggregation.VectorAggregator; import org.apache.druid.segment.column.ColumnCapabilities; import org.apache.druid.segment.column.ColumnCapabilitiesImpl; @@ -46,7 +45,6 @@ public class ApproximateHistogramVectorAggregatorTest @Before public void setup() { - NullHandling.initializeForTests(); VectorValueSelector vectorValueSelector_1 = createMock(VectorValueSelector.class); expect(vectorValueSelector_1.getFloatVector()).andReturn(FLOATS).anyTimes(); expect(vectorValueSelector_1.getNullVector()).andReturn(NULL_VECTOR).anyTimes(); diff --git a/extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogramAggregationTest.java b/extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogramAggregationTest.java index 198d62e4185d..2179adde44a0 100644 --- a/extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogramAggregationTest.java +++ b/extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogramAggregationTest.java @@ -20,7 +20,6 @@ package org.apache.druid.query.aggregation.histogram; import com.google.common.collect.Lists; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.MapBasedRow; import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.guava.Sequence; @@ -84,15 +83,9 @@ public void teardown() throws IOException public void testIngestWithNullsIgnoredAndQuery() throws Exception { MapBasedRow row = ingestAndQuery(); - if (!NullHandling.replaceWithDefault()) { - Assert.assertEquals(92.782760, row.getMetric("index_min").floatValue(), 0.0001); - Assert.assertEquals(135.109191, row.getMetric("index_max").floatValue(), 0.0001); - Assert.assertEquals(135.9499969482422, row.getMetric("index_quantile").floatValue(), 0.0001); - } else { - Assert.assertEquals(0.0, row.getMetric("index_min")); - Assert.assertEquals(135.109191, row.getMetric("index_max").floatValue(), 0.0001); - Assert.assertEquals(135.8699951171875, row.getMetric("index_quantile").floatValue(), 0.0001); - } + Assert.assertEquals(92.782760, row.getMetric("index_min").floatValue(), 0.0001); + Assert.assertEquals(135.109191, row.getMetric("index_max").floatValue(), 0.0001); + Assert.assertEquals(135.9499969482422, row.getMetric("index_quantile").floatValue(), 0.0001); } private MapBasedRow ingestAndQuery() throws Exception diff --git a/extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogramVectorAggregatorTest.java b/extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogramVectorAggregatorTest.java index 93c9d690c283..f4d15374c5de 100644 --- a/extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogramVectorAggregatorTest.java +++ b/extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogramVectorAggregatorTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.histogram; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.aggregation.VectorAggregator; import org.apache.druid.segment.column.ColumnCapabilities; import org.apache.druid.segment.column.ColumnCapabilitiesImpl; @@ -45,7 +44,6 @@ public class FixedBucketsHistogramVectorAggregatorTest @Before public void setup() { - NullHandling.initializeForTests(); VectorValueSelector vectorValueSelector_1 = createMock(VectorValueSelector.class); expect(vectorValueSelector_1.getDoubleVector()).andReturn(DOUBLES).anyTimes(); expect(vectorValueSelector_1.getNullVector()).andReturn(NULL_VECTOR).anyTimes(); @@ -89,9 +87,8 @@ public void testAggregateSinglePosition() Assert.assertEquals(5, h.getCount()); Assert.assertEquals(1.0, h.getMin(), 0.01); Assert.assertEquals(16.0, h.getMax(), 0.01); - // Default value of null is 0 which is an outlier. - Assert.assertEquals(NullHandling.replaceWithDefault() ? 0 : 1, h.getMissingValueCount()); - Assert.assertEquals(NullHandling.replaceWithDefault() ? 1 : 0, h.getLowerOutlierCount()); + Assert.assertEquals(1, h.getMissingValueCount()); + Assert.assertEquals(0, h.getLowerOutlierCount()); Assert.assertEquals(0, h.getUpperOutlierCount()); factory = buildHistogramAggFactory("field_2"); diff --git a/extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/sql/FixedBucketsHistogramQuantileSqlAggregatorTest.java b/extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/sql/FixedBucketsHistogramQuantileSqlAggregatorTest.java index 7c3e42b28e75..da9b229f5c8a 100644 --- a/extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/sql/FixedBucketsHistogramQuantileSqlAggregatorTest.java +++ b/extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/sql/FixedBucketsHistogramQuantileSqlAggregatorTest.java @@ -22,7 +22,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.inject.Injector; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.initialization.DruidModule; import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.query.Druids; @@ -409,18 +408,7 @@ public void testQuantileOnCastedString() .build() ), ImmutableList.of( - NullHandling.replaceWithDefault() - ? new Object[]{ - 0.00833333283662796, - 0.4166666567325592, - 2.450000047683716, - 2.4749999046325684, - 4.425000190734863, - 0.4950000047683716, - 2.498000144958496, - 0.49950000643730164 - } - : new Object[]{ + new Object[]{ 1.0099999904632568, 1.5, 2.4800000190734863, @@ -529,12 +517,7 @@ public void testQuantileOnComplexColumn() @Test public void testQuantileOnInnerQuery() { - final List expectedResults; - if (NullHandling.replaceWithDefault()) { - expectedResults = ImmutableList.of(new Object[]{7.0, 11.940000534057617}); - } else { - expectedResults = ImmutableList.of(new Object[]{5.25, 8.920000076293945}); - } + final List expectedResults = ImmutableList.of(new Object[]{5.25, 8.920000076293945}); testQuery( "SELECT AVG(x), APPROX_QUANTILE_FIXED_BUCKETS(x, 0.98, 100, 0.0, 100.0)\n" @@ -562,8 +545,6 @@ public void testQuantileOnInnerQuery() .setGranularity(Granularities.ALL) .setAggregatorSpecs( new DoubleSumAggregatorFactory("_a0:sum", "a0"), - NullHandling.replaceWithDefault() ? - new CountAggregatorFactory("_a0:count") : new FilteredAggregatorFactory( new CountAggregatorFactory("_a0:count"), notNull("a0") @@ -613,7 +594,7 @@ public void testEmptyTimeseriesResults() .dataSource(CalciteTests.DATASOURCE1) .intervals(new MultipleIntervalSegmentSpec(ImmutableList.of(Filtration.eternity()))) .granularity(Granularities.ALL) - .filters(numericEquality("dim2", 0L, ColumnType.LONG)) + .filters(equality("dim2", 0L, ColumnType.LONG)) .aggregators(ImmutableList.of( new FixedBucketsHistogramAggregatorFactory( "a0:agg", diff --git a/extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/sql/QuantileSqlAggregatorTest.java b/extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/sql/QuantileSqlAggregatorTest.java index f5abd6c64858..6202d4f7957c 100644 --- a/extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/sql/QuantileSqlAggregatorTest.java +++ b/extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/sql/QuantileSqlAggregatorTest.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableList; import com.google.inject.Injector; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.initialization.DruidModule; import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.math.expr.ExprMacroTable; @@ -284,12 +283,7 @@ public void testQuantileOnComplexColumn() @Test public void testQuantileOnInnerQuery() { - final List expectedResults; - if (NullHandling.replaceWithDefault()) { - expectedResults = ImmutableList.of(new Object[]{7.0, 8.26386833190918}); - } else { - expectedResults = ImmutableList.of(new Object[]{5.25, 6.59091854095459}); - } + final List expectedResults = ImmutableList.of(new Object[]{5.25, 6.59091854095459}); testQuery( "SELECT AVG(x), APPROX_QUANTILE(x, 0.98)\n" @@ -316,8 +310,6 @@ public void testQuantileOnInnerQuery() .setGranularity(Granularities.ALL) .setAggregatorSpecs( new DoubleSumAggregatorFactory("_a0:sum", "a0"), - NullHandling.replaceWithDefault() ? - new CountAggregatorFactory("_a0:count") : new FilteredAggregatorFactory( new CountAggregatorFactory("_a0:count"), notNull("a0") @@ -357,25 +349,14 @@ public void testQuantileOnCastedString() { cannotVectorize(); - final List expectedResults; - if (NullHandling.replaceWithDefault()) { - expectedResults = ImmutableList.of( - new Object[]{"", 0.0d}, - new Object[]{"a", 0.0d}, - new Object[]{"b", 0.0d}, - new Object[]{"c", 10.100000381469727d}, - new Object[]{"d", 2.0d} - ); - } else { - expectedResults = ImmutableList.of( - new Object[]{null, Double.NaN}, - new Object[]{"", 1.0d}, - new Object[]{"a", Double.NaN}, - new Object[]{"b", 10.100000381469727d}, - new Object[]{"c", 10.100000381469727d}, - new Object[]{"d", 2.0d} - ); - } + final List expectedResults = ImmutableList.of( + new Object[]{null, Double.NaN}, + new Object[]{"", 1.0d}, + new Object[]{"a", Double.NaN}, + new Object[]{"b", 10.100000381469727d}, + new Object[]{"c", 10.100000381469727d}, + new Object[]{"d", 2.0d} + ); testQuery( "SELECT dim3, APPROX_QUANTILE(CAST(dim1 as DOUBLE), 0.5) from foo group by dim3", ImmutableList.of( @@ -428,7 +409,7 @@ public void testEmptyTimeseriesResults() .dataSource(CalciteTests.DATASOURCE1) .intervals(new MultipleIntervalSegmentSpec(ImmutableList.of(Filtration.eternity()))) .granularity(Granularities.ALL) - .filters(numericEquality("dim2", 0L, ColumnType.LONG)) + .filters(equality("dim2", 0L, ColumnType.LONG)) .aggregators( ImmutableList.of( new ApproximateHistogramFoldingAggregatorFactory( diff --git a/extensions-core/kafka-indexing-service/src/test/java/org/apache/druid/data/input/kafkainput/KafkaInputFormatTest.java b/extensions-core/kafka-indexing-service/src/test/java/org/apache/druid/data/input/kafkainput/KafkaInputFormatTest.java index f1f6d2c3dfd1..edff7464d073 100644 --- a/extensions-core/kafka-indexing-service/src/test/java/org/apache/druid/data/input/kafkainput/KafkaInputFormatTest.java +++ b/extensions-core/kafka-indexing-service/src/test/java/org/apache/druid/data/input/kafkainput/KafkaInputFormatTest.java @@ -24,7 +24,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Iterables; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.ColumnsFilter; import org.apache.druid.data.input.InputEntityReader; import org.apache.druid.data.input.InputRow; @@ -60,10 +59,6 @@ public class KafkaInputFormatTest { - static { - NullHandling.initializeForTests(); - } - private static final long TIMESTAMP_MILLIS = DateTimes.of("2021-06-24").getMillis(); private static final String TOPIC = "sample"; private static final byte[] SIMPLE_JSON_KEY_BYTES = StringUtils.toUtf8( diff --git a/extensions-core/kinesis-indexing-service/src/test/java/org/apache/druid/data/input/kinesis/KinesisInputFormatTest.java b/extensions-core/kinesis-indexing-service/src/test/java/org/apache/druid/data/input/kinesis/KinesisInputFormatTest.java index 7e40203c48e0..6553d27d64fa 100644 --- a/extensions-core/kinesis-indexing-service/src/test/java/org/apache/druid/data/input/kinesis/KinesisInputFormatTest.java +++ b/extensions-core/kinesis-indexing-service/src/test/java/org/apache/druid/data/input/kinesis/KinesisInputFormatTest.java @@ -25,7 +25,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Iterables; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.ColumnsFilter; import org.apache.druid.data.input.InputEntityReader; import org.apache.druid.data.input.InputFormat; @@ -58,11 +57,6 @@ public class KinesisInputFormatTest { - static { - NullHandling.initializeForTests(); - } - - private static final String KINESIS_APPROXIMATE_TIME_DATE = "2024-07-29"; private static final long KINESIS_APPROXOIMATE_TIMESTAMP_MILLIS = DateTimes.of(KINESIS_APPROXIMATE_TIME_DATE).getMillis(); private static final String DATA_TIMSTAMP_DATE = "2024-07-30"; diff --git a/extensions-core/kinesis-indexing-service/src/test/java/org/apache/druid/indexing/kinesis/KinesisSamplerSpecTest.java b/extensions-core/kinesis-indexing-service/src/test/java/org/apache/druid/indexing/kinesis/KinesisSamplerSpecTest.java index 102e2d8929f2..02ce3c1a09c4 100644 --- a/extensions-core/kinesis-indexing-service/src/test/java/org/apache/druid/indexing/kinesis/KinesisSamplerSpecTest.java +++ b/extensions-core/kinesis-indexing-service/src/test/java/org/apache/druid/indexing/kinesis/KinesisSamplerSpecTest.java @@ -27,7 +27,6 @@ import org.apache.druid.client.indexing.SamplerResponse; import org.apache.druid.client.indexing.SamplerSpec; import org.apache.druid.common.aws.AWSCredentialsConfig; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.impl.DimensionsSpec; import org.apache.druid.data.input.impl.FloatDimensionSchema; import org.apache.druid.data.input.impl.InputRowParser; @@ -94,10 +93,6 @@ public class KinesisSamplerSpecTest extends EasyMockSupport ) .build(); - static { - NullHandling.initializeForTests(); - } - private final KinesisRecordSupplier recordSupplier = mock(KinesisRecordSupplier.class); private static List> generateRecords(String stream) diff --git a/extensions-core/lookups-cached-global/src/test/java/org/apache/druid/query/lookup/NamespaceLookupExtractorFactoryTest.java b/extensions-core/lookups-cached-global/src/test/java/org/apache/druid/query/lookup/NamespaceLookupExtractorFactoryTest.java index 36c88cf10e81..ae43b42d9db5 100644 --- a/extensions-core/lookups-cached-global/src/test/java/org/apache/druid/query/lookup/NamespaceLookupExtractorFactoryTest.java +++ b/extensions-core/lookups-cached-global/src/test/java/org/apache/druid/query/lookup/NamespaceLookupExtractorFactoryTest.java @@ -28,7 +28,6 @@ import com.google.common.collect.ImmutableSet; import com.google.inject.Injector; import com.google.inject.Key; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.guice.GuiceInjectors; import org.apache.druid.guice.JsonConfigProvider; import org.apache.druid.guice.annotations.Json; @@ -70,10 +69,6 @@ public class NamespaceLookupExtractorFactoryTest { - static { - NullHandling.initializeForTests(); - } - private final ObjectMapper mapper = new DefaultObjectMapper(); @Rule public TemporaryFolder temporaryFolder = new TemporaryFolder(); diff --git a/extensions-core/lookups-cached-global/src/test/java/org/apache/druid/query/lookup/namespace/UriExtractionNamespaceTest.java b/extensions-core/lookups-cached-global/src/test/java/org/apache/druid/query/lookup/namespace/UriExtractionNamespaceTest.java index 61d90b38a987..cd4515278495 100644 --- a/extensions-core/lookups-cached-global/src/test/java/org/apache/druid/query/lookup/namespace/UriExtractionNamespaceTest.java +++ b/extensions-core/lookups-cached-global/src/test/java/org/apache/druid/query/lookup/namespace/UriExtractionNamespaceTest.java @@ -27,7 +27,6 @@ import com.google.inject.Binder; import com.google.inject.Guice; import com.google.inject.Module; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.guice.GuiceAnnotationIntrospector; import org.apache.druid.guice.GuiceInjectableValues; import org.apache.druid.guice.annotations.Json; @@ -44,10 +43,6 @@ */ public class UriExtractionNamespaceTest { - static { - NullHandling.initializeForTests(); - } - public static ObjectMapper registerTypes( final ObjectMapper mapper ) diff --git a/extensions-core/lookups-cached-global/src/test/java/org/apache/druid/server/lookup/namespace/cache/JdbcExtractionNamespaceTest.java b/extensions-core/lookups-cached-global/src/test/java/org/apache/druid/server/lookup/namespace/cache/JdbcExtractionNamespaceTest.java index ada8e2ee9264..6c164564f40d 100644 --- a/extensions-core/lookups-cached-global/src/test/java/org/apache/druid/server/lookup/namespace/cache/JdbcExtractionNamespaceTest.java +++ b/extensions-core/lookups-cached-global/src/test/java/org/apache/druid/server/lookup/namespace/cache/JdbcExtractionNamespaceTest.java @@ -26,7 +26,6 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningExecutorService; import com.google.common.util.concurrent.MoreExecutors; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.java.util.common.concurrent.Execs; @@ -69,10 +68,6 @@ @RunWith(Parameterized.class) public class JdbcExtractionNamespaceTest { - static { - NullHandling.initializeForTests(); - } - @Rule public final TestDerbyConnector.DerbyConnectorRule derbyConnectorRule = new TestDerbyConnector.DerbyConnectorRule(); @@ -342,8 +337,8 @@ public void testMappingWithoutFilter() String field = val[0]; Assert.assertEquals( "non-null check", - NullHandling.emptyToNullIfNeeded(field), - NullHandling.emptyToNullIfNeeded(map.get(key)) + field, + map.get(key) ); } Assert.assertEquals("null check", null, map.get("baz")); @@ -380,11 +375,11 @@ public void testMappingWithFilter() if ("1".equals(filterVal)) { Assert.assertEquals( "non-null check", - NullHandling.emptyToNullIfNeeded(field), - NullHandling.emptyToNullIfNeeded(map.get(key)) + field, + map.get(key) ); } else { - Assert.assertEquals("non-null check", null, NullHandling.emptyToNullIfNeeded(map.get(key))); + Assert.assertEquals("non-null check", null, map.get(key)); } } } diff --git a/extensions-core/lookups-cached-single/src/main/java/org/apache/druid/server/lookup/LoadingLookup.java b/extensions-core/lookups-cached-single/src/main/java/org/apache/druid/server/lookup/LoadingLookup.java index edd19ca415ad..9c00a345e88a 100644 --- a/extensions-core/lookups-cached-single/src/main/java/org/apache/druid/server/lookup/LoadingLookup.java +++ b/extensions-core/lookups-cached-single/src/main/java/org/apache/druid/server/lookup/LoadingLookup.java @@ -21,7 +21,6 @@ import com.google.common.base.Preconditions; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.logger.Logger; import org.apache.druid.query.lookup.LookupExtractor; import org.apache.druid.server.lookup.cache.loading.LoadingCache; @@ -68,41 +67,34 @@ public LoadingLookup( @Override public String apply(@Nullable final String key) { - String keyEquivalent = NullHandling.nullToEmptyIfNeeded(key); - if (keyEquivalent == null) { - // valueEquivalent is null only for SQL Compatible Null Behavior - // otherwise null will be replaced with empty string in nullToEmptyIfNeeded above. + if (key == null) { return null; } - final String presentVal = this.loadingCache.getIfPresent(keyEquivalent); + final String presentVal = this.loadingCache.getIfPresent(key); if (presentVal != null) { - return NullHandling.emptyToNullIfNeeded(presentVal); + return presentVal; } - final String val = this.dataFetcher.fetch(keyEquivalent); + final String val = this.dataFetcher.fetch(key); if (val == null) { return null; } - this.loadingCache.putAll(Collections.singletonMap(keyEquivalent, val)); + this.loadingCache.putAll(Collections.singletonMap(key, val)); - return NullHandling.emptyToNullIfNeeded(val); + return val; } @Override public List unapply(@Nullable final String value) { - String valueEquivalent = NullHandling.nullToEmptyIfNeeded(value); - if (valueEquivalent == null) { - // valueEquivalent is null only for SQL Compatible Null Behavior - // otherwise null will be replaced with empty string in nullToEmptyIfNeeded above. - // null value maps to empty list when SQL Compatible + if (value == null) { return Collections.emptyList(); } final List retList; try { - retList = reverseLoadingCache.get(valueEquivalent, new UnapplyCallable(valueEquivalent)); + retList = reverseLoadingCache.get(value, new UnapplyCallable(value)); return retList; } catch (ExecutionException e) { diff --git a/extensions-core/lookups-cached-single/src/main/java/org/apache/druid/server/lookup/PollingLookup.java b/extensions-core/lookups-cached-single/src/main/java/org/apache/druid/server/lookup/PollingLookup.java index 95e7fb14e469..9ded249a2b2e 100644 --- a/extensions-core/lookups-cached-single/src/main/java/org/apache/druid/server/lookup/PollingLookup.java +++ b/extensions-core/lookups-cached-single/src/main/java/org/apache/druid/server/lookup/PollingLookup.java @@ -23,7 +23,6 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningScheduledExecutorService; import com.google.common.util.concurrent.MoreExecutors; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.ISE; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.java.util.common.concurrent.Execs; @@ -112,10 +111,7 @@ public void close() @Nullable public String apply(@Nullable String key) { - String keyEquivalent = NullHandling.nullToEmptyIfNeeded(key); - if (keyEquivalent == null) { - // valueEquivalent is null only for SQL Compatible Null Behavior - // otherwise null will be replaced with empty string in nullToEmptyIfNeeded above. + if (key == null) { return null; } final CacheRefKeeper cacheRefKeeper = refOfCacheKeeper.get(); @@ -126,9 +122,9 @@ public String apply(@Nullable String key) try { if (cache == null) { // it must've been closed after swapping while I was getting it. Try again. - return this.apply(keyEquivalent); + return this.apply(key); } - return NullHandling.emptyToNullIfNeeded((String) cache.get(keyEquivalent)); + return (String) cache.get(key); } finally { if (cache != null) { @@ -140,11 +136,7 @@ public String apply(@Nullable String key) @Override public List unapply(@Nullable final String value) { - String valueEquivalent = NullHandling.nullToEmptyIfNeeded(value); - if (valueEquivalent == null) { - // valueEquivalent is null only for SQL Compatible Null Behavior - // otherwise null will be replaced with empty string in nullToEmptyIfNeeded above. - // null value maps to empty list when SQL Compatible + if (value == null) { return Collections.emptyList(); } @@ -156,9 +148,9 @@ public List unapply(@Nullable final String value) try { if (cache == null) { // it must've been closed after swapping while I was getting it. Try again. - return this.unapply(valueEquivalent); + return this.unapply(value); } - return cache.getKeys(valueEquivalent); + return cache.getKeys(value); } finally { if (cache != null) { diff --git a/extensions-core/lookups-cached-single/src/main/java/org/apache/druid/server/lookup/jdbc/JdbcDataFetcher.java b/extensions-core/lookups-cached-single/src/main/java/org/apache/druid/server/lookup/jdbc/JdbcDataFetcher.java index f8d50dbbcb25..496afb727fea 100644 --- a/extensions-core/lookups-cached-single/src/main/java/org/apache/druid/server/lookup/jdbc/JdbcDataFetcher.java +++ b/extensions-core/lookups-cached-single/src/main/java/org/apache/druid/server/lookup/jdbc/JdbcDataFetcher.java @@ -23,7 +23,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Preconditions; import com.google.common.collect.Lists; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.ISE; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.java.util.common.logger.Logger; @@ -46,10 +45,6 @@ public class JdbcDataFetcher implements DataFetcher { - static { - NullHandling.initializeForTests(); - } - private static final Logger LOGGER = new Logger(JdbcDataFetcher.class); private static final int DEFAULT_STREAMING_FETCH_SIZE = 1000; @@ -157,7 +152,7 @@ public String fetch(final String key) if (pairs.isEmpty()) { return null; } - return NullHandling.nullToEmptyIfNeeded(pairs.get(0)); + return pairs.get(0); } @Override diff --git a/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/LoadingLookupTest.java b/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/LoadingLookupTest.java index 180a9338bf26..72f53d9bbf76 100644 --- a/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/LoadingLookupTest.java +++ b/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/LoadingLookupTest.java @@ -22,7 +22,6 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.server.lookup.cache.loading.LoadingCache; import org.apache.druid.testing.InitializedNullHandlingTest; import org.easymock.EasyMock; @@ -55,23 +54,14 @@ public void testApplyEmptyOrNull() .andReturn("empty").atLeastOnce(); EasyMock.replay(lookupCache); Assert.assertEquals("empty", loadingLookup.apply("")); - if (!NullHandling.sqlCompatible()) { - // Nulls and empty strings should have same behavior - Assert.assertEquals("empty", loadingLookup.apply(null)); - } else { - Assert.assertNull(loadingLookup.apply(null)); - } + Assert.assertNull(loadingLookup.apply(null)); EasyMock.verify(lookupCache); } @Test public void testUnapplyNull() { - if (NullHandling.sqlCompatible()) { - Assert.assertEquals(Collections.emptyList(), loadingLookup.unapply(null)); - } else { - Assert.assertNull(loadingLookup.unapply(null)); - } + Assert.assertEquals(Collections.emptyList(), loadingLookup.unapply(null)); } @Test diff --git a/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/PollingLookupTest.java b/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/PollingLookupTest.java index 41f0b6de2592..52c620be98dd 100644 --- a/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/PollingLookupTest.java +++ b/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/PollingLookupTest.java @@ -20,11 +20,8 @@ package org.apache.druid.server.lookup; import com.fasterxml.jackson.annotation.JsonTypeName; -import com.google.common.base.Function; import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Maps; import com.google.common.collect.Sets; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.ISE; import org.apache.druid.query.lookup.LookupExtractor; import org.apache.druid.server.lookup.cache.polling.OffHeapPollingCache; @@ -192,15 +189,7 @@ public void testUnapply() public void testBulkApply() { Map map = pollingLookup.applyAll(FIRST_LOOKUP_MAP.keySet()); - Assert.assertEquals(FIRST_LOOKUP_MAP, Maps.transformValues(map, new Function() - { - @Override - public String apply(String input) - { - //make sure to rewrite null strings as empty. - return NullHandling.nullToEmptyIfNeeded(input); - } - })); + Assert.assertEquals(FIRST_LOOKUP_MAP, map); } @Test @@ -237,7 +226,7 @@ private void assertMapLookup(Map map, LookupExtractor lookup) for (Map.Entry entry : map.entrySet()) { String key = entry.getKey(); String val = entry.getValue(); - Assert.assertEquals("non-null check", NullHandling.emptyToNullIfNeeded(val), lookup.apply(key)); + Assert.assertEquals("non-null check", val, lookup.apply(key)); } } } diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQArraysTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQArraysTest.java index 9e323b52577a..94e3f0cdbb06 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQArraysTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQArraysTest.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.impl.InlineInputSource; import org.apache.druid.data.input.impl.JsonInputFormat; import org.apache.druid.data.input.impl.LocalInputSource; @@ -59,7 +58,6 @@ import java.io.InputStream; import java.nio.file.Files; import java.nio.file.StandardCopyOption; -import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; @@ -232,8 +230,7 @@ public void testReplaceMvdWithStringArraySkipValidation(String contextName, Map< .setExpectedRowSignature(rowSignature) .setExpectedSegments(ImmutableSet.of(SegmentId.of("foo", Intervals.ETERNITY, "test", 0))) .setExpectedResultRows( - NullHandling.sqlCompatible() - ? ImmutableList.of( + ImmutableList.of( new Object[]{0L, null}, new Object[]{0L, null}, new Object[]{0L, new Object[]{"a", "b"}}, @@ -241,14 +238,6 @@ public void testReplaceMvdWithStringArraySkipValidation(String contextName, Map< new Object[]{0L, new Object[]{"b", "c"}}, new Object[]{0L, new Object[]{"d"}} ) - : ImmutableList.of( - new Object[]{0L, null}, - new Object[]{0L, null}, - new Object[]{0L, null}, - new Object[]{0L, new Object[]{"a", "b"}}, - new Object[]{0L, new Object[]{"b", "c"}}, - new Object[]{0L, new Object[]{"d"}} - ) ) .verifyResults(); } @@ -283,7 +272,7 @@ public void testReplaceMvdWithMvd(String contextName, Map contex ImmutableList.of( new Object[]{0L, null}, new Object[]{0L, null}, - new Object[]{0L, NullHandling.sqlCompatible() ? "" : null}, + new Object[]{0L, ""}, new Object[]{0L, ImmutableList.of("a", "b")}, new Object[]{0L, ImmutableList.of("b", "c")}, new Object[]{0L, "d"} @@ -304,20 +293,12 @@ public void testInsertOnFoo1WithMultiValueToArrayGroupByWithDefaultContext(Strin .add("dim3", ColumnType.STRING_ARRAY) .build(); - List expectedRows = new ArrayList<>( - ImmutableList.of( - new Object[]{0L, null}, - new Object[]{0L, new Object[]{"a", "b"}} - ) - ); - if (!useDefault) { - expectedRows.add(new Object[]{0L, new Object[]{""}}); - } - expectedRows.addAll( - ImmutableList.of( - new Object[]{0L, new Object[]{"b", "c"}}, - new Object[]{0L, new Object[]{"d"}} - ) + List expectedRows = ImmutableList.of( + new Object[]{0L, null}, + new Object[]{0L, new Object[]{"a", "b"}}, + new Object[]{0L, new Object[]{""}}, + new Object[]{0L, new Object[]{"b", "c"}}, + new Object[]{0L, new Object[]{"d"}} ); testIngestQuery().setSql( diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQComplexGroupByTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQComplexGroupByTest.java index 6322410aa78e..71bc69499fe3 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQComplexGroupByTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQComplexGroupByTest.java @@ -22,7 +22,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.impl.JsonInputFormat; import org.apache.druid.data.input.impl.LocalInputSource; import org.apache.druid.data.input.impl.systemfield.SystemFields; @@ -45,7 +44,6 @@ import org.apache.druid.query.filter.DimFilter; import org.apache.druid.query.filter.NotDimFilter; import org.apache.druid.query.filter.NullFilter; -import org.apache.druid.query.filter.SelectorDimFilter; import org.apache.druid.query.groupby.GroupByQuery; import org.apache.druid.query.groupby.GroupByQueryConfig; import org.apache.druid.query.groupby.orderby.DefaultLimitSpec; @@ -61,7 +59,6 @@ import org.apache.druid.sql.calcite.planner.PlannerConfig; import org.apache.druid.timeline.SegmentId; import org.apache.druid.utils.CompressionUtils; -import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -439,7 +436,6 @@ public void testSortingOnNestedData(String contextName, Map cont @ParameterizedTest(name = "{index}:with context {0}") public void testExactCountDistinctOnNestedData(String contextName, Map context) { - Assumptions.assumeTrue(NullHandling.sqlCompatible()); RowSignature rowSignature = RowSignature.builder() .add("distinct_obj", ColumnType.LONG) .build(); @@ -449,9 +445,7 @@ public void testExactCountDistinctOnNestedData(String contextName, Map context) { - Assumptions.assumeTrue(NullHandling.sqlCompatible()); RowSignature dataFileSignature = RowSignature.builder() .add("timestamp", ColumnType.STRING) .add("cObj", ColumnType.NESTED_DATA) @@ -544,9 +537,7 @@ public void testExactCountDistinctOnNestedData2(String contextName, Map context new Object[]{946771200000L, "b"}, new Object[]{946771200000L, "c"}, new Object[]{946857600000L, "d"}, - new Object[]{978307200000L, NullHandling.sqlCompatible() ? "" : null}, + new Object[]{978307200000L, ""}, new Object[]{978393600000L, null}, new Object[]{978480000000L, null} ); @@ -892,13 +890,7 @@ public void testInsertOnFoo1WithAutoTypeArrayGroupBy(String contextName, Map co private List expectedFooRows() { - List expectedRows = new ArrayList<>(); - if (!useDefault) { - expectedRows.add(new Object[]{946684800000L, "", 1L}); - } - expectedRows.addAll(ImmutableList.of( + return Arrays.asList( + new Object[]{946684800000L, "", 1L}, new Object[]{946771200000L, "10.1", 1L}, new Object[]{946857600000L, "2", 1L}, new Object[]{978307200000L, "1", 1L}, new Object[]{978393600000L, "def", 1L}, new Object[]{978480000000L, "abc", 1L} - )); - return expectedRows; + ); } private List expectedFooRowsWithAggregatedComplexColumn() { - List expectedRows = new ArrayList<>(); HyperLogLogCollector hyperLogLogCollector = HyperLogLogCollector.makeLatestCollector(); hyperLogLogCollector.add(fn.hashInt(1).asBytes()); - if (!useDefault) { - expectedRows.add(new Object[]{946684800000L, "", hyperLogLogCollector.estimateCardinalityRound()}); - } - expectedRows.addAll(ImmutableList.of( + return ImmutableList.of( + new Object[]{946684800000L, "", hyperLogLogCollector.estimateCardinalityRound()}, new Object[]{946771200000L, "10.1", hyperLogLogCollector.estimateCardinalityRound()}, new Object[]{946857600000L, "2", hyperLogLogCollector.estimateCardinalityRound()}, new Object[]{978307200000L, "1", hyperLogLogCollector.estimateCardinalityRound()}, new Object[]{978393600000L, "def", hyperLogLogCollector.estimateCardinalityRound()}, new Object[]{978480000000L, "abc", hyperLogLogCollector.estimateCardinalityRound()} - )); - return expectedRows; + ); } private List expectedMultiValueFooRows() { - List expectedRows = new ArrayList<>(); - if (!useDefault) { - expectedRows.add(new Object[]{0L, ""}); - } - - expectedRows.addAll( - ImmutableList.of( - new Object[]{0L, ImmutableList.of("a", "b")}, - new Object[]{0L, ImmutableList.of("b", "c")}, - new Object[]{0L, "d"} - )); - return expectedRows; + return ImmutableList.of( + new Object[]{0L, ""}, + new Object[]{0L, ImmutableList.of("a", "b")}, + new Object[]{0L, ImmutableList.of("b", "c")}, + new Object[]{0L, "d"} + ); } private List expectedMultiValueFooRowsGroupBy() { - List expectedRows = new ArrayList<>(); - if (!useDefault) { - expectedRows.add(new Object[]{0L, ""}); - } - expectedRows.addAll(ImmutableList.of( + return ImmutableList.of( + new Object[]{0L, ""}, new Object[]{0L, "a"}, new Object[]{0L, "b"}, new Object[]{0L, "c"}, new Object[]{0L, "d"} - )); - return expectedRows; + ); } private Set expectedFooSegments() { - Set expectedSegments = new TreeSet<>(); - - if (!useDefault) { - expectedSegments.add(SegmentId.of("foo1", Intervals.of("2000-01-01T/P1D"), "test", 0)); - } - expectedSegments.addAll( + return new TreeSet<>( ImmutableSet.of( + SegmentId.of("foo1", Intervals.of("2000-01-01T/P1D"), "test", 0), SegmentId.of("foo1", Intervals.of("2000-01-02T/P1D"), "test", 0), SegmentId.of("foo1", Intervals.of("2000-01-03T/P1D"), "test", 0), SegmentId.of("foo1", Intervals.of("2001-01-01T/P1D"), "test", 0), SegmentId.of("foo1", Intervals.of("2001-01-02T/P1D"), "test", 0), SegmentId.of("foo1", Intervals.of("2001-01-03T/P1D"), "test", 0) - )); - - return expectedSegments; + ) + ); } } diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQReplaceTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQReplaceTest.java index 8f8a0b569c9b..d196dccedf0e 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQReplaceTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQReplaceTest.java @@ -24,7 +24,6 @@ import com.google.common.collect.ImmutableSet; import org.apache.calcite.avatica.ColumnMetaData; import org.apache.calcite.avatica.remote.TypedValue; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.impl.DimensionSchema; import org.apache.druid.data.input.impl.DimensionsSpec; import org.apache.druid.data.input.impl.DoubleDimensionSchema; @@ -74,7 +73,6 @@ import javax.annotation.Nonnull; import java.io.File; import java.io.IOException; -import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; @@ -243,7 +241,7 @@ public void testReplaceOnFooWithAllClusteredByDim(String contextName, Map c .build(); List expectedRows = ImmutableList.of( - new Object[]{946684800000L, NullHandling.sqlCompatible() ? "" : null}, + new Object[]{946684800000L, ""}, new Object[]{978307200000L, "1"}, new Object[]{946771200000L, "10.1"}, new Object[]{946857600000L, "2"} @@ -1679,7 +1677,7 @@ public void testReplaceOnFoo1RangeClusteredBySubset(String contextName, Map expectedResults; - if (NullHandling.sqlCompatible()) { - expectedResults = ImmutableList.of( - new Object[]{946684800000L, "", 1L}, - new Object[]{946771200000L, "10.1", 1L}, - new Object[]{946857600000L, "2", 1L}, - new Object[]{978307200000L, "1", 1L}, - new Object[]{978393600000L, "def", 1L}, - new Object[]{978480000000L, "abc", 1L} - ); - } else { - expectedResults = ImmutableList.of( - new Object[]{946771200000L, "10.1", 1L}, - new Object[]{946857600000L, "2", 1L}, - new Object[]{978307200000L, "1", 1L}, - new Object[]{978393600000L, "def", 1L}, - new Object[]{978480000000L, "abc", 1L} - ); - } + List expectedResults = ImmutableList.of( + new Object[]{946684800000L, "", 1L}, + new Object[]{946771200000L, "10.1", 1L}, + new Object[]{946857600000L, "2", 1L}, + new Object[]{978307200000L, "1", 1L}, + new Object[]{978393600000L, "def", 1L}, + new Object[]{978480000000L, "abc", 1L} + ); testIngestQuery().setSql( "REPLACE INTO foo1 " @@ -2637,38 +2624,29 @@ void testRealtimeQueryWithReindexShouldThrowException() @Nonnull private Set expectedFooSegments() { - Set expectedSegments = new TreeSet<>(); - - if (!useDefault) { - expectedSegments.add(SegmentId.of("foo1", Intervals.of("2000-01-01T/P1D"), "test", 0)); - } - expectedSegments.addAll( + return new TreeSet<>( ImmutableSet.of( + SegmentId.of("foo1", Intervals.of("2000-01-01T/P1D"), "test", 0), SegmentId.of("foo1", Intervals.of("2000-01-02T/P1D"), "test", 0), SegmentId.of("foo1", Intervals.of("2000-01-03T/P1D"), "test", 0), SegmentId.of("foo1", Intervals.of("2001-01-01T/P1D"), "test", 0), SegmentId.of("foo1", Intervals.of("2001-01-02T/P1D"), "test", 0), SegmentId.of("foo1", Intervals.of("2001-01-03T/P1D"), "test", 0) - )); - - return expectedSegments; + ) + ); } @Nonnull private List expectedFooRows() { - List expectedRows = new ArrayList<>(); - if (!useDefault) { - expectedRows.add(new Object[]{946684800000L, "", 1L}); - } - expectedRows.addAll(ImmutableList.of( + return ImmutableList.of( + new Object[]{946684800000L, "", 1L}, new Object[]{946771200000L, "10.1", 1L}, new Object[]{946857600000L, "2", 1L}, new Object[]{978307200000L, "1", 1L}, new Object[]{978393600000L, "def", 1L}, new Object[]{978480000000L, "abc", 1L} - )); - return expectedRows; + ); } private CompactionState expectedCompactionState( diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQSelectTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQSelectTest.java index 6b904e5f1495..39df97297162 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQSelectTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQSelectTest.java @@ -24,7 +24,6 @@ import com.google.common.collect.ImmutableSet; import org.apache.calcite.avatica.ColumnMetaData; import org.apache.calcite.avatica.remote.TypedValue; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.impl.CsvInputFormat; import org.apache.druid.data.input.impl.InlineInputSource; import org.apache.druid.data.input.impl.JsonInputFormat; @@ -45,7 +44,6 @@ import org.apache.druid.msq.indexing.destination.MSQSelectDestination; import org.apache.druid.msq.indexing.destination.TaskReportMSQDestination; import org.apache.druid.msq.indexing.report.MSQResultsReport; -import org.apache.druid.msq.querykit.common.SortMergeJoinFrameProcessorFactory; import org.apache.druid.msq.test.CounterSnapshotMatcher; import org.apache.druid.msq.test.MSQTestBase; import org.apache.druid.msq.util.MultiStageQueryContext; @@ -53,7 +51,6 @@ import org.apache.druid.query.JoinAlgorithm; import org.apache.druid.query.LookupDataSource; import org.apache.druid.query.OrderBy; -import org.apache.druid.query.Query; import org.apache.druid.query.QueryDataSource; import org.apache.druid.query.TableDataSource; import org.apache.druid.query.UnionDataSource; @@ -858,7 +855,7 @@ public void testJoinWithLookup(String contextName, Map context) DruidExpression.ofColumn(ColumnType.STRING, "dim2"), DruidExpression.ofColumn(ColumnType.STRING, "j0.k") ), - NullHandling.sqlCompatible() ? JoinType.INNER : JoinType.LEFT + JoinType.INNER ) ) .setInterval(querySegmentSpec(Filtration.eternity())) @@ -883,12 +880,7 @@ public void testJoinWithLookup(String contextName, Map context) .build()) .setExpectedRowSignature(rowSignature) .setExpectedResultRows( - NullHandling.sqlCompatible() - ? ImmutableList.of( - new Object[]{"xabc", 1L} - ) - : ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 3L}, + ImmutableList.of( new Object[]{"xabc", 1L} ) ) @@ -981,22 +973,12 @@ private void testJoin(String contextName, Map context, final Joi .add("EXPR$1", ColumnType.DOUBLE) .build(); - final ImmutableList expectedResults; - - if (NullHandling.sqlCompatible()) { - expectedResults = ImmutableList.of( - new Object[]{null, 4.0}, - new Object[]{"", 3.0}, - new Object[]{"a", 2.5}, - new Object[]{"abc", 5.0} - ); - } else { - expectedResults = ImmutableList.of( - new Object[]{"", 3.6666666666666665}, - new Object[]{"a", 2.5}, - new Object[]{"abc", 5.0} - ); - } + final ImmutableList expectedResults = ImmutableList.of( + new Object[]{null, 4.0}, + new Object[]{"", 3.0}, + new Object[]{"a", 2.5}, + new Object[]{"abc", 5.0} + ); final GroupByQuery query = GroupByQuery.builder() @@ -1052,21 +1034,12 @@ private void testJoin(String contextName, Map context, final Joi .setDimensions(new DefaultDimensionSpec("dim2", "d0", ColumnType.STRING)) .setGranularity(Granularities.ALL) .setAggregatorSpecs( - useDefault - ? aggregators( - new DoubleSumAggregatorFactory("a0:sum", "m2"), - new CountAggregatorFactory("a0:count") - ) - : aggregators( + aggregators( new DoubleSumAggregatorFactory("a0:sum", "m2"), new FilteredAggregatorFactory( new CountAggregatorFactory("a0:count"), notNull("m2"), - - // Not sure why the name is only set in SQL-compatible null mode. Seems strange. - // May be due to JSON serialization: name is set on the serialized aggregator even - // if it was originally created with no name. - NullHandling.sqlCompatible() ? "a0:count" : null + "a0:count" ) ) ) @@ -1778,9 +1751,9 @@ public void testScanWithMultiValueSelectQuery(String contextName, Map expected = new ArrayList<>(); - expected.add(new Object[]{null, !useDefault ? 2L : 3L}); - if (!useDefault) { - expected.add(new Object[]{Collections.singletonList(""), 1L}); - } - expected.addAll(ImmutableList.of( + List expected = ImmutableList.of( + new Object[]{null, 2L}, + new Object[]{Collections.singletonList(""), 1L}, new Object[]{Arrays.asList("a", "b"), 1L}, new Object[]{Arrays.asList("b", "c"), 1L}, new Object[]{Collections.singletonList("d"), 1L} - )); + ); testSelectQuery() .setSql("select MV_TO_ARRAY(dim3), count(*) as cnt1 from foo group by MV_TO_ARRAY(dim3)") @@ -2333,7 +2301,7 @@ public void testGroupByMultiValueMeasureQuery(String contextName, Map context) - { - // This test asserts that the join algorithm used is a different one from that supplied. In sqlCompatible() mode - // the query gets planned differently, therefore we do use the sortMerge processor. Instead of having separate - // handling, a similar test has been described in CalciteJoinQueryMSQTest, therefore we don't want to repeat that - // here, hence ignoring in sqlCompatible() mode - if (NullHandling.sqlCompatible()) { - return; - } - - RowSignature rowSignature = RowSignature.builder().add("cnt", ColumnType.LONG).build(); - - Map queryContext = new HashMap<>(context); - queryContext.put(PlannerContext.CTX_SQL_JOIN_ALGORITHM, JoinAlgorithm.SORT_MERGE.toString()); - - Query expectedQuery; - - expectedQuery = GroupByQuery - .builder() - .setDataSource( - join( - new QueryDataSource( - newScanQueryBuilder() - .dataSource("foo") - .virtualColumns(expressionVirtualColumn("v0", "0", ColumnType.LONG)) - .columns("v0") - .columnTypes(ColumnType.LONG) - .context(defaultScanQueryContext( - queryContext, - RowSignature.builder().add("v0", ColumnType.LONG).build() - )) - .intervals(querySegmentSpec(Intervals.ETERNITY)) - .build() - ), - new QueryDataSource( - GroupByQuery.builder() - .setDataSource("foo") - .setDimensions( - new DefaultDimensionSpec("m1", "d0", ColumnType.FLOAT) - ) - .setContext(queryContext) - .setQuerySegmentSpec(querySegmentSpec(Intervals.ETERNITY)) - .setGranularity(Granularities.ALL) - .setPostAggregatorSpecs( - expressionPostAgg( - "a0", - "1", - ColumnType.LONG - ) - ) - .build() - - ), - "j0.", - "(CAST(floor(100), 'DOUBLE') == \"j0.d0\")", - JoinType.LEFT, - null, - JoinAlgorithm.SORT_MERGE - ) - ) - .setAggregatorSpecs( - new FilteredAggregatorFactory( - new CountAggregatorFactory("a0"), - isNull("j0.a0"), - "a0" - ) - ) - .setContext(queryContext) - .setQuerySegmentSpec(querySegmentSpec(Intervals.ETERNITY)) - .setGranularity(Granularities.ALL) - .build(); - - testSelectQuery() - .setSql( - "SELECT COUNT(*) FILTER (WHERE FLOOR(100) NOT IN (SELECT m1 FROM foo)) AS cnt " - + "FROM foo" - ) - .setExpectedRowSignature(rowSignature) - .setExpectedMSQSpec( - MSQSpec - .builder() - .query(expectedQuery) - .columnMappings(new ColumnMappings( - ImmutableList.of( - new ColumnMapping("a0", "cnt") - ) - )) - .destination(isDurableStorageDestination(contextName, context) - ? DurableStorageMSQDestination.INSTANCE - : TaskReportMSQDestination.INSTANCE) - .tuningConfig(MSQTuningConfig.defaultConfig()) - .build()) - .setQueryContext(queryContext) - .addAdhocReportAssertions( - msqTaskReportPayload -> msqTaskReportPayload.getStages().getStages().stream().noneMatch( - stage -> stage.getStageDefinition() - .getProcessorFactory() - .getClass() - .equals(SortMergeJoinFrameProcessorFactory.class) - ), - "assert the query didn't use sort merge" - ) - .setExpectedResultRows(ImmutableList.of(new Object[]{6L})) - .verifyResults(); - } - @MethodSource("data") @ParameterizedTest(name = "{index}:with context {0}") public void testSelectUnnestOnInlineFoo(String contextName, Map context) @@ -2681,16 +2541,7 @@ public void testSelectUnnestOnFoo(String contextName, Map contex .setExpectedRowSignature(outputSignature) .setQueryContext(context) .setExpectedResultRows( - useDefault ? ImmutableList.of( - new Object[]{"a"}, - new Object[]{"b"}, - new Object[]{"b"}, - new Object[]{"c"}, - new Object[]{"d"}, - new Object[]{""}, - new Object[]{""}, - new Object[]{""} - ) : ImmutableList.of( + ImmutableList.of( new Object[]{"a"}, new Object[]{"b"}, new Object[]{"b"}, @@ -2770,10 +2621,7 @@ public void testSelectUnnestOnQueryFoo(String contextName, Map c .setExpectedRowSignature(outputSignature) .setQueryContext(context) .setExpectedResultRows( - useDefault ? ImmutableList.of( - new Object[]{"a"}, - new Object[]{"b"} - ) : ImmutableList.of( + ImmutableList.of( new Object[]{"a"}, new Object[]{"b"}, new Object[]{""} @@ -2843,12 +2691,8 @@ public void testUnionAllUsingUnionDataSource(String contextName, Map expectedMultiValueFooRowsGroup() { ArrayList expected = new ArrayList<>(); - if (useDefault) { - expected.add(new Object[]{"", 3L}); - } else { - expected.add(new Object[]{null, 2L}); - expected.add(new Object[]{"", 1L}); - } + expected.add(new Object[]{null, 2L}); + expected.add(new Object[]{"", 1L}); expected.addAll(ImmutableList.of( new Object[]{"a", 1L}, new Object[]{"b", 2L}, @@ -2860,18 +2704,14 @@ private List expectedMultiValueFooRowsGroup() private List expectedMultiValueFooRowsGroupByList() { - ArrayList expected = new ArrayList<>(); - expected.add(new Object[]{null, !useDefault ? 2L : 3L}); - if (!useDefault) { - expected.add(new Object[]{Collections.singletonList(""), 1L}); - } - expected.addAll(ImmutableList.of( + return ImmutableList.of( + new Object[]{null, 2L}, + new Object[]{Collections.singletonList(""), 1L}, new Object[]{Collections.singletonList("a"), 1L}, new Object[]{Collections.singletonList("b"), 2L}, new Object[]{Collections.singletonList("c"), 1L}, new Object[]{Collections.singletonList("d"), 1L} - )); - return expected; + ); } private static Map enableMultiValueUnnesting(Map context, boolean value) diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQWindowTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQWindowTest.java index a3351d1e0591..94a64a1f0304 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQWindowTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQWindowTest.java @@ -22,7 +22,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.ISE; import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.granularity.Granularities; @@ -1250,15 +1249,6 @@ public void testWindowOnFooWithDim2() .build()) .setExpectedRowSignature(rowSignature) .setExpectedResultRows( - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{"", 11.0}, - new Object[]{"", 11.0}, - new Object[]{"", 11.0}, - new Object[]{"a", 5.0}, - new Object[]{"a", 5.0}, - new Object[]{"abc", 5.0} - ) : ImmutableList.of( new Object[]{null, 8.0}, new Object[]{null, 8.0}, @@ -1347,8 +1337,8 @@ public void testWindowOnFooWithEmptyOverWithUnnest() new Object[]{2.0f, 24.0, "c"}, new Object[]{3.0f, 24.0, "d"}, new Object[]{4.0f, 24.0, ""}, - new Object[]{5.0f, 24.0, NullHandling.sqlCompatible() ? null : ""}, - new Object[]{6.0f, 24.0, NullHandling.sqlCompatible() ? null : ""} + new Object[]{5.0f, 24.0, null}, + new Object[]{6.0f, 24.0, null} )) .setQueryContext(DEFAULT_MSQ_CONTEXT) .verifyResults(); @@ -1431,8 +1421,8 @@ public void testWindowOnFooWithPartitionByAndWithUnnest() new Object[]{2.0f, 4.0, "c"}, new Object[]{3.0f, 3.0, "d"}, new Object[]{4.0f, 4.0, ""}, - new Object[]{5.0f, 5.0, NullHandling.sqlCompatible() ? null : ""}, - new Object[]{6.0f, 6.0, NullHandling.sqlCompatible() ? null : ""} + new Object[]{5.0f, 5.0, null}, + new Object[]{6.0f, 6.0, null} )) .setQueryContext(DEFAULT_MSQ_CONTEXT) .verifyResults(); @@ -1561,7 +1551,7 @@ public void testReplaceWithWindowsAndUnnest() new Object[]{946771200000L, 2.0f, 4.0, "b"}, new Object[]{946771200000L, 2.0f, 4.0, "c"}, new Object[]{946857600000L, 3.0f, 3.0, "d"}, - new Object[]{978307200000L, 4.0f, 4.0, NullHandling.sqlCompatible() ? "" : null}, + new Object[]{978307200000L, 4.0f, 4.0, ""}, new Object[]{978393600000L, 5.0f, 5.0, null}, new Object[]{978480000000L, 6.0f, 6.0, null} ) @@ -2124,7 +2114,7 @@ public void testWindowOnMixOfEmptyAndNonEmptyOverWithMultipleWorkers() + "group by countryName, cityName, channel " + "order by countryName, cityName, channel"; - final String nullValue = NullHandling.sqlCompatible() ? null : ""; + final String nullValue = null; testSelectQuery() .setSql(sql) diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/indexing/MSQCompactionRunnerTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/indexing/MSQCompactionRunnerTest.java index ae59fe1383dc..31c578407aed 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/indexing/MSQCompactionRunnerTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/indexing/MSQCompactionRunnerTest.java @@ -27,7 +27,6 @@ import com.google.common.collect.Iterables; import org.apache.druid.client.indexing.ClientCompactionTaskGranularitySpec; import org.apache.druid.client.indexing.ClientCompactionTaskTransformSpec; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.impl.DimensionSchema; import org.apache.druid.data.input.impl.DimensionsSpec; import org.apache.druid.data.input.impl.LongDimensionSchema; @@ -76,7 +75,6 @@ import org.apache.druid.sql.calcite.parser.DruidSqlInsert; import org.joda.time.Interval; import org.junit.Assert; -import org.junit.BeforeClass; import org.junit.Test; import javax.annotation.Nullable; @@ -132,13 +130,6 @@ public class MSQCompactionRunnerTest private static final MSQCompactionRunner MSQ_COMPACTION_RUNNER = new MSQCompactionRunner(JSON_MAPPER, TestExprMacroTable.INSTANCE, null); private static final List PARTITION_DIMENSIONS = Collections.singletonList(STRING_DIMENSION.getName()); - - @BeforeClass - public static void setupClass() - { - NullHandling.initializeForTests(); - } - @Test public void testMultipleDisjointCompactionIntervalsAreInvalid() { diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/querykit/common/SortMergeJoinFrameProcessorTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/querykit/common/SortMergeJoinFrameProcessorTest.java index dcf5ffe8a87c..7e941e047edc 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/querykit/common/SortMergeJoinFrameProcessorTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/querykit/common/SortMergeJoinFrameProcessorTest.java @@ -24,7 +24,6 @@ import com.google.common.collect.Lists; import com.google.common.primitives.Ints; import com.google.common.util.concurrent.ListenableFuture; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.guava.FutureUtils; import org.apache.druid.frame.allocation.ArenaMemoryAllocator; import org.apache.druid.frame.allocation.SingleMemoryAllocatorFactory; @@ -896,16 +895,9 @@ public void testLeftJoinCountryNumber() throws Exception final String countryNameForNull; final Long countryNumberForNull; - if (NullHandling.sqlCompatible()) { - countryCodeForNull = null; - countryNameForNull = null; - countryNumberForNull = null; - } else { - // In default-value mode, null country number from the left-hand table converts to zero, which matches Australia. - countryCodeForNull = "AU"; - countryNameForNull = "Australia"; - countryNumberForNull = 0L; - } + countryCodeForNull = null; + countryNameForNull = null; + countryNumberForNull = null; final List> expectedRows = Lists.newArrayList( Arrays.asList("Agama mossambica", null, countryCodeForNull, countryNameForNull, countryNumberForNull), @@ -939,12 +931,6 @@ public void testLeftJoinCountryNumber() throws Exception Arrays.asList("History of Fourems", "MMMM", "MMMM", "Fourems", 205L) ); - if (!NullHandling.sqlCompatible()) { - // Sorting order is different in default-value mode, since 0 and null collapse. - // "Peremptory norm" moves before "Rallicula". - expectedRows.add(3, expectedRows.remove(5)); - } - assertResult(processor, outputChannel.readable(), joinSignature, expectedRows); } @@ -991,16 +977,9 @@ public void testRightJoinCountryNumber() throws Exception final String countryNameForNull; final Long countryNumberForNull; - if (NullHandling.sqlCompatible()) { - countryCodeForNull = null; - countryNameForNull = null; - countryNumberForNull = null; - } else { - // In default-value mode, null country number from the left-hand table converts to zero, which matches Australia. - countryCodeForNull = "AU"; - countryNameForNull = "Australia"; - countryNumberForNull = 0L; - } + countryCodeForNull = null; + countryNameForNull = null; + countryNumberForNull = null; final List> expectedRows = Lists.newArrayList( Arrays.asList("Agama mossambica", null, countryCodeForNull, countryNameForNull, countryNumberForNull), @@ -1034,12 +1013,6 @@ public void testRightJoinCountryNumber() throws Exception Arrays.asList("History of Fourems", "MMMM", "MMMM", "Fourems", 205L) ); - if (!NullHandling.sqlCompatible()) { - // Sorting order is different in default-value mode, since 0 and null collapse. - // "Peremptory norm" moves before "Rallicula". - expectedRows.add(3, expectedRows.remove(5)); - } - assertResult(processor, outputChannel.readable(), joinSignature, expectedRows); } diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/sql/resources/SqlMSQStatementResourcePostTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/sql/resources/SqlMSQStatementResourcePostTest.java index 302a9951cc83..e810de56f4e1 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/sql/resources/SqlMSQStatementResourcePostTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/sql/resources/SqlMSQStatementResourcePostTest.java @@ -24,7 +24,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import org.apache.calcite.sql.type.SqlTypeName; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.java.util.common.guava.Sequences; @@ -683,7 +682,7 @@ public void testInsert() MSQTestOverlordServiceClient.CREATED_TIME, null, MSQTestOverlordServiceClient.DURATION, - new ResultSetInformation(NullHandling.sqlCompatible() ? 6L : 5L, 0L, null, "foo1", null, null), + new ResultSetInformation(6L, 0L, null, "foo1", null, null), null ); assertSqlStatementResult(expected, actual); @@ -726,7 +725,7 @@ public void testReplaceAll() MSQTestOverlordServiceClient.CREATED_TIME, null, MSQTestOverlordServiceClient.DURATION, - new ResultSetInformation(NullHandling.sqlCompatible() ? 6L : 5L, 0L, null, "foo1", null, null), + new ResultSetInformation(6L, 0L, null, "foo1", null, null), null ); assertSqlStatementResult(expected, actual); diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/statistics/DelegateOrMinKeyCollectorTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/statistics/DelegateOrMinKeyCollectorTest.java index cbdc58ae4acf..de1f96d17024 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/statistics/DelegateOrMinKeyCollectorTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/statistics/DelegateOrMinKeyCollectorTest.java @@ -20,7 +20,6 @@ package org.apache.druid.msq.statistics; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.frame.key.ClusterBy; import org.apache.druid.frame.key.KeyColumn; import org.apache.druid.frame.key.KeyOrder; @@ -43,10 +42,6 @@ public class DelegateOrMinKeyCollectorTest private final RowSignature signature = RowSignature.builder().add("x", ColumnType.LONG).build(); private final Comparator comparator = clusterBy.keyComparator(signature); - static { - NullHandling.initializeForTests(); - } - @Test public void testEmpty() { diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/statistics/DistinctKeyCollectorTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/statistics/DistinctKeyCollectorTest.java index 37ac2a108114..943b3108c8fb 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/statistics/DistinctKeyCollectorTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/statistics/DistinctKeyCollectorTest.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableList; import it.unimi.dsi.fastutil.objects.Object2LongRBTreeMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.frame.key.ClusterBy; import org.apache.druid.frame.key.ClusterByPartition; import org.apache.druid.frame.key.ClusterByPartitions; @@ -49,10 +48,6 @@ public class DistinctKeyCollectorTest private final Comparator comparator = clusterBy.keyComparator(signature); private final int numKeys = 500_000; - static { - NullHandling.initializeForTests(); - } - @Test public void test_empty() { diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/statistics/QuantilesSketchKeyCollectorTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/statistics/QuantilesSketchKeyCollectorTest.java index ebc677ad1144..c62a191ef5c4 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/statistics/QuantilesSketchKeyCollectorTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/statistics/QuantilesSketchKeyCollectorTest.java @@ -20,7 +20,6 @@ package org.apache.druid.msq.statistics; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.frame.key.ClusterBy; import org.apache.druid.frame.key.ClusterByPartition; import org.apache.druid.frame.key.ClusterByPartitions; @@ -47,10 +46,6 @@ public class QuantilesSketchKeyCollectorTest private final Comparator comparator = clusterBy.keyComparator(signature); private final int numKeys = 500_000; - static { - NullHandling.initializeForTests(); - } - @Test public void test_empty() { diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteSelectQueryMSQTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteSelectQueryMSQTest.java index 6e2032a10958..566778ee7c99 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteSelectQueryMSQTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteSelectQueryMSQTest.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.ISE; import org.apache.druid.msq.sql.MSQTaskSqlEngine; import org.apache.druid.sql.calcite.CalciteQueryTest; @@ -113,22 +112,6 @@ public void testUnplannableScanOrderByNonTime() } - @Disabled - @Override - @Test - public void testUnplannableJoinQueriesInNonSQLCompatibleMode() - { - - } - - @Disabled - @Override - @Test - public void testQueryWithMoreThanMaxNumericInFilter() - { - - } - @Disabled @Override @Test @@ -209,7 +192,7 @@ public void testFilterParseLongNullable() testBuilder().queryContext(QUERY_CONTEXT_DEFAULT) .sql("select count(*) from druid.foo where parse_long(dim1, 10) is null") .expectedResults( - NullHandling.sqlCompatible() ? ImmutableList.of(new Object[]{4L}) : ImmutableList.of() + ImmutableList.of(new Object[]{4L}) ) .run(); } diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteUnionQueryMSQTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteUnionQueryMSQTest.java index a470615fd0d4..2dbc6da3082a 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteUnionQueryMSQTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteUnionQueryMSQTest.java @@ -20,7 +20,6 @@ package org.apache.druid.msq.test; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.msq.sql.MSQTaskSqlEngine; import org.apache.druid.query.QueryDataSource; @@ -113,10 +112,6 @@ public void testUnionOnSubqueries() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{12L, 3L} - ) : ImmutableList.of( new Object[]{12L, 4L} ) diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/MSQTestBase.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/MSQTestBase.java index 293c91a0cd3d..ba7166f69a3e 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/MSQTestBase.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/MSQTestBase.java @@ -40,7 +40,6 @@ import org.apache.druid.client.ImmutableSegmentLoadInfo; import org.apache.druid.collections.ReferenceCountingResourceHolder; import org.apache.druid.collections.ResourceHolder; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.impl.DimensionsSpec; import org.apache.druid.data.input.impl.LongDimensionSchema; import org.apache.druid.data.input.impl.StringDimensionSchema; @@ -318,8 +317,6 @@ public class MSQTestBase extends BaseCalciteQueryTest public static final String DEFAULT = "default"; public static final String PARALLEL_MERGE = "parallel_merge"; - public final boolean useDefault = NullHandling.replaceWithDefault(); - protected File localFileStorageDir; protected LocalFileStorageConnector localFileStorageConnector; private static final Logger log = new Logger(MSQTestBase.class); diff --git a/extensions-core/protobuf-extensions/src/test/java/org/apache/druid/data/input/protobuf/ProtobufInputFormatTest.java b/extensions-core/protobuf-extensions/src/test/java/org/apache/druid/data/input/protobuf/ProtobufInputFormatTest.java index 0735e80964cf..2069f23893b7 100644 --- a/extensions-core/protobuf-extensions/src/test/java/org/apache/druid/data/input/protobuf/ProtobufInputFormatTest.java +++ b/extensions-core/protobuf-extensions/src/test/java/org/apache/druid/data/input/protobuf/ProtobufInputFormatTest.java @@ -27,7 +27,6 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; import com.google.common.io.Files; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputEntityReader; import org.apache.druid.data.input.InputRow; import org.apache.druid.data.input.InputRowSchema; @@ -76,7 +75,6 @@ public class ProtobufInputFormatTest @Before public void setUp() throws Exception { - NullHandling.initializeForTests(); ExpressionProcessing.initializeForTests(); timestampSpec = new TimestampSpec("timestamp", "iso", null); dimensionsSpec = new DimensionsSpec(Lists.newArrayList( diff --git a/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/StandardDeviationPostAggregator.java b/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/StandardDeviationPostAggregator.java index 559f0c4e8f47..127c597c8d9b 100644 --- a/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/StandardDeviationPostAggregator.java +++ b/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/StandardDeviationPostAggregator.java @@ -24,7 +24,6 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.google.common.base.Preconditions; import com.google.common.collect.Sets; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.aggregation.AggregatorFactory; import org.apache.druid.query.aggregation.PostAggregator; import org.apache.druid.query.aggregation.post.ArithmeticPostAggregator; @@ -81,10 +80,10 @@ public Double compute(Map combinedAggregators) { Object varianceAggregatorCollector = combinedAggregators.get(fieldName); if (!(varianceAggregatorCollector instanceof VarianceAggregatorCollector)) { - return NullHandling.defaultDoubleValue(); + return null; } Double variance = ((VarianceAggregatorCollector) varianceAggregatorCollector).getVariance(isVariancePop); - return variance == null ? NullHandling.defaultDoubleValue() : (Double) Math.sqrt(variance); + return variance == null ? null : (Double) Math.sqrt(variance); } @Override diff --git a/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceAggregator.java b/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceAggregator.java index 5e9c6bf36032..531019fe71f5 100644 --- a/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceAggregator.java +++ b/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceAggregator.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.variance; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.aggregation.Aggregator; import org.apache.druid.segment.BaseDoubleColumnValueSelector; import org.apache.druid.segment.BaseFloatColumnValueSelector; @@ -63,7 +62,6 @@ public double getDouble() public static final class FloatVarianceAggregator extends VarianceAggregator { - private final boolean noNulls = NullHandling.replaceWithDefault(); private final BaseFloatColumnValueSelector selector; public FloatVarianceAggregator(BaseFloatColumnValueSelector selector) @@ -74,7 +72,7 @@ public FloatVarianceAggregator(BaseFloatColumnValueSelector selector) @Override public void aggregate() { - if (noNulls || !selector.isNull()) { + if (!selector.isNull()) { holder.add(selector.getFloat()); } } @@ -82,7 +80,6 @@ public void aggregate() public static final class DoubleVarianceAggregator extends VarianceAggregator { - private final boolean noNulls = NullHandling.replaceWithDefault(); private final BaseDoubleColumnValueSelector selector; public DoubleVarianceAggregator(BaseDoubleColumnValueSelector selector) @@ -93,7 +90,7 @@ public DoubleVarianceAggregator(BaseDoubleColumnValueSelector selector) @Override public void aggregate() { - if (noNulls || !selector.isNull()) { + if (!selector.isNull()) { holder.add(selector.getDouble()); } } @@ -101,7 +98,6 @@ public void aggregate() public static final class LongVarianceAggregator extends VarianceAggregator { - private final boolean noNulls = NullHandling.replaceWithDefault(); private final BaseLongColumnValueSelector selector; public LongVarianceAggregator(BaseLongColumnValueSelector selector) @@ -112,7 +108,7 @@ public LongVarianceAggregator(BaseLongColumnValueSelector selector) @Override public void aggregate() { - if (noNulls || !selector.isNull()) { + if (!selector.isNull()) { holder.add(selector.getLong()); } } diff --git a/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceAggregatorCollector.java b/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceAggregatorCollector.java index 365006734a0e..7f979cc83049 100644 --- a/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceAggregatorCollector.java +++ b/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceAggregatorCollector.java @@ -23,7 +23,6 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.primitives.Doubles; import com.google.common.primitives.Longs; -import org.apache.druid.common.config.NullHandling; import javax.annotation.Nullable; import java.nio.ByteBuffer; @@ -165,7 +164,7 @@ public VarianceAggregatorCollector add(long v) public Double getVariance(boolean variancePop) { if (count == 0) { - return NullHandling.defaultDoubleValue(); + return null; } else if (count == 1) { return 0d; } else { diff --git a/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceAggregatorFactory.java b/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceAggregatorFactory.java index b860ea0a80ca..2645c4399c23 100644 --- a/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceAggregatorFactory.java +++ b/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceAggregatorFactory.java @@ -24,7 +24,6 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.IAE; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.query.aggregation.AggregateCombiner; @@ -270,7 +269,7 @@ public Comparator getComparator() public Object finalizeComputation(@Nullable Object object) { return object == null - ? NullHandling.defaultDoubleValue() + ? null : ((VarianceAggregatorCollector) object).getVariance(isVariancePop); } diff --git a/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceBufferAggregator.java b/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceBufferAggregator.java index d8c4d5df5633..0fdf0adc3d17 100644 --- a/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceBufferAggregator.java +++ b/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceBufferAggregator.java @@ -20,7 +20,6 @@ package org.apache.druid.query.aggregation.variance; import com.google.common.base.Preconditions; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.aggregation.BufferAggregator; import org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector; import org.apache.druid.segment.BaseDoubleColumnValueSelector; @@ -120,7 +119,6 @@ public static void writeCountAndSum(ByteBuffer buf, int position, long count, do public static final class FloatVarianceAggregator extends VarianceBufferAggregator { - private final boolean noNulls = NullHandling.replaceWithDefault(); private final BaseFloatColumnValueSelector selector; public FloatVarianceAggregator(BaseFloatColumnValueSelector selector) @@ -131,7 +129,7 @@ public FloatVarianceAggregator(BaseFloatColumnValueSelector selector) @Override public void aggregate(ByteBuffer buf, int position) { - if (noNulls || !selector.isNull()) { + if (!selector.isNull()) { float v = selector.getFloat(); long count = getCount(buf, position) + 1; double sum = getSum(buf, position) + v; @@ -153,7 +151,6 @@ public void inspectRuntimeShape(RuntimeShapeInspector inspector) public static final class DoubleVarianceAggregator extends VarianceBufferAggregator { - private final boolean noNulls = NullHandling.replaceWithDefault(); private final BaseDoubleColumnValueSelector selector; public DoubleVarianceAggregator(BaseDoubleColumnValueSelector selector) @@ -164,7 +161,7 @@ public DoubleVarianceAggregator(BaseDoubleColumnValueSelector selector) @Override public void aggregate(ByteBuffer buf, int position) { - if (noNulls || !selector.isNull()) { + if (!selector.isNull()) { double v = selector.getDouble(); long count = getCount(buf, position) + 1; double sum = getSum(buf, position) + v; @@ -186,7 +183,6 @@ public void inspectRuntimeShape(RuntimeShapeInspector inspector) public static final class LongVarianceAggregator extends VarianceBufferAggregator { - private final boolean noNulls = NullHandling.replaceWithDefault(); private final BaseLongColumnValueSelector selector; public LongVarianceAggregator(BaseLongColumnValueSelector selector) @@ -197,7 +193,7 @@ public LongVarianceAggregator(BaseLongColumnValueSelector selector) @Override public void aggregate(ByteBuffer buf, int position) { - if (noNulls || !selector.isNull()) { + if (!selector.isNull()) { long v = selector.getLong(); long count = getCount(buf, position) + 1; double sum = getSum(buf, position) + v; diff --git a/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceDoubleVectorAggregator.java b/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceDoubleVectorAggregator.java index 37c87399cf07..846932d44e62 100644 --- a/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceDoubleVectorAggregator.java +++ b/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceDoubleVectorAggregator.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.variance; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.aggregation.VectorAggregator; import org.apache.druid.segment.vector.VectorValueSelector; @@ -32,7 +31,6 @@ public class VarianceDoubleVectorAggregator implements VectorAggregator { private final VectorValueSelector selector; - private final boolean replaceWithDefault = NullHandling.replaceWithDefault(); public VarianceDoubleVectorAggregator(VectorValueSelector selector) { @@ -51,7 +49,7 @@ public void aggregate(ByteBuffer buf, int position, int startRow, int endRow) double[] vector = selector.getDoubleVector(); long count = 0; double sum = 0, nvariance = 0; - boolean[] nulls = replaceWithDefault ? null : selector.getNullVector(); + boolean[] nulls = selector.getNullVector(); for (int i = startRow; i < endRow; i++) { if (nulls == null || !nulls[i]) { count++; @@ -86,7 +84,7 @@ public void aggregate( ) { double[] vector = selector.getDoubleVector(); - boolean[] nulls = replaceWithDefault ? null : selector.getNullVector(); + boolean[] nulls = selector.getNullVector(); for (int i = 0; i < numRows; i++) { int position = positions[i] + positionOffset; int row = rows != null ? rows[i] : i; diff --git a/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceFloatVectorAggregator.java b/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceFloatVectorAggregator.java index 957926e97819..cc7f6e07e535 100644 --- a/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceFloatVectorAggregator.java +++ b/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceFloatVectorAggregator.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.variance; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.aggregation.VectorAggregator; import org.apache.druid.segment.vector.VectorValueSelector; @@ -32,7 +31,6 @@ public class VarianceFloatVectorAggregator implements VectorAggregator { private final VectorValueSelector selector; - private final boolean replaceWithDefault = NullHandling.replaceWithDefault(); public VarianceFloatVectorAggregator(VectorValueSelector selector) { @@ -51,7 +49,7 @@ public void aggregate(ByteBuffer buf, int position, int startRow, int endRow) float[] vector = selector.getFloatVector(); long count = 0; double sum = 0, nvariance = 0; - boolean[] nulls = replaceWithDefault ? null : selector.getNullVector(); + boolean[] nulls = selector.getNullVector(); for (int i = startRow; i < endRow; i++) { if (nulls == null || !nulls[i]) { count++; @@ -86,7 +84,7 @@ public void aggregate( ) { float[] vector = selector.getFloatVector(); - boolean[] nulls = replaceWithDefault ? null : selector.getNullVector(); + boolean[] nulls = selector.getNullVector(); for (int i = 0; i < numRows; i++) { int position = positions[i] + positionOffset; int row = rows != null ? rows[i] : i; diff --git a/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceLongVectorAggregator.java b/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceLongVectorAggregator.java index 69941b658b63..852dd0b0df31 100644 --- a/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceLongVectorAggregator.java +++ b/extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceLongVectorAggregator.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.variance; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.aggregation.VectorAggregator; import org.apache.druid.segment.vector.VectorValueSelector; @@ -32,7 +31,6 @@ public class VarianceLongVectorAggregator implements VectorAggregator { private final VectorValueSelector selector; - private final boolean replaceWithDefault = NullHandling.replaceWithDefault(); public VarianceLongVectorAggregator(VectorValueSelector selector) { @@ -51,7 +49,7 @@ public void aggregate(ByteBuffer buf, int position, int startRow, int endRow) long[] vector = selector.getLongVector(); long count = 0; double sum = 0, nvariance = 0; - boolean[] nulls = replaceWithDefault ? null : selector.getNullVector(); + boolean[] nulls = selector.getNullVector(); for (int i = startRow; i < endRow; i++) { if (nulls == null || !nulls[i]) { count++; @@ -86,7 +84,7 @@ public void aggregate( ) { long[] vector = selector.getLongVector(); - boolean[] nulls = replaceWithDefault ? null : selector.getNullVector(); + boolean[] nulls = selector.getNullVector(); for (int i = 0; i < numRows; i++) { int position = positions[i] + positionOffset; int row = rows != null ? rows[i] : i; diff --git a/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/StandardDeviationPostAggregatorTest.java b/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/StandardDeviationPostAggregatorTest.java index d9a83f4770e0..382a405b1246 100644 --- a/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/StandardDeviationPostAggregatorTest.java +++ b/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/StandardDeviationPostAggregatorTest.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableMap; import nl.jqno.equalsverifier.EqualsVerifier; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.query.aggregation.PostAggregator; import org.apache.druid.testing.InitializedNullHandlingTest; @@ -99,7 +98,7 @@ public void testEquals() public void testComputeForNullVarianceShouldReturnDefaultDoubleValue() { Mockito.when(collector.getVariance(true)).thenReturn(null); - Assert.assertEquals(NullHandling.defaultDoubleValue(), target.compute(combinedAggregators)); + Assert.assertNull(target.compute(combinedAggregators)); } @Test diff --git a/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/VarianceAggregatorFactoryTest.java b/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/VarianceAggregatorFactoryTest.java index 20123aac1dea..1832dd18d93d 100644 --- a/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/VarianceAggregatorFactoryTest.java +++ b/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/VarianceAggregatorFactoryTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.variance; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.query.Druids; import org.apache.druid.query.aggregation.CountAggregatorFactory; @@ -76,14 +75,14 @@ public void testFinalizeComputationWithZeroCountShouldReturnNull() { VarianceAggregatorFactory target = new VarianceAggregatorFactory("test", "test", null, null); VarianceAggregatorCollector v1 = new VarianceAggregatorCollector(); - Assert.assertEquals(NullHandling.defaultDoubleValue(), target.finalizeComputation(v1)); + Assert.assertNull(target.finalizeComputation(v1)); } @Test public void testFinalizeComputationWithNullShouldReturnNull() { VarianceAggregatorFactory target = new VarianceAggregatorFactory("test", "test", null, null); - Assert.assertEquals(NullHandling.defaultDoubleValue(), target.finalizeComputation(null)); + Assert.assertNull(target.finalizeComputation(null)); } @Test diff --git a/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/VarianceAggregatorTest.java b/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/VarianceAggregatorTest.java index d2be00b79d2d..fe1dd4ea887c 100644 --- a/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/VarianceAggregatorTest.java +++ b/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/VarianceAggregatorTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.variance; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.query.aggregation.TestFloatColumnSelector; import org.apache.druid.query.aggregation.TestObjectColumnSelector; @@ -96,7 +95,7 @@ private void assertValues(VarianceAggregatorCollector holder, long count, double Assert.assertEquals(sum, holder.sum, 0.0001); Assert.assertEquals(nvariance, holder.nvariance, 0.0001); if (count == 0) { - Assert.assertEquals(NullHandling.defaultDoubleValue(), holder.getVariance(false)); + Assert.assertNull(holder.getVariance(false)); } else { Assert.assertEquals(variances_pop[(int) count - 1], holder.getVariance(true), 0.0001); Assert.assertEquals(variances_samp[(int) count - 1], holder.getVariance(false), 0.0001); diff --git a/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/VarianceDoubleVectorAggregatorTest.java b/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/VarianceDoubleVectorAggregatorTest.java index 4204c2ac683b..8cc9a68a1a3a 100644 --- a/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/VarianceDoubleVectorAggregatorTest.java +++ b/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/VarianceDoubleVectorAggregatorTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.variance; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.segment.vector.VectorValueSelector; import org.apache.druid.testing.InitializedNullHandlingTest; import org.junit.Assert; @@ -87,11 +86,11 @@ public void aggregateWithNulls() target.aggregate(buf, POSITION, START_ROW, VALUES.length); VarianceAggregatorCollector collector = VarianceBufferAggregator.getVarianceCollector(buf, POSITION); Assert.assertEquals( - VALUES.length - START_ROW - (NullHandling.replaceWithDefault() ? 0 : 2), + VALUES.length - START_ROW - 2, collector.count ); - Assert.assertEquals(NullHandling.replaceWithDefault() ? 217.67 : 134, collector.sum, EPSILON); - Assert.assertEquals(NullHandling.replaceWithDefault() ? 7565.211675 : 6272, collector.nvariance, EPSILON); + Assert.assertEquals(134, collector.sum, EPSILON); + Assert.assertEquals(6272, collector.nvariance, EPSILON); } @Test @@ -145,7 +144,7 @@ public void aggregateBatchWithRowsAndNulls() buf, positions[i] + positionOffset ); - boolean isNull = !NullHandling.replaceWithDefault() && NULLS[rows[i]]; + boolean isNull = NULLS[rows[i]]; Assert.assertEquals(isNull ? 0 : 1, collector.count); Assert.assertEquals(isNull ? 0 : VALUES[rows[i]], collector.sum, EPSILON); Assert.assertEquals(0, collector.nvariance, EPSILON); @@ -169,8 +168,6 @@ private void clearBufferForPositions(int offset, int... positions) private void mockNullsVector() { - if (!NullHandling.replaceWithDefault()) { - Mockito.doReturn(NULLS).when(selector).getNullVector(); - } + Mockito.doReturn(NULLS).when(selector).getNullVector(); } } diff --git a/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/VarianceFloatVectorAggregatorTest.java b/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/VarianceFloatVectorAggregatorTest.java index ed2f0a3c8d57..162f60ac5f0b 100644 --- a/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/VarianceFloatVectorAggregatorTest.java +++ b/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/VarianceFloatVectorAggregatorTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.variance; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.segment.vector.VectorValueSelector; import org.apache.druid.testing.InitializedNullHandlingTest; import org.junit.Assert; @@ -87,11 +86,11 @@ public void aggregateWithNulls() target.aggregate(buf, POSITION, START_ROW, VALUES.length); VarianceAggregatorCollector collector = VarianceBufferAggregator.getVarianceCollector(buf, POSITION); Assert.assertEquals( - VALUES.length - START_ROW - (NullHandling.replaceWithDefault() ? 0 : 2), + VALUES.length - START_ROW - 2, collector.count ); - Assert.assertEquals(NullHandling.replaceWithDefault() ? 217.67000007 : 134, collector.sum, EPSILON); - Assert.assertEquals(NullHandling.replaceWithDefault() ? 7565.2116703 : 6272, collector.nvariance, EPSILON); + Assert.assertEquals(134, collector.sum, EPSILON); + Assert.assertEquals(6272, collector.nvariance, EPSILON); } @Test @@ -145,7 +144,7 @@ public void aggregateBatchWithRowsAndNulls() buf, positions[i] + positionOffset ); - boolean isNull = !NullHandling.replaceWithDefault() && NULLS[rows[i]]; + boolean isNull = NULLS[rows[i]]; Assert.assertEquals(isNull ? 0 : 1, collector.count); Assert.assertEquals(isNull ? 0 : VALUES[rows[i]], collector.sum, EPSILON); Assert.assertEquals(0, collector.nvariance, EPSILON); @@ -169,8 +168,6 @@ private void clearBufferForPositions(int offset, int... positions) private void mockNullsVector() { - if (!NullHandling.replaceWithDefault()) { - Mockito.doReturn(NULLS).when(selector).getNullVector(); - } + Mockito.doReturn(NULLS).when(selector).getNullVector(); } } diff --git a/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/VarianceLongVectorAggregatorTest.java b/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/VarianceLongVectorAggregatorTest.java index d47bf5cd3f38..017d6ccb22f3 100644 --- a/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/VarianceLongVectorAggregatorTest.java +++ b/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/VarianceLongVectorAggregatorTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.variance; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.segment.vector.VectorValueSelector; import org.apache.druid.testing.InitializedNullHandlingTest; import org.junit.Assert; @@ -87,11 +86,11 @@ public void aggregateWithNulls() target.aggregate(buf, POSITION, START_ROW, VALUES.length); VarianceAggregatorCollector collector = VarianceBufferAggregator.getVarianceCollector(buf, POSITION); Assert.assertEquals( - VALUES.length - START_ROW - (NullHandling.replaceWithDefault() ? 0 : 2), + VALUES.length - START_ROW - 2, collector.count ); - Assert.assertEquals(NullHandling.replaceWithDefault() ? 217 : 134, collector.sum, EPSILON); - Assert.assertEquals(NullHandling.replaceWithDefault() ? 7606.75 : 6272, collector.nvariance, EPSILON); + Assert.assertEquals(134, collector.sum, EPSILON); + Assert.assertEquals(6272, collector.nvariance, EPSILON); } @Test @@ -145,7 +144,7 @@ public void aggregateBatchWithRowsAndNulls() buf, positions[i] + positionOffset ); - boolean isNull = !NullHandling.replaceWithDefault() && NULLS[rows[i]]; + boolean isNull = NULLS[rows[i]]; Assert.assertEquals(isNull ? 0 : 1, collector.count); Assert.assertEquals(isNull ? 0 : VALUES[rows[i]], collector.sum, EPSILON); Assert.assertEquals(0, collector.nvariance, EPSILON); @@ -169,8 +168,6 @@ private void clearBufferForPositions(int offset, int... positions) private void mockNullsVector() { - if (!NullHandling.replaceWithDefault()) { - Mockito.doReturn(NULLS).when(selector).getNullVector(); - } + Mockito.doReturn(NULLS).when(selector).getNullVector(); } } diff --git a/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/VarianceTimeseriesQueryTest.java b/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/VarianceTimeseriesQueryTest.java index ccf21d2fe811..37b80810c7ea 100644 --- a/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/VarianceTimeseriesQueryTest.java +++ b/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/VarianceTimeseriesQueryTest.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.query.Druids; import org.apache.druid.query.QueryPlus; @@ -142,8 +141,8 @@ public void testEmptyTimeseries() .build(); Map resultMap = new HashMap<>(); resultMap.put("rows", 0L); - resultMap.put("index", NullHandling.defaultDoubleValue()); - resultMap.put("variance", NullHandling.defaultDoubleValue()); + resultMap.put("index", null); + resultMap.put("variance", null); List> expectedResults = ImmutableList.of( new Result<>( DateTimes.of("2020-04-02"), diff --git a/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/sql/VarianceSqlAggregatorTest.java b/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/sql/VarianceSqlAggregatorTest.java index 1594f3c99310..9ccd61547e33 100644 --- a/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/sql/VarianceSqlAggregatorTest.java +++ b/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/sql/VarianceSqlAggregatorTest.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableList; import com.google.inject.Injector; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.data.input.impl.DimensionSchema; import org.apache.druid.data.input.impl.DimensionsSpec; @@ -162,10 +161,6 @@ public void addToHolder(VarianceAggregatorCollector holder, Object raw, int mult int v = ((Integer) raw).intValue() * multiply; holder.add(v); } - } else { - if (NullHandling.replaceWithDefault()) { - holder.add(0.0f); - } } } @@ -438,16 +433,11 @@ public void testStdDevWithVirtualColumns() @Test public void testVarianceOrderBy() { - List expectedResults = NullHandling.sqlCompatible() - ? ImmutableList.of( + List expectedResults = ImmutableList.of( new Object[]{"a", 0.0}, new Object[]{null, 0.0}, new Object[]{"", 0.0}, new Object[]{"abc", null} - ) : ImmutableList.of( - new Object[]{"a", 0.5}, - new Object[]{"", 0.003333333432674409}, - new Object[]{"abc", 0.0} ); testQuery( @@ -515,9 +505,7 @@ public void testVariancesOnCastedString() ), ResultMatchMode.EQUALS_EPS, ImmutableList.of( - NullHandling.replaceWithDefault() - ? new Object[]{3.61497656362466, 3.960008417499471, 3.960008417499471, 15.681666666666667} - : new Object[]{4.074582459862878, 4.990323970779185, 4.990323970779185, 24.903333333333332} + new Object[]{4.074582459862878, 4.990323970779185, 4.990323970779185, 24.903333333333332} ) ); } @@ -541,7 +529,7 @@ public void testEmptyTimeseriesResults() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .filters(numericEquality("dim2", 0L, ColumnType.LONG)) + .filters(equality("dim2", 0L, ColumnType.LONG)) .aggregators( new VarianceAggregatorFactory("a0:agg", "dbl1", "population", "double"), new VarianceAggregatorFactory("a1:agg", "dbl1", "sample", "double"), @@ -566,9 +554,7 @@ public void testEmptyTimeseriesResults() ), ResultMatchMode.EQUALS_EPS, ImmutableList.of( - NullHandling.replaceWithDefault() - ? new Object[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} - : new Object[]{null, null, null, null, null, null, null, null} + new Object[]{null, null, null, null, null, null, null, null} ) ); } @@ -647,9 +633,7 @@ public void testGroupByAggregatorDefaultValues() ), ResultMatchMode.EQUALS_EPS, ImmutableList.of( - NullHandling.replaceWithDefault() - ? new Object[]{"a", 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} - : new Object[]{"a", null, null, null, null, null, null, null, null} + new Object[]{"a", null, null, null, null, null, null, null, null} ) ); } diff --git a/extensions-core/testing-tools/src/test/java/org/apache/druid/query/sql/SleepSqlTest.java b/extensions-core/testing-tools/src/test/java/org/apache/druid/query/sql/SleepSqlTest.java index 3d664960e962..723974676463 100644 --- a/extensions-core/testing-tools/src/test/java/org/apache/druid/query/sql/SleepSqlTest.java +++ b/extensions-core/testing-tools/src/test/java/org/apache/druid/query/sql/SleepSqlTest.java @@ -20,7 +20,6 @@ package org.apache.druid.query.sql; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.guice.SleepModule; import org.apache.druid.initialization.DruidModule; import org.apache.druid.query.Druids; @@ -79,7 +78,7 @@ public void testSleepFunction() .build() ), ImmutableList.of( - new Object[]{NullHandling.replaceWithDefault() ? "" : null} + new Object[]{null} ) ); } diff --git a/indexing-hadoop/src/main/java/org/apache/druid/indexer/InputRowSerde.java b/indexing-hadoop/src/main/java/org/apache/druid/indexer/InputRowSerde.java index 40339d4b6df9..720fcafc4f9d 100644 --- a/indexing-hadoop/src/main/java/org/apache/druid/indexer/InputRowSerde.java +++ b/indexing-hadoop/src/main/java/org/apache/druid/indexer/InputRowSerde.java @@ -19,7 +19,6 @@ package org.apache.druid.indexer; -import com.google.common.base.Supplier; import com.google.common.collect.Lists; import com.google.common.io.ByteArrayDataInput; import com.google.common.io.ByteArrayDataOutput; @@ -68,29 +67,21 @@ public class InputRowSerde private static void writeNullableNumeric( T ret, final ByteArrayDataOutput out, - final Supplier getDefault, final Consumer write) { - if (ret == null) { - ret = getDefault.get(); - } - - // Write the null byte only if the default numeric value is still null. if (ret == null) { out.writeByte(NullHandling.IS_NULL_BYTE); return; } - if (NullHandling.sqlCompatible()) { - out.writeByte(NullHandling.IS_NOT_NULL_BYTE); - } + out.writeByte(NullHandling.IS_NOT_NULL_BYTE); write.accept(ret); } private static boolean isNullByteSet(final ByteArrayDataInput in) { - return NullHandling.sqlCompatible() && in.readByte() == NullHandling.IS_NULL_BYTE; + return in.readByte() == NullHandling.IS_NULL_BYTE; } public interface IndexSerdeTypeHelper @@ -205,7 +196,7 @@ public void serialize(ByteArrayDataOutput out, Object value) exceptionToThrow = pe; } - writeNullableNumeric(ret, out, NullHandling::defaultLongValue, out::writeLong); + writeNullableNumeric(ret, out, out::writeLong); if (exceptionToThrow != null) { throw exceptionToThrow; @@ -240,7 +231,7 @@ public void serialize(ByteArrayDataOutput out, Object value) exceptionToThrow = pe; } - writeNullableNumeric(ret, out, NullHandling::defaultFloatValue, out::writeFloat); + writeNullableNumeric(ret, out, out::writeFloat); if (exceptionToThrow != null) { throw exceptionToThrow; @@ -275,7 +266,7 @@ public void serialize(ByteArrayDataOutput out, Object value) exceptionToThrow = pe; } - writeNullableNumeric(ret, out, NullHandling::defaultDoubleValue, out::writeDouble); + writeNullableNumeric(ret, out, out::writeDouble); if (exceptionToThrow != null) { throw exceptionToThrow; diff --git a/indexing-hadoop/src/test/java/org/apache/druid/indexer/InputRowSerdeTest.java b/indexing-hadoop/src/test/java/org/apache/druid/indexer/InputRowSerdeTest.java index 4ff03c77e95d..27a7a173f3be 100644 --- a/indexing-hadoop/src/test/java/org/apache/druid/indexer/InputRowSerdeTest.java +++ b/indexing-hadoop/src/test/java/org/apache/druid/indexer/InputRowSerdeTest.java @@ -59,7 +59,6 @@ public class InputRowSerdeTest private Map event; static { - NullHandling.initializeForTests(); new AggregatorsModule(); //registers ComplexMetric serde for hyperUnique } @@ -153,11 +152,11 @@ public void testSerde() Assert.assertEquals(300.1f, out.getRaw("d4")); Assert.assertEquals(400.5d, out.getRaw("d5")); - Assert.assertEquals(NullHandling.defaultDoubleValue(), out.getMetric("agg_non_existing")); + Assert.assertNull(out.getMetric("agg_non_existing")); Assert.assertEquals(5.0f, out.getMetric("m1out").floatValue(), 0.00001); Assert.assertEquals(100L, out.getMetric("m2out")); Assert.assertEquals(1, ((HyperLogLogCollector) out.getRaw("m3out")).estimateCardinality(), 0.001); - Assert.assertEquals(NullHandling.defaultLongValue(), out.getMetric("unparseable")); + Assert.assertNull(out.getMetric("unparseable")); EasyMock.verify(mockedAggregator); EasyMock.verify(mockedNullAggregator); @@ -275,28 +274,11 @@ public void testDimensionNullOrDefaultForNumerics() byte[] result = InputRowSerde.toBytes(InputRowSerde.getTypeHelperMap(dimensionsSpec), in, new AggregatorFactory[0]).getSerializedRow(); - if (NullHandling.replaceWithDefault()) { - long expected = 0; - expected += 9; // timestamp bytes + dims length - expected += 18; // dim_non_existing writes: 1 16 1 bytes - expected += 4; // d1: writes 1 2 1 bytes - expected += 14; // d2: writes 1 2 1 1 4 1 4 bytes - expected += 11; // d3: writes 1 2 8 bytes - expected += 7; // d4: writes 1 2 4 bytes - expected += 11; // d5: writes 1 2 8 bytes - expected += 1; // writes aggregator length - - Assert.assertEquals(expected, result.length); - Assert.assertArrayEquals(new byte[] {0, 0, 0, 0, 0, 0, 0, 0}, Arrays.copyOfRange(result, 48, 56)); - Assert.assertArrayEquals(new byte[] {0, 0, 0, 0}, Arrays.copyOfRange(result, 59, 63)); - Assert.assertArrayEquals(new byte[] {0, 0, 0, 0, 0, 0, 0, 0}, Arrays.copyOfRange(result, 66, 74)); - } else { - long expected = 9 + 18 + 4 + 14 + 4 + 4 + 4 + 1; - - Assert.assertEquals(expected, result.length); - Assert.assertEquals(result[48], NullHandling.IS_NULL_BYTE); - Assert.assertEquals(result[52], NullHandling.IS_NULL_BYTE); - Assert.assertEquals(result[56], NullHandling.IS_NULL_BYTE); - } + long expected = 9 + 18 + 4 + 14 + 4 + 4 + 4 + 1; + + Assert.assertEquals(expected, result.length); + Assert.assertEquals(result[48], NullHandling.IS_NULL_BYTE); + Assert.assertEquals(result[52], NullHandling.IS_NULL_BYTE); + Assert.assertEquals(result[56], NullHandling.IS_NULL_BYTE); } } diff --git a/indexing-hadoop/src/test/java/org/apache/druid/indexer/hadoop/DatasourceIngestionSpecTest.java b/indexing-hadoop/src/test/java/org/apache/druid/indexer/hadoop/DatasourceIngestionSpecTest.java index f2f6131225d4..98da95fc77b0 100644 --- a/indexing-hadoop/src/test/java/org/apache/druid/indexer/hadoop/DatasourceIngestionSpecTest.java +++ b/indexing-hadoop/src/test/java/org/apache/druid/indexer/hadoop/DatasourceIngestionSpecTest.java @@ -22,14 +22,12 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.Intervals; import org.apache.druid.query.filter.SelectorDimFilter; import org.apache.druid.segment.TestHelper; import org.apache.druid.timeline.DataSegment; import org.joda.time.Interval; import org.junit.Assert; -import org.junit.Before; import org.junit.Test; import java.util.List; @@ -40,12 +38,6 @@ public class DatasourceIngestionSpecTest { private static final ObjectMapper MAPPER = TestHelper.makeJsonMapper(); - @Before - public void before() - { - NullHandling.initializeForTests(); - } - @Test public void testSingleIntervalSerde() throws Exception { diff --git a/indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTaskSerdeTest.java b/indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTaskSerdeTest.java index 85929291e8b8..7e328d42f781 100644 --- a/indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTaskSerdeTest.java +++ b/indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTaskSerdeTest.java @@ -20,7 +20,6 @@ package org.apache.druid.indexing.common.task.batch.parallel; import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.impl.CsvInputFormat; import org.apache.druid.data.input.impl.DimensionsSpec; import org.apache.druid.data.input.impl.LocalInputSource; @@ -53,10 +52,6 @@ public class ParallelIndexSupervisorTaskSerdeTest { - static { - NullHandling.initializeForTests(); - } - private static final ObjectMapper OBJECT_MAPPER = new TestUtils().getTestObjectMapper(); private static final List INTERVALS = Collections.singletonList(Intervals.of("2018/2019")); diff --git a/indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/RangePartitionMultiPhaseParallelIndexingTest.java b/indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/RangePartitionMultiPhaseParallelIndexingTest.java index 3de358fdb5fd..82eb3ebb1681 100644 --- a/indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/RangePartitionMultiPhaseParallelIndexingTest.java +++ b/indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/RangePartitionMultiPhaseParallelIndexingTest.java @@ -24,7 +24,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.Multimap; import com.google.common.collect.SetMultimap; -import org.apache.druid.common.config.NullValueHandlingConfig; import org.apache.druid.data.input.InputFormat; import org.apache.druid.data.input.StringTuple; import org.apache.druid.data.input.impl.CSVParseSpec; @@ -50,9 +49,7 @@ import org.joda.time.Interval; import org.junit.Assert; import org.junit.Before; -import org.junit.Rule; import org.junit.Test; -import org.junit.contrib.java.lang.system.ProvideSystemProperty; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -127,13 +124,6 @@ public static Iterable constructorFeeder() ); } - // Interpret empty values in CSV as null - @Rule - public final ProvideSystemProperty noDefaultNullValue = new ProvideSystemProperty( - NullValueHandlingConfig.NULL_HANDLING_CONFIG_STRING, - "false" - ); - private File inputDir; private SetMultimap> intervalToDims; diff --git a/indexing-service/src/test/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskTestBase.java b/indexing-service/src/test/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskTestBase.java index b815a48d71e6..b166cfd4e88f 100644 --- a/indexing-service/src/test/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskTestBase.java +++ b/indexing-service/src/test/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskTestBase.java @@ -34,7 +34,6 @@ import org.apache.druid.client.cache.CachePopulatorStats; import org.apache.druid.client.cache.MapCache; import org.apache.druid.client.coordinator.NoopCoordinatorClient; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputFormat; import org.apache.druid.data.input.impl.ByteEntity; import org.apache.druid.data.input.impl.DimensionsSpec; @@ -190,10 +189,6 @@ public abstract class SeekableStreamIndexTaskTestBase extends EasyMockSupport protected static final Logger LOG = new Logger(SeekableStreamIndexTaskTestBase.class); protected static ListeningExecutorService taskExec; - static { - NullHandling.initializeForTests(); - } - protected final List runningTasks = new ArrayList<>(); protected final LockGranularity lockGranularity; protected File directory; diff --git a/indexing-service/src/test/java/org/apache/druid/indexing/seekablestream/SeekableStreamSamplerSpecTest.java b/indexing-service/src/test/java/org/apache/druid/indexing/seekablestream/SeekableStreamSamplerSpecTest.java index 6510e2cfbdc5..7a9873ddce9c 100644 --- a/indexing-service/src/test/java/org/apache/druid/indexing/seekablestream/SeekableStreamSamplerSpecTest.java +++ b/indexing-service/src/test/java/org/apache/druid/indexing/seekablestream/SeekableStreamSamplerSpecTest.java @@ -24,7 +24,6 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import org.apache.druid.client.indexing.SamplerResponse; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputFormat; import org.apache.druid.data.input.impl.ByteEntity; import org.apache.druid.data.input.impl.DimensionsSpec; @@ -74,10 +73,6 @@ public class SeekableStreamSamplerSpecTest extends EasyMockSupport private final SeekableStreamSupervisorSpec supervisorSpec = mock(SeekableStreamSupervisorSpec.class); - static { - NullHandling.initializeForTests(); - } - private final RecordSupplier recordSupplier = mock(RecordSupplier.class); private static List> generateRecords(String stream) diff --git a/integration-tests-ex/cases/src/test/java/org/apache/druid/testsEx/leadership/ITHighAvailabilityTest.java b/integration-tests-ex/cases/src/test/java/org/apache/druid/testsEx/leadership/ITHighAvailabilityTest.java index 60d22f3f9f8f..57c1aed1b253 100644 --- a/integration-tests-ex/cases/src/test/java/org/apache/druid/testsEx/leadership/ITHighAvailabilityTest.java +++ b/integration-tests-ex/cases/src/test/java/org/apache/druid/testsEx/leadership/ITHighAvailabilityTest.java @@ -21,7 +21,6 @@ import com.google.inject.Inject; import org.apache.druid.cli.CliCustomNodeRole; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.discovery.DiscoveryDruidNode; import org.apache.druid.discovery.DruidNodeDiscovery; import org.apache.druid.discovery.DruidNodeDiscoveryProvider; @@ -178,12 +177,12 @@ private String getLeader(String service) private String fillTemplate(String template, String overlordLeader, String coordinatorLeader) { /* - {"host":"%%BROKER%%","server_type":"broker", "is_leader": %%NON_LEADER%%}, + {"host":"%%BROKER%%","server_type":"broker", "is_leader": null}, {"host":"%%COORDINATOR_ONE%%","server_type":"coordinator", "is_leader": %%COORDINATOR_ONE_LEADER%%}, {"host":"%%COORDINATOR_TWO%%","server_type":"coordinator", "is_leader": %%COORDINATOR_TWO_LEADER%%}, {"host":"%%OVERLORD_ONE%%","server_type":"overlord", "is_leader": %%OVERLORD_ONE_LEADER%%}, {"host":"%%OVERLORD_TWO%%","server_type":"overlord", "is_leader": %%OVERLORD_TWO_LEADER%%}, - {"host":"%%ROUTER%%","server_type":"router", "is_leader": %%NON_LEADER%%}, + {"host":"%%ROUTER%%","server_type":"router", "is_leader": null}, */ String working = template; working = StringUtils.replace(working, "%%OVERLORD_ONE%%", config.getOverlordInternalHost()); @@ -206,7 +205,6 @@ private String fillTemplate(String template, String overlordLeader, String coord working = StringUtils.replace(working, "%%COORDINATOR_ONE_LEADER%%", "0"); working = StringUtils.replace(working, "%%COORDINATOR_TWO_LEADER%%", "1"); } - working = StringUtils.replace(working, "%%NON_LEADER%%", String.valueOf(NullHandling.defaultLongValue())); return working; } diff --git a/integration-tests-ex/cases/src/test/resources/cluster/HighAvailability/queries/sys.json b/integration-tests-ex/cases/src/test/resources/cluster/HighAvailability/queries/sys.json index d5d60d4f2979..c506352a4221 100644 --- a/integration-tests-ex/cases/src/test/resources/cluster/HighAvailability/queries/sys.json +++ b/integration-tests-ex/cases/src/test/resources/cluster/HighAvailability/queries/sys.json @@ -5,12 +5,12 @@ "query": "SELECT host, server_type, is_leader FROM sys.servers ORDER BY host" }, "expectedResults": [ - {"host":"%%BROKER%%","server_type":"broker", "is_leader": %%NON_LEADER%%}, + {"host":"%%BROKER%%","server_type":"broker", "is_leader": null}, {"host":"%%COORDINATOR_ONE%%","server_type":"coordinator", "is_leader": %%COORDINATOR_ONE_LEADER%%}, {"host":"%%COORDINATOR_TWO%%","server_type":"coordinator", "is_leader": %%COORDINATOR_TWO_LEADER%%}, {"host":"%%OVERLORD_ONE%%","server_type":"overlord", "is_leader": %%OVERLORD_ONE_LEADER%%}, {"host":"%%OVERLORD_TWO%%","server_type":"overlord", "is_leader": %%OVERLORD_TWO_LEADER%%}, - {"host":"%%ROUTER%%","server_type":"router", "is_leader": %%NON_LEADER%%} + {"host":"%%ROUTER%%","server_type":"router", "is_leader": null} ] }, { diff --git a/integration-tests/src/test/java/org/apache/druid/tests/leadership/ITHighAvailabilityTest.java b/integration-tests/src/test/java/org/apache/druid/tests/leadership/ITHighAvailabilityTest.java index 78e071b90a74..eb7f9f54dfee 100644 --- a/integration-tests/src/test/java/org/apache/druid/tests/leadership/ITHighAvailabilityTest.java +++ b/integration-tests/src/test/java/org/apache/druid/tests/leadership/ITHighAvailabilityTest.java @@ -23,7 +23,6 @@ import com.google.common.collect.ImmutableList; import com.google.inject.Inject; import org.apache.druid.cli.CliCustomNodeRole; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.curator.discovery.ServerDiscoveryFactory; import org.apache.druid.discovery.DiscoveryDruidNode; import org.apache.druid.discovery.DruidNodeDiscovery; @@ -259,12 +258,12 @@ private String getLeader(String service) private static String fillTemplate(IntegrationTestingConfig config, String template, String overlordLeader, String coordinatorLeader) { /* - {"host":"%%BROKER%%","server_type":"broker", "is_leader": %%NON_LEADER%%}, + {"host":"%%BROKER%%","server_type":"broker", "is_leader": null}, {"host":"%%COORDINATOR_ONE%%","server_type":"coordinator", "is_leader": %%COORDINATOR_ONE_LEADER%%}, {"host":"%%COORDINATOR_TWO%%","server_type":"coordinator", "is_leader": %%COORDINATOR_TWO_LEADER%%}, {"host":"%%OVERLORD_ONE%%","server_type":"overlord", "is_leader": %%OVERLORD_ONE_LEADER%%}, {"host":"%%OVERLORD_TWO%%","server_type":"overlord", "is_leader": %%OVERLORD_TWO_LEADER%%}, - {"host":"%%ROUTER%%","server_type":"router", "is_leader": %%NON_LEADER%%} + {"host":"%%ROUTER%%","server_type":"router", "is_leader": null} */ String working = template; @@ -288,7 +287,6 @@ private static String fillTemplate(IntegrationTestingConfig config, String templ working = StringUtils.replace(working, "%%COORDINATOR_ONE_LEADER%%", "0"); working = StringUtils.replace(working, "%%COORDINATOR_TWO_LEADER%%", "1"); } - working = StringUtils.replace(working, "%%NON_LEADER%%", String.valueOf(NullHandling.defaultLongValue())); return working; } diff --git a/integration-tests/src/test/java/org/apache/druid/tests/security/AbstractAuthConfigurationTest.java b/integration-tests/src/test/java/org/apache/druid/tests/security/AbstractAuthConfigurationTest.java index b2ecc596e7c6..d957e9b08636 100644 --- a/integration-tests/src/test/java/org/apache/druid/tests/security/AbstractAuthConfigurationTest.java +++ b/integration-tests/src/test/java/org/apache/druid/tests/security/AbstractAuthConfigurationTest.java @@ -27,7 +27,6 @@ import com.google.common.collect.Lists; import com.google.inject.Inject; import org.apache.calcite.avatica.AvaticaSqlException; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.guice.annotations.Client; import org.apache.druid.guice.annotations.ExtensionPoint; import org.apache.druid.java.util.common.StringUtils; @@ -957,7 +956,6 @@ protected static String fillServersTemplate(IntegrationTestingConfig config, Str { String json = StringUtils.replace(template, "%%HISTORICAL%%", config.getHistoricalInternalHost()); json = StringUtils.replace(json, "%%BROKER%%", config.getBrokerInternalHost()); - json = StringUtils.replace(json, "%%NON_LEADER%%", String.valueOf(NullHandling.defaultLongValue())); return json; } } diff --git a/integration-tests/src/test/resources/queries/high_availability_sys.json b/integration-tests/src/test/resources/queries/high_availability_sys.json index d5d60d4f2979..c506352a4221 100644 --- a/integration-tests/src/test/resources/queries/high_availability_sys.json +++ b/integration-tests/src/test/resources/queries/high_availability_sys.json @@ -5,12 +5,12 @@ "query": "SELECT host, server_type, is_leader FROM sys.servers ORDER BY host" }, "expectedResults": [ - {"host":"%%BROKER%%","server_type":"broker", "is_leader": %%NON_LEADER%%}, + {"host":"%%BROKER%%","server_type":"broker", "is_leader": null}, {"host":"%%COORDINATOR_ONE%%","server_type":"coordinator", "is_leader": %%COORDINATOR_ONE_LEADER%%}, {"host":"%%COORDINATOR_TWO%%","server_type":"coordinator", "is_leader": %%COORDINATOR_TWO_LEADER%%}, {"host":"%%OVERLORD_ONE%%","server_type":"overlord", "is_leader": %%OVERLORD_ONE_LEADER%%}, {"host":"%%OVERLORD_TWO%%","server_type":"overlord", "is_leader": %%OVERLORD_TWO_LEADER%%}, - {"host":"%%ROUTER%%","server_type":"router", "is_leader": %%NON_LEADER%%} + {"host":"%%ROUTER%%","server_type":"router", "is_leader": null} ] }, { diff --git a/integration-tests/src/test/resources/results/auth_test_sys_schema_servers.json b/integration-tests/src/test/resources/results/auth_test_sys_schema_servers.json index 776c2ba2f5ed..8c4fb14c5206 100644 --- a/integration-tests/src/test/resources/results/auth_test_sys_schema_servers.json +++ b/integration-tests/src/test/resources/results/auth_test_sys_schema_servers.json @@ -8,7 +8,7 @@ "tier": "_default_tier", "curr_size": 2208932412, "max_size": 5000000000, - "is_leader": %%NON_LEADER%%, + "is_leader": null, "start_time": "0" }, { @@ -20,7 +20,7 @@ "tier": "_default_tier", "curr_size": 0, "max_size": 1000000000, - "is_leader": %%NON_LEADER%%, + "is_leader": null, "start_time": "0" } ] diff --git a/processing/src/main/java/org/apache/druid/common/config/NullHandling.java b/processing/src/main/java/org/apache/druid/common/config/NullHandling.java index da2871722240..e2fe0d6f303b 100644 --- a/processing/src/main/java/org/apache/druid/common/config/NullHandling.java +++ b/processing/src/main/java/org/apache/druid/common/config/NullHandling.java @@ -19,37 +19,13 @@ package org.apache.druid.common.config; -import com.google.common.annotations.VisibleForTesting; -import com.google.common.base.Strings; import com.google.inject.Inject; -import org.apache.druid.query.BitmapResultFactory; -import org.apache.druid.query.filter.DimFilter; -import org.apache.druid.query.filter.ValueMatcher; -import org.apache.druid.query.filter.vector.ReadableVectorMatch; -import org.apache.druid.query.filter.vector.VectorValueMatcher; -import org.apache.druid.segment.column.ValueType; -import org.apache.druid.segment.data.Indexed; -import org.apache.druid.segment.filter.NotFilter; -import org.apache.druid.segment.index.BitmapColumnIndex; - -import javax.annotation.Nullable; -import java.nio.ByteBuffer; /** - * Helper class for NullHandling. This class is used to switch between SQL compatible Null Handling behavior - * introduced as part of https://github.com/apache/druid/issues/4349 and the old druid behavior - * where null values are replaced with default values e.g Null Strings are replaced with empty values. + * Some dead constants */ public class NullHandling { - /** - * use these values to ensure that {@link NullHandling#defaultDoubleValue()}, - * {@link NullHandling#defaultFloatValue()} , {@link NullHandling#defaultFloatValue()} - * return the same boxed object when returning a constant zero - */ - public static final Double ZERO_DOUBLE = 0.0d; - public static final Float ZERO_FLOAT = 0.0f; - public static final Long ZERO_LONG = 0L; public static final byte IS_NULL_BYTE = (byte) 1; public static final byte IS_NOT_NULL_BYTE = (byte) 0; @@ -61,233 +37,4 @@ public class NullHandling @Inject private static NullValueHandlingConfig INSTANCE; - /** - * Many unit tests do not setup modules for this value to be injected, this method provides a manual way to initialize - * {@link #INSTANCE} - */ - @VisibleForTesting - public static void initializeForTests() - { - INSTANCE = new NullValueHandlingConfig(null, null, null); - } - - @VisibleForTesting - public static void initializeForTestsWithValues(Boolean useDefForNull, Boolean ignoreNullForString) - { - initializeForTestsWithValues(useDefForNull, null, ignoreNullForString); - } - - @VisibleForTesting - public static void initializeForTestsWithValues( - Boolean useDefForNull, - Boolean useThreeValueLogic, - Boolean ignoreNullForString - ) - { - INSTANCE = new NullValueHandlingConfig(useDefForNull, useThreeValueLogic, ignoreNullForString); - } - - /** - * whether nulls should be replaced with default value. - */ - public static boolean replaceWithDefault() - { - // this should only be null in a unit test context, in production this will be injected by the null handling module - if (INSTANCE == null) { - throw new IllegalStateException("NullHandling module not initialized, call NullHandling.initializeForTests()"); - } - return INSTANCE.isUseDefaultValuesForNull(); - } - - /** - * whether nulls should be counted during String cardinality - */ - public static boolean ignoreNullsForStringCardinality() - { - // this should only be null in a unit test context, in production this will be injected by the null handling module - if (INSTANCE == null) { - throw new IllegalStateException("NullHandling module not initialized, call NullHandling.initializeForTests()"); - } - return INSTANCE.isIgnoreNullsForStringCardinality(); - } - - public static boolean sqlCompatible() - { - return !replaceWithDefault(); - } - - /** - * Whether filtering uses 3-valued logic. Used primarily by {@link NotFilter} to invert matches in a SQL compliant - * manner. When this is set, an "includeUnknown" parameter can be activated in various classes related to filtering; - * see below for references. - * - * @see ValueMatcher#matches(boolean) includeUnknown parameter - * @see VectorValueMatcher#match(ReadableVectorMatch, boolean) includeUnknown parameter - * @see BitmapColumnIndex#computeBitmapResult(BitmapResultFactory, boolean) includeUnknown parameter - * @see DimFilter#optimize(boolean) mayIncludeUnknown parameter - */ - public static boolean useThreeValueLogic() - { - return NullHandling.sqlCompatible() && - INSTANCE.isUseThreeValueLogicForNativeFilters(); - } - - @Nullable - public static String nullToEmptyIfNeeded(@Nullable String value) - { - //CHECKSTYLE.OFF: Regexp - return replaceWithDefault() ? Strings.nullToEmpty(value) : value; - //CHECKSTYLE.ON: Regexp - } - - @Nullable - public static Long nullToEmptyIfNeeded(@Nullable Long value) - { - if (replaceWithDefault() && value == null) { - return defaultLongValue(); - } - return value; - } - - @Nullable - public static Float nullToEmptyIfNeeded(@Nullable Float value) - { - if (replaceWithDefault() && value == null) { - return defaultFloatValue(); - } - return value; - } - - @Nullable - public static Double nullToEmptyIfNeeded(@Nullable Double value) - { - if (replaceWithDefault() && value == null) { - return defaultDoubleValue(); - } - return value; - } - - @Nullable - public static String emptyToNullIfNeeded(@Nullable String value) - { - //CHECKSTYLE.OFF: Regexp - return replaceWithDefault() ? Strings.emptyToNull(value) : value; - //CHECKSTYLE.ON: Regexp - } - - @Nullable - public static String defaultStringValue() - { - return replaceWithDefault() ? "" : null; - } - - @Nullable - public static Long defaultLongValue() - { - return replaceWithDefault() ? ZERO_LONG : null; - } - - @Nullable - public static Float defaultFloatValue() - { - return replaceWithDefault() ? ZERO_FLOAT : null; - } - - @Nullable - public static Double defaultDoubleValue() - { - return replaceWithDefault() ? ZERO_DOUBLE : null; - } - - /** - * Returns the default value for an object of the provided class. Will be null in SQL-compatible null handling mode. - * May be null or some non-null default value when not in SQL-compatible null handling mode. - */ - @Nullable - @SuppressWarnings("unchecked") - public static T defaultValueForClass(final Class clazz) - { - if (clazz == Float.class) { - return (T) defaultFloatValue(); - } else if (clazz == Double.class) { - return (T) defaultDoubleValue(); - } else if (clazz == Long.class) { - return (T) defaultLongValue(); - } else if (clazz == Number.class) { - return (T) defaultDoubleValue(); - } else if (clazz == String.class) { - return (T) defaultStringValue(); - } else { - return null; - } - } - - /** - * Returns the default value for the given {@link ValueType}. - * - * May be null or non-null based on the current SQL-compatible null handling mode. - */ - @Nullable - public static Object defaultValueForType(ValueType type) - { - if (sqlCompatible()) { - return null; - } else if (type == ValueType.FLOAT) { - return defaultFloatValue(); - } else if (type == ValueType.DOUBLE) { - return defaultDoubleValue(); - } else if (type == ValueType.LONG) { - return defaultLongValue(); - } else if (type == ValueType.STRING) { - return defaultStringValue(); - } else { - return null; - } - } - - public static boolean isNullOrEquivalent(@Nullable String value) - { - return replaceWithDefault() ? Strings.isNullOrEmpty(value) : value == null; - } - - public static boolean isNullOrEquivalent(@Nullable ByteBuffer buffer) - { - return buffer == null || (replaceWithDefault() && buffer.remaining() == 0); - } - - /** - * Given a UTF-8 dictionary, returns whether the first two entries must be coalesced into a single null entry. - * This happens if we are in default-value mode and the first two entries are null and empty string. - * - * This and {@link #mustReplaceFirstValueWithNullInDictionary(Indexed)} are never both true. - * - * Provided to enable compatibility for segments written under {@link #sqlCompatible()} mode but - * read under {@link #replaceWithDefault()} mode. - */ - public static boolean mustCombineNullAndEmptyInDictionary(final Indexed dictionaryUtf8) - { - return NullHandling.replaceWithDefault() - && dictionaryUtf8.size() >= 2 - && isNullOrEquivalent(dictionaryUtf8.get(0)) - && isNullOrEquivalent(dictionaryUtf8.get(1)); - } - - /** - * Given a UTF-8 dictionary, returns whether the first entry must be replaced with null. This happens if we - * are in default-value mode and the first entry is an empty string. (Default-value mode expects it to be null.) - * - * This and {@link #mustCombineNullAndEmptyInDictionary(Indexed)} are never both true. - * - * Provided to enable compatibility for segments written under {@link #sqlCompatible()} mode but - * read under {@link #replaceWithDefault()} mode. - */ - public static boolean mustReplaceFirstValueWithNullInDictionary(final Indexed dictionaryUtf8) - { - if (NullHandling.replaceWithDefault() && dictionaryUtf8.size() >= 1) { - final ByteBuffer firstValue = dictionaryUtf8.get(0); - return firstValue != null && firstValue.remaining() == 0; - } - - return false; - } } diff --git a/processing/src/main/java/org/apache/druid/common/config/NullValueHandlingConfig.java b/processing/src/main/java/org/apache/druid/common/config/NullValueHandlingConfig.java index 2ed36260762c..4b5fd885256a 100644 --- a/processing/src/main/java/org/apache/druid/common/config/NullValueHandlingConfig.java +++ b/processing/src/main/java/org/apache/druid/common/config/NullValueHandlingConfig.java @@ -29,10 +29,6 @@ public class NullValueHandlingConfig private static final Logger LOG = new Logger(NullValueHandlingConfig.class); public static final String NULL_HANDLING_CONFIG_STRING = "druid.generic.useDefaultValueForNull"; public static final String THREE_VALUE_LOGIC_CONFIG_STRING = "druid.generic.useThreeValueLogicForNativeFilters"; - - //added to preserve backward compatibility - //and not count nulls during cardinality aggrgation over strings - public static final String NULL_HANDLING_DURING_STRING_CARDINALITY = "druid.generic.ignoreNullsForStringCardinality"; @JsonProperty("useDefaultValueForNull") @@ -83,30 +79,15 @@ public NullValueHandlingConfig( if (this.useDefaultValuesForNull) { LOG.warn( - "druid.generic.useDefaultValueForNull set to 'true', we recommend using 'false' if using SQL to query Druid for the most SQL compliant behavior, see %s for details", + "druid.generic.useDefaultValueForNull set to 'true', but has been removed and is always 'false' for the most SQL compliant behavior, see %s for details", StringUtils.format(docsBaseFormat, version, "null-values") ); } if (!this.useThreeValueLogicForNativeFilters) { LOG.warn( - "druid.generic.useThreeValueLogic set to 'false', we recommend using 'true' if using SQL to query Druid for the most SQL compliant behavior, see %s for details", + "druid.generic.useThreeValueLogicForNativeFilters set to 'false', but has been removed and is always 'true' for the most SQL compliant behavior, see %s for details", StringUtils.format(docsBaseFormat, version, "boolean-logic") ); } } - - public boolean isIgnoreNullsForStringCardinality() - { - return ignoreNullsForStringCardinality; - } - - public boolean isUseDefaultValuesForNull() - { - return useDefaultValuesForNull; - } - - public boolean isUseThreeValueLogicForNativeFilters() - { - return useThreeValueLogicForNativeFilters; - } } diff --git a/processing/src/main/java/org/apache/druid/data/input/Row.java b/processing/src/main/java/org/apache/druid/data/input/Row.java index 2716a5b7d951..127f4eeb542e 100644 --- a/processing/src/main/java/org/apache/druid/data/input/Row.java +++ b/processing/src/main/java/org/apache/druid/data/input/Row.java @@ -78,8 +78,7 @@ public interface Row extends Comparable /** * Returns the metric column value for the given column name. This method is different from {@link #getRaw} in two * aspects: - * 1. If the column is absent in the row, either numeric zero or null will be returned, depending on - * the value of druid.generic.useDefaultValueForNull. + * 1. If the column is absent in the row, null will be returned. * 2. If the column has string value, an attempt is made to parse this value as a number. */ @Nullable diff --git a/processing/src/main/java/org/apache/druid/data/input/Rows.java b/processing/src/main/java/org/apache/druid/data/input/Rows.java index 369751c34e6b..b5b43d94acd6 100644 --- a/processing/src/main/java/org/apache/druid/data/input/Rows.java +++ b/processing/src/main/java/org/apache/druid/data/input/Rows.java @@ -22,7 +22,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSortedSet; import com.google.common.primitives.Longs; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.IAE; import org.apache.druid.java.util.common.ISE; import org.apache.druid.java.util.common.StringUtils; @@ -98,9 +97,6 @@ private static List objectToStringsByteA(byte[] array) /** * Convert an object to a number. * - * If {@link NullHandling#replaceWithDefault()} is true, this method will never return null. If false, it will return - * {@link NullHandling#defaultLongValue()} instead of null. - * * @param name field name of the object being converted (may be used for exception messages) * @param inputValue the actual object being converted * @param outputType expected return type, or null if it should be automatically detected @@ -126,7 +122,7 @@ public static Number objectToNumber( final Number asNumber; if (inputValue == null) { - asNumber = (Number) NullHandling.defaultValueForType(outputType != null ? outputType : ValueType.LONG); + asNumber = null; } else if (inputValue instanceof Number) { asNumber = (Number) inputValue; } else if (inputValue instanceof String) { @@ -159,7 +155,7 @@ public static Number objectToNumber( name ); } else { - return (Number) NullHandling.defaultValueForType(outputType != null ? outputType : ValueType.LONG); + return null; } } } else { @@ -171,7 +167,7 @@ public static Number objectToNumber( name ); } else { - return (Number) NullHandling.defaultValueForType(outputType != null ? outputType : ValueType.LONG); + return null; } } diff --git a/processing/src/main/java/org/apache/druid/data/input/impl/CsvInputFormat.java b/processing/src/main/java/org/apache/druid/data/input/impl/CsvInputFormat.java index 023e209b8b93..dd097f3079eb 100644 --- a/processing/src/main/java/org/apache/druid/data/input/impl/CsvInputFormat.java +++ b/processing/src/main/java/org/apache/druid/data/input/impl/CsvInputFormat.java @@ -25,7 +25,6 @@ import com.opencsv.RFC4180Parser; import com.opencsv.RFC4180ParserBuilder; import com.opencsv.enums.CSVReaderNullFieldIndicator; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputEntity; import org.apache.druid.data.input.InputEntityReader; import org.apache.druid.data.input.InputRowSchema; @@ -88,11 +87,9 @@ public InputEntityReader createReader(InputRowSchema inputRowSchema, InputEntity public static RFC4180Parser createOpenCsvParser() { - return NullHandling.replaceWithDefault() - ? new RFC4180ParserBuilder().withSeparator(SEPARATOR).build() - : new RFC4180ParserBuilder().withFieldAsNull(CSVReaderNullFieldIndicator.EMPTY_SEPARATORS) - .withSeparator(SEPARATOR) - .build(); + return new RFC4180ParserBuilder().withFieldAsNull(CSVReaderNullFieldIndicator.EMPTY_SEPARATORS) + .withSeparator(SEPARATOR) + .build(); } @Override diff --git a/processing/src/main/java/org/apache/druid/data/input/impl/DelimitedBytes.java b/processing/src/main/java/org/apache/druid/data/input/impl/DelimitedBytes.java index 0ac45ee7c136..7a7eff29dc8d 100644 --- a/processing/src/main/java/org/apache/druid/data/input/impl/DelimitedBytes.java +++ b/processing/src/main/java/org/apache/druid/data/input/impl/DelimitedBytes.java @@ -19,7 +19,6 @@ package org.apache.druid.data.input.impl; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import java.util.ArrayList; @@ -36,8 +35,7 @@ public class DelimitedBytes public static final int UNKNOWN_FIELD_COUNT = -1; /** - * Split UTF-8 bytes by a particular delimiter. When {@link NullHandling#sqlCompatible()}, empty parts are - * returned as nulls. When {@link NullHandling#replaceWithDefault()}, empty parts are returned as empty strings. + * Split UTF-8 bytes by a particular delimiter. Empty parts are returned as nulls. * * @param bytes utf-8 bytes * @param delimiter the delimiter @@ -53,7 +51,7 @@ public static List split(final byte[] bytes, final byte delimiter, final while (position < bytes.length) { if (bytes[position] == delimiter) { final String s = StringUtils.fromUtf8(bytes, start, position - start); - out.add(s.isEmpty() && NullHandling.sqlCompatible() ? null : s); + out.add(s.isEmpty() ? null : s); start = position + 1; } @@ -61,7 +59,7 @@ public static List split(final byte[] bytes, final byte delimiter, final } final String s = StringUtils.fromUtf8(bytes, start, position - start); - out.add(s.isEmpty() && NullHandling.sqlCompatible() ? null : s); + out.add(s.isEmpty() ? null : s); return out; } } diff --git a/processing/src/main/java/org/apache/druid/data/input/impl/DelimitedInputFormat.java b/processing/src/main/java/org/apache/druid/data/input/impl/DelimitedInputFormat.java index 06590584b862..93bb99bf3975 100644 --- a/processing/src/main/java/org/apache/druid/data/input/impl/DelimitedInputFormat.java +++ b/processing/src/main/java/org/apache/druid/data/input/impl/DelimitedInputFormat.java @@ -23,7 +23,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Preconditions; import com.google.common.base.Splitter; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputEntity; import org.apache.druid.data.input.InputEntityReader; import org.apache.druid.data.input.InputRowSchema; @@ -126,7 +125,7 @@ public static List splitToList(Splitter splitter, String input) while (iterator.hasNext()) { String splitValue = iterator.next(); - if (!NullHandling.replaceWithDefault() && splitValue.isEmpty()) { + if (splitValue.isEmpty()) { result.add(null); } else { result.add(splitValue); diff --git a/processing/src/main/java/org/apache/druid/frame/field/DoubleFieldReader.java b/processing/src/main/java/org/apache/druid/frame/field/DoubleFieldReader.java index 3afadebe7111..470d494959a7 100644 --- a/processing/src/main/java/org/apache/druid/frame/field/DoubleFieldReader.java +++ b/processing/src/main/java/org/apache/druid/frame/field/DoubleFieldReader.java @@ -20,7 +20,6 @@ package org.apache.druid.frame.field; import org.apache.datasketches.memory.Memory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.frame.Frame; import org.apache.druid.frame.write.RowBasedFrameWriter; import org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector; @@ -91,7 +90,7 @@ public DoubleFieldSelector(Memory dataRegion, ReadableFieldPointer fieldPointer, @Override public double getDouble() { - assert NullHandling.replaceWithDefault() || !isNull(); + assert !isNull(); final long bits = dataRegion.getLong(fieldPointer.position() + Byte.BYTES); return TransformUtils.detransformToDouble(bits); } diff --git a/processing/src/main/java/org/apache/druid/frame/field/FloatFieldReader.java b/processing/src/main/java/org/apache/druid/frame/field/FloatFieldReader.java index 3fc7213c73ed..bae2671b5cdc 100644 --- a/processing/src/main/java/org/apache/druid/frame/field/FloatFieldReader.java +++ b/processing/src/main/java/org/apache/druid/frame/field/FloatFieldReader.java @@ -20,7 +20,6 @@ package org.apache.druid.frame.field; import org.apache.datasketches.memory.Memory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.frame.Frame; import org.apache.druid.frame.write.RowBasedFrameWriter; import org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector; @@ -91,7 +90,7 @@ public FloatFieldSelector(Memory dataRegion, ReadableFieldPointer fieldPointer, @Override public float getFloat() { - assert NullHandling.replaceWithDefault() || !isNull(); + assert !isNull(); final int bits = dataRegion.getInt(fieldPointer.position() + Byte.BYTES); return TransformUtils.detransformToFloat(bits); } diff --git a/processing/src/main/java/org/apache/druid/frame/field/LongFieldReader.java b/processing/src/main/java/org/apache/druid/frame/field/LongFieldReader.java index 9b514c930873..6aa6cc8154ae 100644 --- a/processing/src/main/java/org/apache/druid/frame/field/LongFieldReader.java +++ b/processing/src/main/java/org/apache/druid/frame/field/LongFieldReader.java @@ -20,7 +20,6 @@ package org.apache.druid.frame.field; import org.apache.datasketches.memory.Memory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.frame.Frame; import org.apache.druid.frame.write.RowBasedFrameWriter; import org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector; @@ -90,7 +89,7 @@ public LongFieldSelector(Memory dataRegion, ReadableFieldPointer fieldPointer, b @Override public long getLong() { - assert NullHandling.replaceWithDefault() || !isNull(); + assert !isNull(); final long bits = dataRegion.getLong(fieldPointer.position() + Byte.BYTES); return TransformUtils.detransformToLong(bits); } diff --git a/processing/src/main/java/org/apache/druid/frame/field/NumericArrayFieldWriter.java b/processing/src/main/java/org/apache/druid/frame/field/NumericArrayFieldWriter.java index 52e83a201c5f..760374129b38 100644 --- a/processing/src/main/java/org/apache/druid/frame/field/NumericArrayFieldWriter.java +++ b/processing/src/main/java/org/apache/druid/frame/field/NumericArrayFieldWriter.java @@ -20,7 +20,6 @@ package org.apache.druid.frame.field; import org.apache.datasketches.memory.WritableMemory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector; import org.apache.druid.segment.ColumnValueSelector; @@ -143,24 +142,24 @@ public long writeTo(WritableMemory memory, long position, long maxSize) public double getDouble() { final Number n = getObject(); - assert NullHandling.replaceWithDefault() || n != null; - return n != null ? n.doubleValue() : 0d; + assert n != null; + return n.doubleValue(); } @Override public float getFloat() { final Number n = getObject(); - assert NullHandling.replaceWithDefault() || n != null; - return n != null ? n.floatValue() : 0f; + assert n != null; + return n.floatValue(); } @Override public long getLong() { final Number n = getObject(); - assert NullHandling.replaceWithDefault() || n != null; - return n != null ? n.longValue() : 0L; + assert n != null; + return n.longValue(); } @Override @@ -172,12 +171,6 @@ public void inspectRuntimeShape(RuntimeShapeInspector inspector) @Override public boolean isNull() { - // Arrays preserve the individual element's nullity when they are written and read. - // Therefore, when working with SQL incompatible mode, [7, null] won't change to [7, 0] when written to and - // read from the underlying serialization (as compared with the primitives). Therefore, - // even when NullHandling.replaceWithDefault() is true we need to write null as is, and not convert it to their - // default value when writing the array. Therefore, the check is `getObject() == null` ignoring the value of - // `NullHandling.replaceWithDefaul()`. return getObject() == null; } diff --git a/processing/src/main/java/org/apache/druid/frame/field/StringFieldReader.java b/processing/src/main/java/org/apache/druid/frame/field/StringFieldReader.java index be2263be138d..06bf291f9e97 100644 --- a/processing/src/main/java/org/apache/druid/frame/field/StringFieldReader.java +++ b/processing/src/main/java/org/apache/druid/frame/field/StringFieldReader.java @@ -22,7 +22,6 @@ import com.google.common.primitives.Ints; import it.unimi.dsi.fastutil.objects.ObjectArrays; import org.apache.datasketches.memory.Memory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; import org.apache.druid.error.NotYetImplemented; import org.apache.druid.frame.Frame; @@ -128,7 +127,7 @@ public boolean isNull(Memory memory, long position) if (firstByte == StringFieldWriter.NULL_ROW) { return true; } else if (!asArray) { - return (NullHandling.replaceWithDefault() || firstByte == StringFieldWriter.NULL_BYTE) + return firstByte == StringFieldWriter.NULL_BYTE && memory.getByte(position + 1) == StringFieldWriter.VALUE_TERMINATOR && memory.getByte(position + 2) == StringFieldWriter.ROW_TERMINATOR; } else { @@ -585,13 +584,8 @@ private static boolean addStringsToList(Memory memory, long fieldPosition, List< if (b == StringFieldWriter.VALUE_TERMINATOR) { final int len = Ints.checkedCast(i - position); - if (len == 0 && NullHandling.replaceWithDefault()) { - // Empty strings and nulls are the same in this mode. - list.add(null); - } else { - final ByteBuffer buf = FrameReaderUtils.readByteBuffer(memory, position, len); - list.add(buf); - } + final ByteBuffer buf = FrameReaderUtils.readByteBuffer(memory, position, len); + list.add(buf); position += len; diff --git a/processing/src/main/java/org/apache/druid/frame/key/FrameComparisonWidget.java b/processing/src/main/java/org/apache/druid/frame/key/FrameComparisonWidget.java index 913d775b80b0..5fd4a49cae2d 100644 --- a/processing/src/main/java/org/apache/druid/frame/key/FrameComparisonWidget.java +++ b/processing/src/main/java/org/apache/druid/frame/key/FrameComparisonWidget.java @@ -19,7 +19,6 @@ package org.apache.druid.frame.key; -import org.apache.datasketches.memory.Memory; import org.apache.druid.frame.Frame; /** @@ -38,11 +37,6 @@ public interface FrameComparisonWidget /** * Whether particular key parts in a particular row are non-null. * - * When {@link org.apache.druid.common.config.NullHandling#replaceWithDefault()}, default values (like empty strings - * and numeric zeroes) are considered null for purposes of this method. This behavior is inherited from - * {@link org.apache.druid.frame.field.FieldReader#isNull(Memory, long)} and enables join code to behave - * similarly in MSQ and native queries. - * * @param row row number * @param keyParts parts to check */ diff --git a/processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java b/processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java index e2c3051a3736..325e39b6557c 100644 --- a/processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java +++ b/processing/src/main/java/org/apache/druid/frame/read/columnar/DoubleFrameColumnReader.java @@ -20,7 +20,6 @@ package org.apache.druid.frame.read.columnar; import org.apache.datasketches.memory.Memory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.frame.Frame; import org.apache.druid.frame.write.columnar.DoubleFrameMaker; import org.apache.druid.frame.write.columnar.FrameColumnWriters; @@ -67,7 +66,7 @@ public ColumnPlus readColumn(final Frame frame) return new ColumnPlus( frameCol, ColumnCapabilitiesImpl.createSimpleNumericColumnCapabilities(frameCol.getType()) - .setHasNulls(NullHandling.sqlCompatible() && frameCol.hasNulls), + .setHasNulls(frameCol.hasNulls), frame.numRows() ); } @@ -139,7 +138,7 @@ public ColumnValueSelector makeColumnValueSelector(final ReadableOffset offse @Override public double getDouble() { - assert NullHandling.replaceWithDefault() || !isNull(); + assert !isNull(); return DoubleFrameColumn.this.getDoublePhysical(frame.physicalRow(offset.getOffset())); } diff --git a/processing/src/main/java/org/apache/druid/frame/read/columnar/FloatFrameColumnReader.java b/processing/src/main/java/org/apache/druid/frame/read/columnar/FloatFrameColumnReader.java index 31c0f85f9566..73b7d57038d3 100644 --- a/processing/src/main/java/org/apache/druid/frame/read/columnar/FloatFrameColumnReader.java +++ b/processing/src/main/java/org/apache/druid/frame/read/columnar/FloatFrameColumnReader.java @@ -20,7 +20,6 @@ package org.apache.druid.frame.read.columnar; import org.apache.datasketches.memory.Memory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.frame.Frame; import org.apache.druid.frame.write.columnar.FloatFrameMaker; import org.apache.druid.frame.write.columnar.FrameColumnWriters; @@ -67,7 +66,7 @@ public ColumnPlus readColumn(final Frame frame) return new ColumnPlus( frameCol, ColumnCapabilitiesImpl.createSimpleNumericColumnCapabilities(frameCol.getType()) - .setHasNulls(NullHandling.sqlCompatible() && frameCol.hasNulls), + .setHasNulls(frameCol.hasNulls), frame.numRows() ); } @@ -139,7 +138,7 @@ public ColumnValueSelector makeColumnValueSelector(final ReadableOffset offse @Override public float getFloat() { - assert NullHandling.replaceWithDefault() || !isNull(); + assert !isNull(); return FloatFrameColumn.this.getFloatInternal(frame.physicalRow(offset.getOffset())); } diff --git a/processing/src/main/java/org/apache/druid/frame/read/columnar/LongFrameColumnReader.java b/processing/src/main/java/org/apache/druid/frame/read/columnar/LongFrameColumnReader.java index 8bfc69047f46..441d4f93c184 100644 --- a/processing/src/main/java/org/apache/druid/frame/read/columnar/LongFrameColumnReader.java +++ b/processing/src/main/java/org/apache/druid/frame/read/columnar/LongFrameColumnReader.java @@ -20,7 +20,6 @@ package org.apache.druid.frame.read.columnar; import org.apache.datasketches.memory.Memory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.frame.Frame; import org.apache.druid.frame.write.columnar.FrameColumnWriters; import org.apache.druid.frame.write.columnar.LongFrameMaker; @@ -68,7 +67,7 @@ public ColumnPlus readColumn(final Frame frame) return new ColumnPlus( frameCol, ColumnCapabilitiesImpl.createSimpleNumericColumnCapabilities(frameCol.getType()) - .setHasNulls(NullHandling.sqlCompatible() && frameCol.hasNulls), + .setHasNulls(frameCol.hasNulls), frame.numRows() ); } @@ -138,7 +137,7 @@ public ColumnValueSelector makeColumnValueSelector(final ReadableOffset offse @Override public long getLong() { - assert NullHandling.replaceWithDefault() || !isNull(); + assert !isNull(); return LongFrameColumn.this.getLongPhysical(frame.physicalRow(offset.getOffset())); } diff --git a/processing/src/main/java/org/apache/druid/frame/read/columnar/StringArrayFrameColumnReader.java b/processing/src/main/java/org/apache/druid/frame/read/columnar/StringArrayFrameColumnReader.java index 34d6ae2cd65b..94945cdfd6c7 100644 --- a/processing/src/main/java/org/apache/druid/frame/read/columnar/StringArrayFrameColumnReader.java +++ b/processing/src/main/java/org/apache/druid/frame/read/columnar/StringArrayFrameColumnReader.java @@ -22,7 +22,6 @@ import com.google.common.primitives.Ints; import it.unimi.dsi.fastutil.objects.ObjectArrays; import org.apache.datasketches.memory.Memory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; import org.apache.druid.frame.Frame; import org.apache.druid.frame.read.FrameReaderUtils; @@ -320,8 +319,7 @@ private ByteBuffer getStringUtf8(final int index) final int dataLength = Ints.checkedCast(dataEnd - dataStart); - if ((dataLength == 0 && NullHandling.replaceWithDefault()) || - (dataLength == 1 && memory.getByte(dataStart) == FrameWriterUtils.NULL_STRING_MARKER)) { + if (dataLength == 1 && memory.getByte(dataStart) == FrameWriterUtils.NULL_STRING_MARKER) { return null; } diff --git a/processing/src/main/java/org/apache/druid/frame/read/columnar/StringFrameColumnReader.java b/processing/src/main/java/org/apache/druid/frame/read/columnar/StringFrameColumnReader.java index 02ee545ba814..d1216b5c2714 100644 --- a/processing/src/main/java/org/apache/druid/frame/read/columnar/StringFrameColumnReader.java +++ b/processing/src/main/java/org/apache/druid/frame/read/columnar/StringFrameColumnReader.java @@ -22,7 +22,6 @@ import com.google.common.primitives.Ints; import org.apache.commons.lang3.ObjectUtils; import org.apache.datasketches.memory.Memory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; import org.apache.druid.error.InvalidInput; import org.apache.druid.frame.Frame; @@ -537,8 +536,7 @@ private ByteBuffer getStringUtf8(final int index) final int dataLength = Ints.checkedCast(dataEnd - dataStart); - if ((dataLength == 0 && NullHandling.replaceWithDefault()) || - (dataLength == 1 && memory.getByte(dataStart) == FrameWriterUtils.NULL_STRING_MARKER)) { + if (dataLength == 1 && memory.getByte(dataStart) == FrameWriterUtils.NULL_STRING_MARKER) { return null; } diff --git a/processing/src/main/java/org/apache/druid/frame/write/FrameWriterUtils.java b/processing/src/main/java/org/apache/druid/frame/write/FrameWriterUtils.java index a480767f1113..54eabdf84edd 100644 --- a/processing/src/main/java/org/apache/druid/frame/write/FrameWriterUtils.java +++ b/processing/src/main/java/org/apache/druid/frame/write/FrameWriterUtils.java @@ -20,7 +20,6 @@ package org.apache.druid.frame.write; import org.apache.datasketches.memory.WritableMemory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.frame.FrameType; import org.apache.druid.frame.key.KeyColumn; import org.apache.druid.java.util.common.IAE; @@ -312,7 +311,7 @@ private static ByteBuffer getUtf8ByteBufferFromStringSelector( if (selector.supportsLookupNameUtf8()) { final ByteBuffer buf = selector.lookupNameUtf8(dictionaryId); - if (buf == null || (NullHandling.replaceWithDefault() && buf.remaining() == 0)) { + if (buf == null) { return ByteBuffer.wrap(NULL_STRING_MARKER_ARRAY); } else { return buf; @@ -327,7 +326,7 @@ private static ByteBuffer getUtf8ByteBufferFromStringSelector( */ private static ByteBuffer getUtf8ByteBufferFromString(@Nullable final String data) { - if (NullHandling.isNullOrEquivalent(data)) { + if (data == null) { return ByteBuffer.wrap(NULL_STRING_MARKER_ARRAY); } else { return ByteBuffer.wrap(StringUtils.toUtf8(data)); diff --git a/processing/src/main/java/org/apache/druid/frame/write/cast/ObjectToNumberColumnValueSelector.java b/processing/src/main/java/org/apache/druid/frame/write/cast/ObjectToNumberColumnValueSelector.java index ae09cfd0f20c..43987b99203f 100644 --- a/processing/src/main/java/org/apache/druid/frame/write/cast/ObjectToNumberColumnValueSelector.java +++ b/processing/src/main/java/org/apache/druid/frame/write/cast/ObjectToNumberColumnValueSelector.java @@ -19,7 +19,6 @@ package org.apache.druid.frame.write.cast; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; import org.apache.druid.math.expr.ExpressionType; import org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector; @@ -67,21 +66,21 @@ public class ObjectToNumberColumnValueSelector implements ColumnValueSelector getTransformationFunction( { return (input) -> { if (input == null) { - return NullHandling.emptyToNullIfNeeded(input); + return input; } if (input.contains(listDelimiter)) { return StreamSupport.stream(listSplitter.split(input).spliterator(), false) - .map(NullHandling::emptyToNullIfNeeded) .map(value -> tryParseNumbers ? ParserUtils.tryParseStringAsNumber(value) : value) .collect(Collectors.toList()); } else { return tryParseNumbers ? tryParseStringAsNumber(input) : - NullHandling.emptyToNullIfNeeded(input); + input; } }; @@ -96,7 +94,7 @@ public static Function getTransformationFunction( private static Object tryParseStringAsNumber(@Nullable final String input) { if (!NumberUtils.isCreatable(input)) { - return NullHandling.emptyToNullIfNeeded(input); + return input; } final Long l = Longs.tryParse(input); diff --git a/processing/src/main/java/org/apache/druid/math/expr/ApplyFunction.java b/processing/src/main/java/org/apache/druid/math/expr/ApplyFunction.java index 475432c19f68..8302e1c901b5 100644 --- a/processing/src/main/java/org/apache/druid/math/expr/ApplyFunction.java +++ b/processing/src/main/java/org/apache/druid/math/expr/ApplyFunction.java @@ -23,7 +23,6 @@ import it.unimi.dsi.fastutil.objects.Object2IntArrayMap; import it.unimi.dsi.fastutil.objects.Object2IntMap; import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.UOE; import org.apache.druid.math.expr.vector.ExprVectorProcessor; @@ -151,7 +150,7 @@ ExprEval applyMap(@Nullable ExpressionType arrayType, LambdaExpr expr, Indexable } } if (arrayElementType == null) { - arrayElementType = NullHandling.sqlCompatible() ? ExpressionType.LONG : ExpressionType.STRING; + arrayElementType = ExpressionType.LONG; } if (computeArrayType) { arrayType = ExpressionTypeFactory.getInstance().ofArray(arrayElementType); diff --git a/processing/src/main/java/org/apache/druid/math/expr/BinaryEvalOpExprBase.java b/processing/src/main/java/org/apache/druid/math/expr/BinaryEvalOpExprBase.java index 6b7bb21a1f7e..ebd90a88bfda 100644 --- a/processing/src/main/java/org/apache/druid/math/expr/BinaryEvalOpExprBase.java +++ b/processing/src/main/java/org/apache/druid/math/expr/BinaryEvalOpExprBase.java @@ -20,7 +20,6 @@ package org.apache.druid.math.expr; import com.google.common.collect.ImmutableSet; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.IAE; import org.apache.druid.java.util.common.StringUtils; @@ -130,7 +129,7 @@ public ExprEval eval(ObjectBinding bindings) // Result of any Binary expressions is null if any of the argument is null. // e.g "select null * 2 as c;" or "select null + 1 as c;" will return null as per Standard SQL spec. - if (NullHandling.sqlCompatible() && (leftVal.value() == null || rightVal.value() == null)) { + if (leftVal.value() == null || rightVal.value() == null) { return ExprEval.of(null); } @@ -142,7 +141,7 @@ public ExprEval eval(ObjectBinding bindings) return ExprEval.of(evalLong(leftVal.asLong(), rightVal.asLong())); case DOUBLE: default: - if (NullHandling.sqlCompatible() && (leftVal.isNumericNull() || rightVal.isNumericNull())) { + if (leftVal.isNumericNull() || rightVal.isNumericNull()) { return ExprEval.of(null); } return ExprEval.of(evalDouble(leftVal.asDouble(), rightVal.asDouble())); @@ -181,7 +180,7 @@ public ExprEval eval(ObjectBinding bindings) // Result of any Binary expressions is null if any of the argument is null. // e.g "select null * 2 as c;" or "select null + 1 as c;" will return null as per Standard SQL spec. - if (NullHandling.sqlCompatible() && (leftVal.value() == null || rightVal.value() == null)) { + if (leftVal.value() == null || rightVal.value() == null) { return ExprEval.of(null); } @@ -199,7 +198,7 @@ public ExprEval eval(ObjectBinding bindings) break; case DOUBLE: default: - if (NullHandling.sqlCompatible() && (leftVal.isNumericNull() || rightVal.isNumericNull())) { + if (leftVal.isNumericNull() || rightVal.isNumericNull()) { return ExprEval.of(null); } result = evalDouble(leftVal.asDouble(), rightVal.asDouble()); diff --git a/processing/src/main/java/org/apache/druid/math/expr/BinaryLogicalOperatorExpr.java b/processing/src/main/java/org/apache/druid/math/expr/BinaryLogicalOperatorExpr.java index 880271ff1de1..6f6cb2e835ad 100644 --- a/processing/src/main/java/org/apache/druid/math/expr/BinaryLogicalOperatorExpr.java +++ b/processing/src/main/java/org/apache/druid/math/expr/BinaryLogicalOperatorExpr.java @@ -19,12 +19,10 @@ package org.apache.druid.math.expr; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.guava.Comparators; import org.apache.druid.math.expr.vector.ExprVectorProcessor; import org.apache.druid.math.expr.vector.VectorComparisonProcessors; import org.apache.druid.math.expr.vector.VectorProcessors; -import org.apache.druid.segment.column.Types; import javax.annotation.Nullable; import java.util.Objects; @@ -346,26 +344,20 @@ public ExprEval eval(ObjectBinding bindings) return ExprEval.ofLongBoolean(false); } ExprEval rightVal; - // null values can (but not always) appear as string typed - // so type isn't necessarily string unless value is non-null - if (NullHandling.sqlCompatible() || (Types.is(leftVal.type(), ExprType.STRING))) { - // true/null, null/true, null/null -> null - // false/null, null/false -> false - if (leftVal.value() == null) { - rightVal = right.eval(bindings); - if (rightVal.value() == null || rightVal.asBoolean()) { - return ExprEval.ofLong(null); - } - return ExprEval.ofLongBoolean(false); - } else { - // left value must be true - rightVal = right.eval(bindings); - if (rightVal.value() == null) { - return ExprEval.ofLong(null); - } + // true/null, null/true, null/null -> null + // false/null, null/false -> false + if (leftVal.value() == null) { + rightVal = right.eval(bindings); + if (rightVal.value() == null || rightVal.asBoolean()) { + return ExprEval.ofLong(null); } + return ExprEval.ofLongBoolean(false); } else { + // left value must be true rightVal = right.eval(bindings); + if (rightVal.value() == null) { + return ExprEval.ofLong(null); + } } return ExprEval.ofLongBoolean(leftVal.asBoolean() && rightVal.asBoolean()); } @@ -414,26 +406,20 @@ public ExprEval eval(ObjectBinding bindings) } final ExprEval rightVal; - // null values can (but not always) appear as string typed - // so type isn't necessarily string unless value is non-null - if (NullHandling.sqlCompatible() || (Types.is(leftVal.type(), ExprType.STRING))) { - // true/null, null/true -> true - // false/null, null/false, null/null -> null - if (leftVal.value() == null) { - rightVal = right.eval(bindings); - if (rightVal.value() == null || !rightVal.asBoolean()) { - return ExprEval.ofLong(null); - } - return ExprEval.ofLongBoolean(true); - } else { - // leftval is false - rightVal = right.eval(bindings); - if (rightVal.value() == null) { - return ExprEval.ofLong(null); - } + // true/null, null/true -> true + // false/null, null/false, null/null -> null + if (leftVal.value() == null) { + rightVal = right.eval(bindings); + if (rightVal.value() == null || !rightVal.asBoolean()) { + return ExprEval.ofLong(null); } + return ExprEval.ofLongBoolean(true); } else { + // leftval is false rightVal = right.eval(bindings); + if (rightVal.value() == null) { + return ExprEval.ofLong(null); + } } return ExprEval.ofLongBoolean(leftVal.asBoolean() || rightVal.asBoolean()); } diff --git a/processing/src/main/java/org/apache/druid/math/expr/BinaryMathOperatorExpr.java b/processing/src/main/java/org/apache/druid/math/expr/BinaryMathOperatorExpr.java index a11b48af541b..518deffd95ec 100644 --- a/processing/src/main/java/org/apache/druid/math/expr/BinaryMathOperatorExpr.java +++ b/processing/src/main/java/org/apache/druid/math/expr/BinaryMathOperatorExpr.java @@ -21,7 +21,6 @@ import com.google.common.math.LongMath; import com.google.common.primitives.Ints; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.math.expr.vector.ExprVectorProcessor; import org.apache.druid.math.expr.vector.VectorMathProcessors; import org.apache.druid.math.expr.vector.VectorStringProcessors; @@ -54,7 +53,7 @@ protected BinaryOpExprBase copy(Expr left, Expr right) @Override protected ExprEval evalString(@Nullable String left, @Nullable String right) { - return ExprEval.of(NullHandling.nullToEmptyIfNeeded(left) + NullHandling.nullToEmptyIfNeeded(right)); + return ExprEval.of(left + right); } @Override diff --git a/processing/src/main/java/org/apache/druid/math/expr/ConstantExpr.java b/processing/src/main/java/org/apache/druid/math/expr/ConstantExpr.java index e2f823eae28e..6d44542171a0 100644 --- a/processing/src/main/java/org/apache/druid/math/expr/ConstantExpr.java +++ b/processing/src/main/java/org/apache/druid/math/expr/ConstantExpr.java @@ -22,7 +22,6 @@ import com.google.common.base.Preconditions; import com.google.errorprone.annotations.Immutable; import org.apache.commons.text.StringEscapeUtils; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.IAE; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.math.expr.vector.ExprVectorProcessor; @@ -31,7 +30,6 @@ import javax.annotation.Nullable; import javax.annotation.concurrent.NotThreadSafe; - import java.math.BigInteger; import java.nio.ByteBuffer; import java.util.Arrays; @@ -402,7 +400,7 @@ class StringExpr extends ConstantExpr { StringExpr(@Nullable String value) { - super(ExpressionType.STRING, NullHandling.emptyToNullIfNeeded(value)); + super(ExpressionType.STRING, value); } @Override diff --git a/processing/src/main/java/org/apache/druid/math/expr/Evals.java b/processing/src/main/java/org/apache/druid/math/expr/Evals.java index 0010679a8144..c4f5370b3919 100644 --- a/processing/src/main/java/org/apache/druid/math/expr/Evals.java +++ b/processing/src/main/java/org/apache/druid/math/expr/Evals.java @@ -19,8 +19,6 @@ package org.apache.druid.math.expr; -import org.apache.druid.common.config.NullHandling; - import javax.annotation.Nullable; import java.util.Arrays; import java.util.List; @@ -66,7 +64,7 @@ public static boolean asBoolean(double x) public static boolean asBoolean(@Nullable String x) { - return !NullHandling.isNullOrEquivalent(x) && Boolean.parseBoolean(x); + return Boolean.parseBoolean(x); } /** diff --git a/processing/src/main/java/org/apache/druid/math/expr/ExprEval.java b/processing/src/main/java/org/apache/druid/math/expr/ExprEval.java index f0d411a8e37d..d390d616ba20 100644 --- a/processing/src/main/java/org/apache/druid/math/expr/ExprEval.java +++ b/processing/src/main/java/org/apache/druid/math/expr/ExprEval.java @@ -21,7 +21,6 @@ import com.google.common.base.Preconditions; import com.google.common.primitives.Doubles; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.guava.GuavaUtils; import org.apache.druid.java.util.common.IAE; import org.apache.druid.java.util.common.ISE; @@ -733,10 +732,6 @@ public String asString() * * If a type cannot sanely convert into a primitive numeric value, then this method should always return true so that * these primitive numeric getters are not called, since returning false is assumed to mean these values are valid. - * - * Note that all types must still return values for {@link #asInt()}, {@link #asLong()}}, and {@link #asDouble()}, - * since this can still happen if {@link NullHandling#sqlCompatible()} is false, but it should be assumed that this - * can only happen in that mode and 0s are typical and expected for values that would otherwise be null. */ public abstract boolean isNumericNull(); @@ -747,22 +742,19 @@ public boolean isArray() /** * Get the primitive integer value. Callers should check {@link #isNumericNull()} prior to calling this method, - * otherwise it may improperly return placeholder a value (typically zero, which is expected if - * {@link NullHandling#sqlCompatible()} is false) + * otherwise it may improperly return placeholder a value (typically zero) */ public abstract int asInt(); /** * Get the primitive long value. Callers should check {@link #isNumericNull()} prior to calling this method, - * otherwise it may improperly return a placeholder value (typically zero, which is expected if - * {@link NullHandling#sqlCompatible()} is false) + * otherwise it may improperly return a placeholder value (typically zero) */ public abstract long asLong(); /** * Get the primitive double value. Callers should check {@link #isNumericNull()} prior to calling this method, - * otherwise it may improperly return a placeholder value (typically zero, which is expected if - * {@link NullHandling#sqlCompatible()} is false) + * otherwise it may improperly return a placeholder value (typically zero) */ public abstract double asDouble(); @@ -812,7 +804,7 @@ public final double asDouble() @Override public boolean isNumericNull() { - return NullHandling.sqlCompatible() && value == null; + return value == null; } } @@ -835,7 +827,7 @@ public final ExpressionType type() public Number valueOrDefault() { if (value == null) { - return NullHandling.defaultDoubleValue(); + return null; } return value.doubleValue(); } @@ -918,7 +910,7 @@ public final ExpressionType type() public Number valueOrDefault() { if (value == null) { - return NullHandling.defaultLongValue(); + return null; } return value.longValue(); } @@ -1002,7 +994,7 @@ private static class StringExprEval extends ExprEval private StringExprEval(@Nullable String value) { - super(NullHandling.emptyToNullIfNeeded(value)); + super(value); } @Override diff --git a/processing/src/main/java/org/apache/druid/math/expr/ExpressionPredicateIndexSupplier.java b/processing/src/main/java/org/apache/druid/math/expr/ExpressionPredicateIndexSupplier.java index 48d4deaa1b2d..21ffd28fcecc 100644 --- a/processing/src/main/java/org/apache/druid/math/expr/ExpressionPredicateIndexSupplier.java +++ b/processing/src/main/java/org/apache/druid/math/expr/ExpressionPredicateIndexSupplier.java @@ -20,7 +20,6 @@ package org.apache.druid.math.expr; import org.apache.druid.collections.bitmap.ImmutableBitmap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.filter.DruidDoublePredicate; import org.apache.druid.query.filter.DruidFloatPredicate; import org.apache.druid.query.filter.DruidLongPredicate; @@ -78,30 +77,8 @@ public BitmapColumnIndex forPredicate(DruidPredicateFactory matcherFactory) { final java.util.function.Function> evalFunction; - if (NullHandling.sqlCompatible()) { - evalFunction = - inputValue -> expr.eval(InputBindings.forInputSupplier(inputColumn, inputType, () -> inputValue)); - } else { - switch (inputType.getType()) { - case LONG: - evalFunction = - inputValue -> expr.eval( - InputBindings.forInputSupplier(inputColumn, inputType, () -> inputValue == null ? 0L : inputValue) - ); - break; - - case DOUBLE: - evalFunction = - inputValue -> expr.eval( - InputBindings.forInputSupplier(inputColumn, inputType, () -> inputValue == null ? 0.0 : inputValue) - ); - break; - - default: - evalFunction = - inputValue -> expr.eval(InputBindings.forInputSupplier(inputColumn, inputType, () -> inputValue)); - } - } + evalFunction = + inputValue -> expr.eval(InputBindings.forInputSupplier(inputColumn, inputType, () -> inputValue)); return new DictionaryScanningBitmapIndex(inputColumnIndexes.getCardinality()) { diff --git a/processing/src/main/java/org/apache/druid/math/expr/Function.java b/processing/src/main/java/org/apache/druid/math/expr/Function.java index a4171cc8b35c..95ab5f0a8f63 100644 --- a/processing/src/main/java/org/apache/druid/math/expr/Function.java +++ b/processing/src/main/java/org/apache/druid/math/expr/Function.java @@ -22,7 +22,6 @@ import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableSet; import it.unimi.dsi.fastutil.objects.ObjectAVLTreeSet; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.HumanReadableBytes; @@ -205,7 +204,7 @@ abstract class UnivariateMathFunction extends UnivariateFunction @Override protected final ExprEval eval(ExprEval param) { - if (NullHandling.sqlCompatible() && param.isNumericNull()) { + if (param.isNumericNull()) { return ExprEval.of(null); } if (param.type().is(ExprType.LONG)) { @@ -242,13 +241,7 @@ public ExpressionType getOutputType(Expr.InputBindingInspector inspector, List args) { - // can not vectorize in default mode for 'missing' columns - // it creates inconsistencies as we default the output type to STRING, making the value null - // but the numeric columns expect a non null value final ExpressionType outputType = args.get(0).getOutputType(inspector); - if (outputType == null && NullHandling.replaceWithDefault()) { - return false; - } return (outputType == null || outputType.isNumeric()) && inspector.canVectorize(args); } } @@ -276,7 +269,7 @@ abstract class BivariateMathFunction extends BivariateFunction protected final ExprEval eval(ExprEval x, ExprEval y) { // match the logic of BinaryEvalOpExprBase.eval, except there is no string handling so both strings is also null - if (NullHandling.sqlCompatible() && (x.value() == null || y.value() == null)) { + if (x.value() == null || y.value() == null) { return ExprEval.of(null); } @@ -339,7 +332,7 @@ protected final ExprEval eval(ExprEval x, ExprEval y) { // this is a copy of the logic of BivariateMathFunction for string handling, which itself is a // remix of BinaryEvalOpExprBase.eval modified so that string inputs are always null outputs - if (NullHandling.sqlCompatible() && (x.value() == null || y.value() == null)) { + if (x.value() == null || y.value() == null) { return ExprEval.of(null); } @@ -693,7 +686,7 @@ public ExprEval apply(List args, Expr.ObjectBinding bindings) { final int radix = args.size() == 1 ? 10 : args.get(1).eval(bindings).asInt(); - final String input = NullHandling.nullToEmptyIfNeeded(args.get(0).eval(bindings).asString()); + final String input = args.get(0).eval(bindings).asString(); if (input == null) { return ExprEval.ofLong(null); } @@ -1458,7 +1451,7 @@ public ExprEval apply(List args, Expr.ObjectBinding bindings) { ExprEval value1 = args.get(0).eval(bindings); - if (NullHandling.sqlCompatible() && value1.isNumericNull()) { + if (value1.isNumericNull()) { return ExprEval.of(null); } @@ -1916,7 +1909,7 @@ public ExpressionType getOutputType(Expr.InputBindingInspector inspector, List args, Expr.ObjectBinding bindings) return ExprEval.of(null); } else { // Pass first argument in to the constructor to provide StringBuilder a little extra sizing hint. - String first = NullHandling.nullToEmptyIfNeeded(args.get(0).eval(bindings).asString()); + String first = args.get(0).eval(bindings).asString(); if (first == null) { // Result of concatenation is null if any of the Values is null. // e.g. 'select CONCAT(null, "abc") as c;' will return null as per Standard SQL spec. @@ -2585,7 +2578,7 @@ public ExprEval apply(List args, Expr.ObjectBinding bindings) } final StringBuilder builder = new StringBuilder(first); for (int i = 1; i < args.size(); i++) { - final String s = NullHandling.nullToEmptyIfNeeded(args.get(i).eval(bindings).asString()); + final String s = args.get(i).eval(bindings).asString(); if (s == null) { // Result of concatenation is null if any of the Values is null. // e.g. 'select CONCAT(null, "abc") as c;' will return null as per Standard SQL spec. @@ -2667,7 +2660,7 @@ public String name() @Override public ExprEval apply(List args, Expr.ObjectBinding bindings) { - final String formatString = NullHandling.nullToEmptyIfNeeded(args.get(0).eval(bindings).asString()); + final String formatString = args.get(0).eval(bindings).asString(); if (formatString == null) { return ExprEval.of(null); @@ -2706,8 +2699,8 @@ public String name() @Override public ExprEval apply(List args, Expr.ObjectBinding bindings) { - final String haystack = NullHandling.nullToEmptyIfNeeded(args.get(0).eval(bindings).asString()); - final String needle = NullHandling.nullToEmptyIfNeeded(args.get(1).eval(bindings).asString()); + final String haystack = args.get(0).eval(bindings).asString(); + final String needle = args.get(1).eval(bindings).asString(); if (haystack == null || needle == null) { return ExprEval.of(null); @@ -2766,9 +2759,9 @@ public ExprEval apply(List args, Expr.ObjectBinding bindings) return ExprEval.of(arg.substring(index)); } } else { - // If starting index of substring is greater then the length of string, the result will be a zero length string. - // e.g. 'select substring("abc", 4,5) as c;' will return an empty string - return ExprEval.of(NullHandling.defaultStringValue()); + // this is a behavior mismatch with SQL SUBSTRING to be consistent with SubstringDimExtractionFn + // In SQL, something like 'select substring("abc", 4,5) as c;' will return an empty string + return ExprEval.of(null); } } @@ -2851,10 +2844,10 @@ public String name() public ExprEval apply(List args, Expr.ObjectBinding bindings) { final String arg = args.get(0).eval(bindings).asString(); - final String pattern = NullHandling.nullToEmptyIfNeeded(args.get(1).eval(bindings).asString()); - final String replacement = NullHandling.nullToEmptyIfNeeded(args.get(2).eval(bindings).asString()); + final String pattern = args.get(1).eval(bindings).asString(); + final String replacement = args.get(2).eval(bindings).asString(); if (arg == null) { - return ExprEval.of(NullHandling.defaultStringValue()); + return ExprEval.of(null); } return ExprEval.of(StringUtils.replace(arg, pattern, replacement)); } @@ -2886,7 +2879,7 @@ public ExprEval apply(List args, Expr.ObjectBinding bindings) { final String arg = args.get(0).eval(bindings).asString(); if (arg == null) { - return ExprEval.of(NullHandling.defaultStringValue()); + return ExprEval.of(null); } return ExprEval.of(StringUtils.toLowerCase(arg)); } @@ -2918,7 +2911,7 @@ public ExprEval apply(List args, Expr.ObjectBinding bindings) { final String arg = args.get(0).eval(bindings).asString(); if (arg == null) { - return ExprEval.of(NullHandling.defaultStringValue()); + return ExprEval.of(null); } return ExprEval.of(StringUtils.toUpperCase(arg)); } @@ -2959,7 +2952,7 @@ protected ExprEval eval(ExprEval param) throw validationFailed("needs a STRING argument but got %s instead", param.type()); } final String arg = param.asString(); - return ExprEval.of(arg == null ? NullHandling.defaultStringValue() : new StringBuilder(arg).reverse().toString()); + return ExprEval.of(arg == null ? null : new StringBuilder(arg).reverse().toString()); } } @@ -2985,7 +2978,7 @@ protected ExprEval eval(String x, long y) if (yInt != y) { throw validationFailed("needs an integer as the second argument"); } - return ExprEval.of(y < 1 ? NullHandling.defaultStringValue() : StringUtils.repeat(x, yInt)); + return ExprEval.of(y < 1 ? null : StringUtils.repeat(x, yInt)); } } @@ -3007,7 +3000,7 @@ public ExprEval apply(List args, Expr.ObjectBinding bindings) if (base == null || pad == null) { return ExprEval.of(null); } else { - return ExprEval.of(len == 0 ? NullHandling.defaultStringValue() : StringUtils.lpad(base, len, pad)); + return ExprEval.of(len == 0 ? null : StringUtils.lpad(base, len, pad)); } } @@ -3044,7 +3037,7 @@ public ExprEval apply(List args, Expr.ObjectBinding bindings) if (base == null || pad == null) { return ExprEval.of(null); } else { - return ExprEval.of(len == 0 ? NullHandling.defaultStringValue() : StringUtils.rpad(base, len, pad)); + return ExprEval.of(len == 0 ? null : StringUtils.rpad(base, len, pad)); } } @@ -3370,7 +3363,7 @@ public ExprEval apply(List args, Expr.ObjectBinding bindings) } } if (arrayElementType == null) { - arrayElementType = NullHandling.sqlCompatible() ? ExpressionType.LONG : ExpressionType.STRING; + arrayElementType = ExpressionType.LONG; } for (int i = 0; i < length; i++) { out[i] = outEval[i].castTo(arrayElementType).value(); @@ -3612,7 +3605,7 @@ ExprEval doApply(ExprEval arrayExpr, ExprEval scalarExpr) break; } } - return index < 0 ? ExprEval.ofLong(NullHandling.replaceWithDefault() ? -1 : null) : ExprEval.ofLong(index); + return index < 0 ? ExprEval.ofLong(null) : ExprEval.ofLong(index); default: throw validationFailed( "second argument must be a a scalar type but got %s instead", @@ -3653,7 +3646,7 @@ ExprEval doApply(ExprEval arrayExpr, ExprEval scalarExpr) } } return index < 0 - ? ExprEval.ofLong(NullHandling.replaceWithDefault() ? -1 : null) + ? ExprEval.ofLong(null) : ExprEval.ofLong(index + 1); default: throw validationFailed( @@ -4244,7 +4237,7 @@ abstract class SizeFormatFunc implements Function public ExprEval apply(List args, Expr.ObjectBinding bindings) { final ExprEval valueParam = args.get(0).eval(bindings); - if (NullHandling.sqlCompatible() && valueParam.isNumericNull()) { + if (valueParam.isNumericNull()) { return ExprEval.of(null); } diff --git a/processing/src/main/java/org/apache/druid/math/expr/UnaryOperatorExpr.java b/processing/src/main/java/org/apache/druid/math/expr/UnaryOperatorExpr.java index 30b3f9f4fc7a..2b7c87668b88 100644 --- a/processing/src/main/java/org/apache/druid/math/expr/UnaryOperatorExpr.java +++ b/processing/src/main/java/org/apache/druid/math/expr/UnaryOperatorExpr.java @@ -20,7 +20,6 @@ package org.apache.druid.math.expr; import com.google.common.collect.ImmutableSet; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.IAE; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.math.expr.vector.ExprVectorProcessor; @@ -134,7 +133,7 @@ public ExprEval eval(ObjectBinding bindings) return ExprEval.of(((BigInteger) expr.getLiteralValue()).multiply(BigInteger.valueOf(-1)).longValueExact()); } ExprEval ret = expr.eval(bindings); - if (NullHandling.sqlCompatible() && (ret.value() == null)) { + if (ret.value() == null) { return ExprEval.of(null); } if (ret.type().is(ExprType.LONG)) { @@ -177,7 +176,7 @@ UnaryExpr copy(Expr expr) public ExprEval eval(ObjectBinding bindings) { ExprEval ret = expr.eval(bindings); - if (NullHandling.sqlCompatible() && (ret.value() == null)) { + if (ret.value() == null) { return ExprEval.of(null); } return ExprEval.ofLongBoolean(!ret.asBoolean()); diff --git a/processing/src/main/java/org/apache/druid/math/expr/vector/BivariateFunctionVectorObjectProcessor.java b/processing/src/main/java/org/apache/druid/math/expr/vector/BivariateFunctionVectorObjectProcessor.java index 2f7ae4f079bb..97f8fe434063 100644 --- a/processing/src/main/java/org/apache/druid/math/expr/vector/BivariateFunctionVectorObjectProcessor.java +++ b/processing/src/main/java/org/apache/druid/math/expr/vector/BivariateFunctionVectorObjectProcessor.java @@ -19,7 +19,6 @@ package org.apache.druid.math.expr.vector; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.math.expr.Expr; import java.lang.reflect.Array; @@ -36,7 +35,6 @@ public abstract class BivariateFunctionVectorObjectProcessor left; final ExprVectorProcessor right; final TOutput outValues; - final boolean sqlCompatible = NullHandling.sqlCompatible(); protected BivariateFunctionVectorObjectProcessor( ExprVectorProcessor left, @@ -60,16 +58,10 @@ public ExprEvalVector evalVector(Expr.VectorInputBinding bindings) final TLeftInput leftInput = lhs.values(); final TRightInput rightInput = rhs.values(); - if (sqlCompatible) { - for (int i = 0; i < currentSize; i++) { - if (Array.get(leftInput, i) == null || Array.get(rightInput, i) == null) { - processNull(i); - } else { - processIndex(leftInput, rightInput, i); - } - } - } else { - for (int i = 0; i < currentSize; i++) { + for (int i = 0; i < currentSize; i++) { + if (Array.get(leftInput, i) == null || Array.get(rightInput, i) == null) { + processNull(i); + } else { processIndex(leftInput, rightInput, i); } } diff --git a/processing/src/main/java/org/apache/druid/math/expr/vector/ExprEvalObjectVector.java b/processing/src/main/java/org/apache/druid/math/expr/vector/ExprEvalObjectVector.java index 05dba92ebd7f..4819bf178d47 100644 --- a/processing/src/main/java/org/apache/druid/math/expr/vector/ExprEvalObjectVector.java +++ b/processing/src/main/java/org/apache/druid/math/expr/vector/ExprEvalObjectVector.java @@ -19,7 +19,6 @@ package org.apache.druid.math.expr.vector; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; import org.apache.druid.math.expr.Evals; import org.apache.druid.math.expr.ExprEval; @@ -68,7 +67,7 @@ private void computeNumbers() } else { longs[i] = 0L; doubles[i] = 0.0; - numericNulls[i] = NullHandling.sqlCompatible(); + numericNulls[i] = true; } } else { // ARRAY, COMPLEX diff --git a/processing/src/main/java/org/apache/druid/math/expr/vector/LongOutObjectsInFunctionVectorProcessor.java b/processing/src/main/java/org/apache/druid/math/expr/vector/LongOutObjectsInFunctionVectorProcessor.java index 89caa4cf0a15..4ab792eee06f 100644 --- a/processing/src/main/java/org/apache/druid/math/expr/vector/LongOutObjectsInFunctionVectorProcessor.java +++ b/processing/src/main/java/org/apache/druid/math/expr/vector/LongOutObjectsInFunctionVectorProcessor.java @@ -19,7 +19,6 @@ package org.apache.druid.math.expr.vector; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.math.expr.ExpressionType; import javax.annotation.Nullable; @@ -53,7 +52,7 @@ void processIndex(Object[] in1, Object[] in2, int i) final Long outVal = processValue(in1[i], in2[i]); if (outVal == null) { outValues[i] = 0L; - outNulls[i] = NullHandling.sqlCompatible(); + outNulls[i] = true; } else { outValues[i] = outVal; outNulls[i] = false; @@ -64,7 +63,7 @@ void processIndex(Object[] in1, Object[] in2, int i) void processNull(int i) { outValues[i] = 0L; - outNulls[i] = NullHandling.sqlCompatible(); + outNulls[i] = true; } @Override diff --git a/processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java b/processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java index 1f5727b83616..3792151f1449 100644 --- a/processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java +++ b/processing/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java @@ -20,7 +20,6 @@ package org.apache.druid.math.expr.vector; import com.google.common.base.Preconditions; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; import org.apache.druid.math.expr.Evals; import org.apache.druid.math.expr.Expr; @@ -120,12 +119,8 @@ public static ExprVectorProcessor constant(@Nullable Double constant, int final double[] doubles = new double[maxVectorSize]; final boolean[] nulls; if (constant == null) { - if (NullHandling.sqlCompatible()) { - nulls = new boolean[maxVectorSize]; - Arrays.fill(nulls, true); - } else { - nulls = null; - } + nulls = new boolean[maxVectorSize]; + Arrays.fill(nulls, true); } else { nulls = null; Arrays.fill(doubles, constant); @@ -157,12 +152,8 @@ public static ExprVectorProcessor constant(@Nullable Long constant, int m final long[] longs = new long[maxVectorSize]; final boolean[] nulls; if (constant == null) { - if (NullHandling.sqlCompatible()) { - nulls = new boolean[maxVectorSize]; - Arrays.fill(nulls, true); - } else { - nulls = null; - } + nulls = new boolean[maxVectorSize]; + Arrays.fill(nulls, true); } else { nulls = null; Arrays.fill(longs, constant); @@ -198,11 +189,7 @@ public static ExprVectorProcessor identifier(Expr.VectorInputBindingInspector if (inputType == null) { // nil column, we can be anything, so be a string because it's the most flexible - if (NullHandling.sqlCompatible()) { - return constant((Long) null, inspector.getMaxVectorSize()); - } else { - return constant(null, inspector.getMaxVectorSize(), ExpressionType.STRING); - } + return constant((Long) null, inspector.getMaxVectorSize()); } switch (inputType.getType()) { case LONG: @@ -255,7 +242,7 @@ public void processIndex(Object[] strings, long[] longs, boolean[] outputNulls, final String input = (String) strings[i]; if (input == null) { longs[i] = 0L; - outputNulls[i] = NullHandling.sqlCompatible(); + outputNulls[i] = true; } else { if (radix == 16 && (input.startsWith("0x") || input.startsWith("0X"))) { // Strip leading 0x from hex strings. @@ -268,7 +255,7 @@ public void processIndex(Object[] strings, long[] longs, boolean[] outputNulls, } catch (NumberFormatException e) { longs[i] = 0L; - outputNulls[i] = NullHandling.sqlCompatible(); + outputNulls[i] = true; } } }; @@ -706,27 +693,25 @@ public void processIndex( int i ) { - if (NullHandling.sqlCompatible()) { - // true/null, null/true -> true - // false/null, null/false, null/null -> null - final boolean leftNull = leftNulls != null && leftNulls[i]; - final boolean rightNull = rightNulls != null && rightNulls[i]; - if (leftNull) { - if (rightNull) { - output[i] = 0L; - outputNulls[i] = true; - return; - } - final boolean bool = Evals.asBoolean(rightInput[i]); - output[i] = Evals.asLong(bool); - outputNulls[i] = !bool; - return; - } else if (rightNull) { - final boolean bool = Evals.asBoolean(leftInput[i]); - output[i] = Evals.asLong(bool); - outputNulls[i] = !bool; + // true/null, null/true -> true + // false/null, null/false, null/null -> null + final boolean leftNull = leftNulls != null && leftNulls[i]; + final boolean rightNull = rightNulls != null && rightNulls[i]; + if (leftNull) { + if (rightNull) { + output[i] = 0L; + outputNulls[i] = true; return; } + final boolean bool = Evals.asBoolean(rightInput[i]); + output[i] = Evals.asLong(bool); + outputNulls[i] = !bool; + return; + } else if (rightNull) { + final boolean bool = Evals.asBoolean(leftInput[i]); + output[i] = Evals.asLong(bool); + outputNulls[i] = !bool; + return; } output[i] = Evals.asLong(Evals.asBoolean(leftInput[i]) || Evals.asBoolean(rightInput[i])); outputNulls[i] = false; @@ -756,27 +741,25 @@ public void processIndex( int i ) { - if (NullHandling.sqlCompatible()) { - // true/null, null/true -> true - // false/null, null/false, null/null -> null - final boolean leftNull = leftNulls != null && leftNulls[i]; - final boolean rightNull = rightNulls != null && rightNulls[i]; - if (leftNull) { - if (rightNull) { - output[i] = 0; - outputNulls[i] = true; - return; - } - final boolean bool = Evals.asBoolean(rightInput[i]); - output[i] = Evals.asLong(bool); - outputNulls[i] = !bool; - return; - } else if (rightNull) { - final boolean bool = Evals.asBoolean(leftInput[i]); - output[i] = Evals.asLong(bool); - outputNulls[i] = !bool; + // true/null, null/true -> true + // false/null, null/false, null/null -> null + final boolean leftNull = leftNulls != null && leftNulls[i]; + final boolean rightNull = rightNulls != null && rightNulls[i]; + if (leftNull) { + if (rightNull) { + output[i] = 0; + outputNulls[i] = true; return; } + final boolean bool = Evals.asBoolean(rightInput[i]); + output[i] = Evals.asLong(bool); + outputNulls[i] = !bool; + return; + } else if (rightNull) { + final boolean bool = Evals.asBoolean(leftInput[i]); + output[i] = Evals.asLong(bool); + outputNulls[i] = !bool; + return; } output[i] = Evals.asLong(Evals.asBoolean(leftInput[i]) || Evals.asBoolean(rightInput[i])); outputNulls[i] = false; @@ -812,7 +795,7 @@ public void processIndex( final boolean rightNull = rightInput[i] == null; if (leftNull) { if (rightNull) { - outputNulls[i] = NullHandling.sqlCompatible(); + outputNulls[i] = true; return; } final boolean bool = Evals.asBoolean((String) rightInput[i]); @@ -872,27 +855,25 @@ public void processIndex( int i ) { - if (NullHandling.sqlCompatible()) { - // true/null, null/true, null/null -> null - // false/null, null/false -> false - final boolean leftNull = leftNulls != null && leftNulls[i]; - final boolean rightNull = rightNulls != null && rightNulls[i]; - if (leftNull) { - if (rightNull) { - output[i] = 0L; - outputNulls[i] = true; - return; - } - final boolean bool = Evals.asBoolean(rightInput[i]); - output[i] = Evals.asLong(bool); - outputNulls[i] = bool; - return; - } else if (rightNull) { - final boolean bool = Evals.asBoolean(leftInput[i]); - output[i] = Evals.asLong(bool); - outputNulls[i] = bool; + // true/null, null/true, null/null -> null + // false/null, null/false -> false + final boolean leftNull = leftNulls != null && leftNulls[i]; + final boolean rightNull = rightNulls != null && rightNulls[i]; + if (leftNull) { + if (rightNull) { + output[i] = 0L; + outputNulls[i] = true; return; } + final boolean bool = Evals.asBoolean(rightInput[i]); + output[i] = Evals.asLong(bool); + outputNulls[i] = bool; + return; + } else if (rightNull) { + final boolean bool = Evals.asBoolean(leftInput[i]); + output[i] = Evals.asLong(bool); + outputNulls[i] = bool; + return; } output[i] = Evals.asLong(Evals.asBoolean(leftInput[i]) && Evals.asBoolean(rightInput[i])); outputNulls[i] = false; @@ -922,27 +903,25 @@ public void processIndex( int i ) { - if (NullHandling.sqlCompatible()) { - // true/null, null/true, null/null -> null - // false/null, null/false -> false - final boolean leftNull = leftNulls != null && leftNulls[i]; - final boolean rightNull = rightNulls != null && rightNulls[i]; - if (leftNull) { - if (rightNull) { - output[i] = 0L; - outputNulls[i] = true; - return; - } - final boolean bool = Evals.asBoolean(rightInput[i]); - output[i] = Evals.asLong(bool); - outputNulls[i] = bool; - return; - } else if (rightNull) { - final boolean bool = Evals.asBoolean(leftInput[i]); - output[i] = Evals.asLong(bool); - outputNulls[i] = bool; + // true/null, null/true, null/null -> null + // false/null, null/false -> false + final boolean leftNull = leftNulls != null && leftNulls[i]; + final boolean rightNull = rightNulls != null && rightNulls[i]; + if (leftNull) { + if (rightNull) { + output[i] = 0L; + outputNulls[i] = true; return; } + final boolean bool = Evals.asBoolean(rightInput[i]); + output[i] = Evals.asLong(bool); + outputNulls[i] = bool; + return; + } else if (rightNull) { + final boolean bool = Evals.asBoolean(leftInput[i]); + output[i] = Evals.asLong(bool); + outputNulls[i] = bool; + return; } output[i] = Evals.asLong(Evals.asBoolean(leftInput[i]) && Evals.asBoolean(rightInput[i])); outputNulls[i] = false; diff --git a/processing/src/main/java/org/apache/druid/math/expr/vector/VectorStringProcessors.java b/processing/src/main/java/org/apache/druid/math/expr/vector/VectorStringProcessors.java index 342c8fa7522f..54f31c777512 100644 --- a/processing/src/main/java/org/apache/druid/math/expr/vector/VectorStringProcessors.java +++ b/processing/src/main/java/org/apache/druid/math/expr/vector/VectorStringProcessors.java @@ -19,7 +19,6 @@ package org.apache.druid.math.expr.vector; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.math.expr.Evals; import org.apache.druid.math.expr.Expr; import org.apache.druid.math.expr.ExpressionType; @@ -31,40 +30,20 @@ public class VectorStringProcessors { public static ExprVectorProcessor concat(Expr.VectorInputBindingInspector inspector, Expr left, Expr right) { - final ExprVectorProcessor processor; - if (NullHandling.sqlCompatible()) { - processor = new ObjectOutObjectsInFunctionVectorProcessor( - left.asVectorProcessor(inspector), - right.asVectorProcessor(inspector), - inspector.getMaxVectorSize(), - ExpressionType.STRING - ) - { - @Nullable - @Override - protected String processValue(@Nullable Object leftVal, @Nullable Object rightVal) - { - // in sql compatible mode, nulls are handled by super class and never make it here... - return leftVal + (String) rightVal; - } - }; - } else { - processor = new ObjectOutObjectsInFunctionVectorProcessor( - left.asVectorProcessor(inspector), - right.asVectorProcessor(inspector), - inspector.getMaxVectorSize(), - ExpressionType.STRING - ) + final ExprVectorProcessor processor = new ObjectOutObjectsInFunctionVectorProcessor( + left.asVectorProcessor(inspector), + right.asVectorProcessor(inspector), + inspector.getMaxVectorSize(), + ExpressionType.STRING + ) + { + @Nullable + @Override + protected String processValue(@Nullable Object leftVal, @Nullable Object rightVal) { - @Nullable - @Override - protected Object processValue(@Nullable Object leftVal, @Nullable Object rightVal) - { - return NullHandling.nullToEmptyIfNeeded((String) leftVal) - + NullHandling.nullToEmptyIfNeeded((String) rightVal); - } - }; - } + return leftVal + (String) rightVal; + } + }; return processor; } @@ -89,14 +68,14 @@ void processIndex(Object[][] in, int i) { // Result of concatenation is null if any of the Values is null. // e.g. 'select CONCAT(null, "abc") as c;' will return null as per Standard SQL spec. - String first = NullHandling.nullToEmptyIfNeeded(Evals.asString(in[0][i])); + String first = Evals.asString(in[0][i]); if (first == null) { outValues[i] = null; return; } final StringBuilder builder = new StringBuilder(first); for (int inputNumber = 1; inputNumber < in.length; inputNumber++) { - final String s = NullHandling.nullToEmptyIfNeeded(Evals.asString(in[inputNumber][i])); + final String s = Evals.asString(in[inputNumber][i]); if (s == null) { outValues[i] = null; return; diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/ExpressionLambdaAggregatorFactory.java b/processing/src/main/java/org/apache/druid/query/aggregation/ExpressionLambdaAggregatorFactory.java index 160dc5c19d7b..79db51d9b9c6 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/ExpressionLambdaAggregatorFactory.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/ExpressionLambdaAggregatorFactory.java @@ -28,7 +28,6 @@ import com.google.common.base.Suppliers; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Iterables; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.HumanReadableBytes; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.math.expr.Expr; @@ -124,7 +123,7 @@ public ExpressionLambdaAggregatorFactory( this.initialValueExpressionString = initialValue; this.initialCombineValueExpressionString = initialCombineValue == null ? initialValue : initialCombineValue; - this.isNullUnlessAggregated = isNullUnlessAggregated == null ? NullHandling.sqlCompatible() : isNullUnlessAggregated; + this.isNullUnlessAggregated = isNullUnlessAggregated == null || isNullUnlessAggregated; this.shouldAggregateNullInputs = shouldAggregateNullInputs == null || shouldAggregateNullInputs; if (shouldCombineAggregateNullInputs == null) { this.shouldCombineAggregateNullInputs = this.shouldAggregateNullInputs; diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/NullableNumericAggregatorFactory.java b/processing/src/main/java/org/apache/druid/query/aggregation/NullableNumericAggregatorFactory.java index d85d91936d78..3dfc2919e44b 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/NullableNumericAggregatorFactory.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/NullableNumericAggregatorFactory.java @@ -21,7 +21,6 @@ import com.google.common.base.Preconditions; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.guice.annotations.ExtensionPoint; import org.apache.druid.segment.BaseNullableColumnValueSelector; import org.apache.druid.segment.BaseObjectColumnValueSelector; @@ -55,7 +54,7 @@ public final Aggregator factorize(ColumnSelectorFactory columnSelectorFactory) T selector = selector(columnSelectorFactory); BaseNullableColumnValueSelector nullSelector = makeNullSelector(selector, columnSelectorFactory); Aggregator aggregator = factorize(columnSelectorFactory, selector); - return NullHandling.sqlCompatible() ? new NullableNumericAggregator(aggregator, nullSelector) : aggregator; + return new NullableNumericAggregator(aggregator, nullSelector); } @Override @@ -64,7 +63,7 @@ public final BufferAggregator factorizeBuffered(ColumnSelectorFactory columnSele T selector = selector(columnSelectorFactory); BaseNullableColumnValueSelector nullSelector = makeNullSelector(selector, columnSelectorFactory); BufferAggregator aggregator = factorizeBuffered(columnSelectorFactory, selector); - return NullHandling.sqlCompatible() ? new NullableNumericBufferAggregator(aggregator, nullSelector) : aggregator; + return new NullableNumericBufferAggregator(aggregator, nullSelector); } @Override @@ -73,20 +72,20 @@ public final VectorAggregator factorizeVector(VectorColumnSelectorFactory column Preconditions.checkState(canVectorize(columnSelectorFactory), "Cannot vectorize"); VectorValueSelector selector = vectorSelector(columnSelectorFactory); VectorAggregator aggregator = factorizeVector(columnSelectorFactory, selector); - return NullHandling.sqlCompatible() ? new NullableNumericVectorAggregator(aggregator, selector) : aggregator; + return new NullableNumericVectorAggregator(aggregator, selector); } @Override public final AggregateCombiner makeNullableAggregateCombiner() { AggregateCombiner combiner = makeAggregateCombiner(); - return NullHandling.sqlCompatible() ? new NullableNumericAggregateCombiner<>(combiner) : combiner; + return new NullableNumericAggregateCombiner<>(combiner); } @Override public final int getMaxIntermediateSizeWithNulls() { - return getMaxIntermediateSize() + (NullHandling.replaceWithDefault() ? 0 : Byte.BYTES); + return getMaxIntermediateSize() + Byte.BYTES; } /** diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/SingleValueAggregator.java b/processing/src/main/java/org/apache/druid/query/aggregation/SingleValueAggregator.java index 0f2f96d7c3fe..ff34dc57711c 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/SingleValueAggregator.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/SingleValueAggregator.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.InvalidInput; import org.apache.druid.segment.ColumnValueSelector; @@ -57,32 +56,32 @@ public Object get() public float getFloat() { assert validObjectValue(); - return (value == null) ? NullHandling.ZERO_FLOAT : ((Number) value).floatValue(); + return (value == null) ? 0.0f : ((Number) value).floatValue(); } @Override public long getLong() { assert validObjectValue(); - return (value == null) ? NullHandling.ZERO_LONG : ((Number) value).longValue(); + return (value == null) ? 0L : ((Number) value).longValue(); } @Override public double getDouble() { assert validObjectValue(); - return (value == null) ? NullHandling.ZERO_DOUBLE : ((Number) value).doubleValue(); + return (value == null) ? 0.0d : ((Number) value).doubleValue(); } @Override public boolean isNull() { - return NullHandling.sqlCompatible() && value == null; + return value == null; } private boolean validObjectValue() { - return NullHandling.replaceWithDefault() || !isNull(); + return !isNull(); } @Override diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/SingleValueBufferAggregator.java b/processing/src/main/java/org/apache/druid/query/aggregation/SingleValueBufferAggregator.java index 0d26654f3a21..5b5b6b2e0542 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/SingleValueBufferAggregator.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/SingleValueBufferAggregator.java @@ -103,7 +103,7 @@ public Object get(ByteBuffer buf, int position) public float getFloat(ByteBuffer buf, int position) { return TypeStrategies.isNullableNull(buf, position) - ? NullHandling.ZERO_FLOAT + ? 0.0f : TypeStrategies.readNotNullNullableFloat(buf, position); } @@ -111,7 +111,7 @@ public float getFloat(ByteBuffer buf, int position) public double getDouble(ByteBuffer buf, int position) { return TypeStrategies.isNullableNull(buf, position) - ? NullHandling.ZERO_DOUBLE + ? 0.0d : TypeStrategies.readNotNullNullableDouble(buf, position); } @@ -119,7 +119,7 @@ public double getDouble(ByteBuffer buf, int position) public long getLong(ByteBuffer buf, int position) { return TypeStrategies.isNullableNull(buf, position) - ? NullHandling.ZERO_LONG + ? 0L : TypeStrategies.readNotNullNullableLong(buf, position); } diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/any/NilVectorAggregator.java b/processing/src/main/java/org/apache/druid/query/aggregation/any/NilVectorAggregator.java index b4468813f529..7f2170e5de1e 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/any/NilVectorAggregator.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/any/NilVectorAggregator.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.any; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.aggregation.VectorAggregator; import javax.annotation.Nullable; @@ -31,15 +30,15 @@ public class NilVectorAggregator implements VectorAggregator { private static final NilVectorAggregator DOUBLE_NIL_VECTOR_AGGREGATOR = new NilVectorAggregator( - NullHandling.defaultDoubleValue() + null ); private static final NilVectorAggregator FLOAT_NIL_VECTOR_AGGREGATOR = new NilVectorAggregator( - NullHandling.defaultFloatValue() + null ); private static final NilVectorAggregator LONG_NIL_VECTOR_AGGREGATOR = new NilVectorAggregator( - NullHandling.defaultLongValue() + null ); /** diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/any/NumericAnyAggregator.java b/processing/src/main/java/org/apache/druid/query/aggregation/any/NumericAnyAggregator.java index 25102e61c59b..38dd6b6e5f0f 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/any/NumericAnyAggregator.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/any/NumericAnyAggregator.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.any; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.aggregation.Aggregator; import org.apache.druid.segment.BaseNullableColumnValueSelector; @@ -28,7 +27,6 @@ */ public abstract class NumericAnyAggregator implements Aggregator { - private final boolean useDefault = NullHandling.replaceWithDefault(); final TSelector valueSelector; boolean isNull; @@ -37,7 +35,7 @@ public abstract class NumericAnyAggregator { @@ -42,7 +35,7 @@ public static void addDoubleToCollector(final HyperLogLogCollector collector, fi @Override public void hashRow(BaseDoubleColumnValueSelector selector, Hasher hasher) { - if (NullHandling.replaceWithDefault() || !selector.isNull()) { + if (!selector.isNull()) { hasher.putDouble(selector.getDouble()); } } @@ -50,7 +43,7 @@ public void hashRow(BaseDoubleColumnValueSelector selector, Hasher hasher) @Override public void hashValues(BaseDoubleColumnValueSelector selector, HyperLogLogCollector collector) { - if (NullHandling.replaceWithDefault() || !selector.isNull()) { + if (!selector.isNull()) { addDoubleToCollector(collector, selector.getDouble()); } } diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/types/FloatCardinalityAggregatorColumnSelectorStrategy.java b/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/types/FloatCardinalityAggregatorColumnSelectorStrategy.java index 2b04e1fe6355..403e75e99cda 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/types/FloatCardinalityAggregatorColumnSelectorStrategy.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/types/FloatCardinalityAggregatorColumnSelectorStrategy.java @@ -20,17 +20,10 @@ package org.apache.druid.query.aggregation.cardinality.types; import com.google.common.hash.Hasher; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.hll.HyperLogLogCollector; import org.apache.druid.query.aggregation.cardinality.CardinalityAggregator; import org.apache.druid.segment.BaseFloatColumnValueSelector; -/** - * If performance of this class appears to be a bottleneck for somebody, - * one simple way to improve it is to split it into two different classes, - * one that is used when {@link NullHandling#replaceWithDefault()} is false, - * and one - when it's true, moving this computation out of the tight loop - */ public class FloatCardinalityAggregatorColumnSelectorStrategy implements CardinalityAggregatorColumnSelectorStrategy { @@ -42,7 +35,7 @@ public static void addFloatToCollector(final HyperLogLogCollector collector, fin @Override public void hashRow(BaseFloatColumnValueSelector selector, Hasher hasher) { - if (NullHandling.replaceWithDefault() || !selector.isNull()) { + if (!selector.isNull()) { hasher.putFloat(selector.getFloat()); } } @@ -50,7 +43,7 @@ public void hashRow(BaseFloatColumnValueSelector selector, Hasher hasher) @Override public void hashValues(BaseFloatColumnValueSelector selector, HyperLogLogCollector collector) { - if (NullHandling.replaceWithDefault() || !selector.isNull()) { + if (!selector.isNull()) { addFloatToCollector(collector, selector.getFloat()); } } diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/types/LongCardinalityAggregatorColumnSelectorStrategy.java b/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/types/LongCardinalityAggregatorColumnSelectorStrategy.java index 75a0f3f428f9..b2abf62d12d7 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/types/LongCardinalityAggregatorColumnSelectorStrategy.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/types/LongCardinalityAggregatorColumnSelectorStrategy.java @@ -20,17 +20,10 @@ package org.apache.druid.query.aggregation.cardinality.types; import com.google.common.hash.Hasher; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.hll.HyperLogLogCollector; import org.apache.druid.query.aggregation.cardinality.CardinalityAggregator; import org.apache.druid.segment.BaseLongColumnValueSelector; -/** - * If performance of this class appears to be a bottleneck for somebody, - * one simple way to improve it is to split it into two different classes, - * one that is used when {@link NullHandling#replaceWithDefault()} is false, - * and one - when it's true, moving this computation out of the tight loop - */ public class LongCardinalityAggregatorColumnSelectorStrategy implements CardinalityAggregatorColumnSelectorStrategy { @@ -42,7 +35,7 @@ public static void addLongToCollector(final HyperLogLogCollector collector, fina @Override public void hashRow(BaseLongColumnValueSelector selector, Hasher hasher) { - if (NullHandling.replaceWithDefault() || !selector.isNull()) { + if (!selector.isNull()) { hasher.putLong(selector.getLong()); } } @@ -50,7 +43,7 @@ public void hashRow(BaseLongColumnValueSelector selector, Hasher hasher) @Override public void hashValues(BaseLongColumnValueSelector selector, HyperLogLogCollector collector) { - if (NullHandling.replaceWithDefault() || !selector.isNull()) { + if (!selector.isNull()) { addLongToCollector(collector, selector.getLong()); } } diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/types/StringCardinalityAggregatorColumnSelectorStrategy.java b/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/types/StringCardinalityAggregatorColumnSelectorStrategy.java index cfa68d043344..407ca3b3a244 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/types/StringCardinalityAggregatorColumnSelectorStrategy.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/types/StringCardinalityAggregatorColumnSelectorStrategy.java @@ -20,7 +20,6 @@ package org.apache.druid.query.aggregation.cardinality.types; import com.google.common.hash.Hasher; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.hll.HyperLogLogCollector; import org.apache.druid.query.aggregation.cardinality.CardinalityAggregator; import org.apache.druid.segment.DimensionSelector; @@ -36,12 +35,9 @@ public class StringCardinalityAggregatorColumnSelectorStrategy implements Cardin public static void addStringToCollector(final HyperLogLogCollector collector, @Nullable final String s) { - // SQL standard spec does not count null values, - // Skip counting null values when we are not replacing null with default value. - // A special value for null in case null handling is configured to use empty string for null. - // check if nulls are to be ignored - if ((NullHandling.replaceWithDefault() && !NullHandling.ignoreNullsForStringCardinality()) || s != null) { - collector.add(CardinalityAggregator.HASH_FUNCTION.hashUnencodedChars(nullToSpecial(s)).asBytes()); + // SQL standard spec does not count null values + if (s != null) { + collector.add(CardinalityAggregator.HASH_FUNCTION.hashUnencodedChars(s).asBytes()); } } @@ -53,26 +49,23 @@ public void hashRow(DimensionSelector dimSelector, Hasher hasher) // nothing to add to hasher if size == 0, only handle size == 1 and size != 0 cases. if (size == 1) { final String value = dimSelector.lookupName(row.get(0)); - if (NullHandling.replaceWithDefault() || value != null) { - hasher.putUnencodedChars(nullToSpecial(value)); + if (value != null) { + hasher.putUnencodedChars(value); } } else if (size != 0) { boolean hasNonNullValue = false; final String[] values = new String[size]; for (int i = 0; i < size; ++i) { final String value = dimSelector.lookupName(row.get(i)); - // SQL standard spec does not count null values, - // Skip counting null values when we are not replacing null with default value. - // A special value for null in case null handling is configured to use empty string for null. - if (NullHandling.sqlCompatible() && !hasNonNullValue && value != null) { + if (value != null) { hasNonNullValue = true; } values[i] = nullToSpecial(value); } - // SQL standard spec does not count null values, - // Skip counting null values when we are not replacing null with default value. - // A special value for null in case null handling is configured to use empty string for null. - if (NullHandling.replaceWithDefault() || hasNonNullValue) { + // note: this behavior is weird and probably not correct, as it skips things like [null, null] instead of + // counting them, and it sorts the values so [a, b] and [b, a] would be treated as equivalent... and not treated + // as distinct rows. Leaving as is to avoid changing the behavior for now though + if (hasNonNullValue) { // Values need to be sorted to ensure consistent multi-value ordering across different segments Arrays.sort(values); for (int i = 0; i < size; ++i) { diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/DoubleCardinalityVectorProcessor.java b/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/DoubleCardinalityVectorProcessor.java index ad63f1ac8896..5cfdc1c06b38 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/DoubleCardinalityVectorProcessor.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/DoubleCardinalityVectorProcessor.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.cardinality.vector; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.hll.HyperLogLogCollector; import org.apache.druid.query.aggregation.cardinality.types.DoubleCardinalityAggregatorColumnSelectorStrategy; import org.apache.druid.segment.vector.VectorValueSelector; @@ -53,7 +52,7 @@ public void aggregate(ByteBuffer buf, int position, int startRow, int endRow) final HyperLogLogCollector collector = HyperLogLogCollector.makeCollector(buf); for (int i = startRow; i < endRow; i++) { - if (NullHandling.replaceWithDefault() || nullVector == null || !nullVector[i]) { + if (nullVector == null || !nullVector[i]) { DoubleCardinalityAggregatorColumnSelectorStrategy.addDoubleToCollector(collector, vector[i]); } } @@ -77,7 +76,7 @@ public void aggregate(ByteBuffer buf, int numRows, int[] positions, @Nullable in for (int i = 0; i < numRows; i++) { final int idx = rows != null ? rows[i] : i; - if (NullHandling.replaceWithDefault() || nullVector == null || !nullVector[idx]) { + if (nullVector == null || !nullVector[idx]) { final int position = positions[i] + positionOffset; buf.limit(position + HyperLogLogCollector.getLatestNumBytesForDenseStorage()); buf.position(position); diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/FloatCardinalityVectorProcessor.java b/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/FloatCardinalityVectorProcessor.java index 1be4dd3d5952..33b0b7f3fbed 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/FloatCardinalityVectorProcessor.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/FloatCardinalityVectorProcessor.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.cardinality.vector; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.hll.HyperLogLogCollector; import org.apache.druid.query.aggregation.cardinality.types.FloatCardinalityAggregatorColumnSelectorStrategy; import org.apache.druid.segment.vector.VectorValueSelector; @@ -53,7 +52,7 @@ public void aggregate(ByteBuffer buf, int position, int startRow, int endRow) final HyperLogLogCollector collector = HyperLogLogCollector.makeCollector(buf); for (int i = startRow; i < endRow; i++) { - if (NullHandling.replaceWithDefault() || nullVector == null || !nullVector[i]) { + if (nullVector == null || !nullVector[i]) { FloatCardinalityAggregatorColumnSelectorStrategy.addFloatToCollector(collector, vector[i]); } } @@ -77,7 +76,7 @@ public void aggregate(ByteBuffer buf, int numRows, int[] positions, @Nullable in for (int i = 0; i < numRows; i++) { final int idx = rows != null ? rows[i] : i; - if (NullHandling.replaceWithDefault() || nullVector == null || !nullVector[idx]) { + if (nullVector == null || !nullVector[idx]) { final int position = positions[i] + positionOffset; buf.limit(position + HyperLogLogCollector.getLatestNumBytesForDenseStorage()); buf.position(position); diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/LongCardinalityVectorProcessor.java b/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/LongCardinalityVectorProcessor.java index f69ab5f8635b..951084640c3b 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/LongCardinalityVectorProcessor.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/LongCardinalityVectorProcessor.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.cardinality.vector; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.hll.HyperLogLogCollector; import org.apache.druid.query.aggregation.cardinality.types.LongCardinalityAggregatorColumnSelectorStrategy; import org.apache.druid.segment.vector.VectorValueSelector; @@ -53,7 +52,7 @@ public void aggregate(ByteBuffer buf, int position, int startRow, int endRow) final HyperLogLogCollector collector = HyperLogLogCollector.makeCollector(buf); for (int i = startRow; i < endRow; i++) { - if (NullHandling.replaceWithDefault() || nullVector == null || !nullVector[i]) { + if (nullVector == null || !nullVector[i]) { LongCardinalityAggregatorColumnSelectorStrategy.addLongToCollector(collector, vector[i]); } } @@ -77,7 +76,7 @@ public void aggregate(ByteBuffer buf, int numRows, int[] positions, @Nullable in for (int i = 0; i < numRows; i++) { final int idx = rows != null ? rows[i] : i; - if (NullHandling.replaceWithDefault() || nullVector == null || !nullVector[idx]) { + if (nullVector == null || !nullVector[idx]) { final int position = positions[i] + positionOffset; buf.limit(position + HyperLogLogCollector.getLatestNumBytesForDenseStorage()); buf.position(position); diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/MultiValueStringCardinalityVectorProcessor.java b/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/MultiValueStringCardinalityVectorProcessor.java index 1ccee04ad02d..2cb9f364f1e1 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/MultiValueStringCardinalityVectorProcessor.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/MultiValueStringCardinalityVectorProcessor.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.cardinality.vector; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.hll.HyperLogLogCollector; import org.apache.druid.query.aggregation.cardinality.types.StringCardinalityAggregatorColumnSelectorStrategy; import org.apache.druid.segment.data.IndexedInts; @@ -84,7 +83,7 @@ public void aggregate(ByteBuffer buf, int numRows, int[] positions, @Nullable in for (int j = 0; j < sz; j++) { final String s = selector.lookupName(ids.get(j)); - if (NullHandling.replaceWithDefault() || s != null) { + if (s != null) { final int position = positions[i] + positionOffset; buf.limit(position + HyperLogLogCollector.getLatestNumBytesForDenseStorage()); buf.position(position); diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/SingleValueStringCardinalityVectorProcessor.java b/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/SingleValueStringCardinalityVectorProcessor.java index e9173d802759..757e76152a65 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/SingleValueStringCardinalityVectorProcessor.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/SingleValueStringCardinalityVectorProcessor.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.cardinality.vector; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.hll.HyperLogLogCollector; import org.apache.druid.query.aggregation.cardinality.types.StringCardinalityAggregatorColumnSelectorStrategy; import org.apache.druid.segment.vector.SingleValueDimensionVectorSelector; @@ -75,7 +74,7 @@ public void aggregate(ByteBuffer buf, int numRows, int[] positions, @Nullable in for (int i = 0; i < numRows; i++) { final String s = selector.lookupName(vector[rows != null ? rows[i] : i]); - if (NullHandling.replaceWithDefault() || s != null) { + if (s != null) { final int position = positions[i] + positionOffset; buf.limit(position + HyperLogLogCollector.getLatestNumBytesForDenseStorage()); buf.position(position); diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/StringObjectCardinalityVectorProcessor.java b/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/StringObjectCardinalityVectorProcessor.java index f083e6decee0..4159926e913b 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/StringObjectCardinalityVectorProcessor.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/vector/StringObjectCardinalityVectorProcessor.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.cardinality.vector; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.hll.HyperLogLogCollector; import org.apache.druid.query.aggregation.cardinality.types.StringCardinalityAggregatorColumnSelectorStrategy; import org.apache.druid.segment.vector.VectorObjectSelector; @@ -75,7 +74,7 @@ public void aggregate(ByteBuffer buf, int numRows, int[] positions, @Nullable in for (int i = 0; i < numRows; i++) { final Object obj = vector[rows != null ? rows[i] : i]; - if (NullHandling.replaceWithDefault() || obj != null) { + if (obj != null) { final int position = positions[i] + positionOffset; buf.limit(position + HyperLogLogCollector.getLatestNumBytesForDenseStorage()); buf.position(position); diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/firstlast/DoubleFirstLastVectorAggregator.java b/processing/src/main/java/org/apache/druid/query/aggregation/firstlast/DoubleFirstLastVectorAggregator.java index 728018691550..fe87804f463f 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/firstlast/DoubleFirstLastVectorAggregator.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/firstlast/DoubleFirstLastVectorAggregator.java @@ -60,7 +60,7 @@ public void init(ByteBuffer buf, int position) buf.putLong(position, selectionPredicate.initValue()); buf.put( position + NULLITY_OFFSET, - NullHandling.replaceWithDefault() ? NullHandling.IS_NOT_NULL_BYTE : NullHandling.IS_NULL_BYTE + NullHandling.IS_NULL_BYTE ); buf.putDouble(position + VALUE_OFFSET, 0.0D); } @@ -101,14 +101,6 @@ protected void putNull(ByteBuffer buf, int position, long time) } - @Override - protected void putDefaultValue(ByteBuffer buf, int position, long time) - { - buf.putLong(position, time); - buf.put(position + NULLITY_OFFSET, NullHandling.IS_NOT_NULL_BYTE); - buf.putDouble(position, 0.0D); - } - @Override protected SerializablePairLongDouble readPairFromVectorSelectors( boolean[] timeNullityVector, diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/firstlast/FirstLastVectorAggregator.java b/processing/src/main/java/org/apache/druid/query/aggregation/firstlast/FirstLastVectorAggregator.java index 129465a6d591..166396e3a6af 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/firstlast/FirstLastVectorAggregator.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/firstlast/FirstLastVectorAggregator.java @@ -21,7 +21,6 @@ import com.google.common.base.Preconditions; import org.apache.druid.collections.SerializablePair; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.aggregation.VectorAggregator; import org.apache.druid.segment.vector.VectorObjectSelector; import org.apache.druid.segment.vector.VectorValueSelector; @@ -45,7 +44,6 @@ public abstract class FirstLastVectorAggregator= lastTime) { lastTime = time; - if (useDefault || !valueSelector.isNull()) { + if (!valueSelector.isNull()) { setLastValue(); rhsNull = false; } else { diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/NumericLastBufferAggregator.java b/processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/NumericLastBufferAggregator.java index cc1190fce0ec..352ac17d00ad 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/NumericLastBufferAggregator.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/firstlast/last/NumericLastBufferAggregator.java @@ -39,7 +39,6 @@ public abstract class NumericLastBufferAggregator implements BufferAggregator static final int NULL_OFFSET = Long.BYTES; static final int VALUE_OFFSET = NULL_OFFSET + Byte.BYTES; - private final boolean useDefault = NullHandling.replaceWithDefault(); private final BaseLongColumnValueSelector timeSelector; final ColumnValueSelector valueSelector; @@ -93,7 +92,7 @@ void updateTimeWithNull(ByteBuffer buf, int position, long time) public void init(ByteBuffer buf, int position) { buf.putLong(position, Long.MIN_VALUE); - buf.put(position + NULL_OFFSET, useDefault ? NullHandling.IS_NOT_NULL_BYTE : NullHandling.IS_NULL_BYTE); + buf.put(position + NULL_OFFSET, NullHandling.IS_NULL_BYTE); initValue(buf, position + VALUE_OFFSET); } @@ -124,7 +123,7 @@ public void aggregate(ByteBuffer buf, int position) long time = timeSelector.getLong(); if (time >= lastTime) { - if (useDefault || !valueSelector.isNull()) { + if (!valueSelector.isNull()) { updateTimeWithValue(buf, position, time, valueSelector); } else { updateTimeWithNull(buf, position, time); diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/mean/DoubleMeanAggregator.java b/processing/src/main/java/org/apache/druid/query/aggregation/mean/DoubleMeanAggregator.java index 41d66d188523..3858a251a9b0 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/mean/DoubleMeanAggregator.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/mean/DoubleMeanAggregator.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.mean; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.Numbers; import org.apache.druid.query.aggregation.Aggregator; import org.apache.druid.segment.ColumnValueSelector; @@ -44,7 +43,7 @@ public void aggregate() { Object update = selector.getObject(); - if (update == null && NullHandling.replaceWithDefault() == false) { + if (update == null) { return; } diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/mean/DoubleMeanBufferAggregator.java b/processing/src/main/java/org/apache/druid/query/aggregation/mean/DoubleMeanBufferAggregator.java index f5b5bdd2f60c..77964847512f 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/mean/DoubleMeanBufferAggregator.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/mean/DoubleMeanBufferAggregator.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.mean; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.Numbers; import org.apache.druid.query.aggregation.BufferAggregator; import org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector; @@ -52,7 +51,7 @@ public void aggregate(ByteBuffer buf, int position) { Object update = selector.getObject(); - if (update == null && NullHandling.replaceWithDefault() == false) { + if (update == null) { return; } if (update instanceof DoubleMeanHolder) { diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/mean/DoubleMeanVectorAggregator.java b/processing/src/main/java/org/apache/druid/query/aggregation/mean/DoubleMeanVectorAggregator.java index 878bfc179810..b8858b9aa75f 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/mean/DoubleMeanVectorAggregator.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/mean/DoubleMeanVectorAggregator.java @@ -20,7 +20,6 @@ package org.apache.druid.query.aggregation.mean; import com.google.common.base.Preconditions; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.aggregation.VectorAggregator; import org.apache.druid.segment.vector.VectorValueSelector; @@ -49,16 +48,10 @@ public void aggregate(final ByteBuffer buf, final int position, final int startR final boolean[] nulls = selector.getNullVector(); if (nulls != null) { - if (NullHandling.replaceWithDefault()) { - for (int i = startRow; i < endRow; i++) { + for (int i = startRow; i < endRow; i++) { + if (!nulls[i]) { DoubleMeanHolder.update(buf, position, vector[i]); } - } else { - for (int i = startRow; i < endRow; i++) { - if (!nulls[i]) { - DoubleMeanHolder.update(buf, position, vector[i]); - } - } } } else { for (int i = startRow; i < endRow; i++) { @@ -81,17 +74,10 @@ public void aggregate( final boolean[] nulls = selector.getNullVector(); if (nulls != null) { - if (NullHandling.replaceWithDefault()) { - for (int i = 0; i < numRows; i++) { - final double val = vector[rows != null ? rows[i] : i]; - DoubleMeanHolder.update(buf, positions[i] + positionOffset, val); - } - } else { - for (int j = 0; j < numRows; j++) { - if (!nulls[j]) { - final double val = vector[rows != null ? rows[j] : j]; - DoubleMeanHolder.update(buf, positions[j] + positionOffset, val); - } + for (int j = 0; j < numRows; j++) { + if (!nulls[j]) { + final double val = vector[rows != null ? rows[j] : j]; + DoubleMeanHolder.update(buf, positions[j] + positionOffset, val); } } } else { diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/post/ArithmeticPostAggregator.java b/processing/src/main/java/org/apache/druid/query/aggregation/post/ArithmeticPostAggregator.java index 468be2b2a62b..cc656441551e 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/post/ArithmeticPostAggregator.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/post/ArithmeticPostAggregator.java @@ -24,7 +24,6 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Preconditions; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.IAE; import org.apache.druid.query.Queries; import org.apache.druid.query.aggregation.AggregatorFactory; @@ -35,7 +34,6 @@ import org.apache.druid.segment.column.ColumnType; import javax.annotation.Nullable; - import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; @@ -115,7 +113,7 @@ public Comparator getComparator() public Object compute(Map values) { Iterator fieldsIter = fields.iterator(); - Double retVal = NullHandling.defaultDoubleValue(); + Double retVal = null; if (fieldsIter.hasNext()) { Number nextVal = (Number) fieldsIter.next().compute(values); if (nextVal == null) { diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/post/DoubleGreatestPostAggregator.java b/processing/src/main/java/org/apache/druid/query/aggregation/post/DoubleGreatestPostAggregator.java index 5f67f42657fb..71267daabf48 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/post/DoubleGreatestPostAggregator.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/post/DoubleGreatestPostAggregator.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Preconditions; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.Queries; import org.apache.druid.query.aggregation.AggregatorFactory; import org.apache.druid.query.aggregation.PostAggregator; @@ -83,7 +82,7 @@ public Comparator getComparator() public Object compute(Map values) { Iterator fieldsIter = fields.iterator(); - Double retVal = NullHandling.replaceWithDefault() ? Double.NEGATIVE_INFINITY : null; + Double retVal = null; while (fieldsIter.hasNext()) { Number nextVal = ((Number) fieldsIter.next().compute(values)); // Ignore NULL values and return the greatest out of non-null values. diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/post/DoubleLeastPostAggregator.java b/processing/src/main/java/org/apache/druid/query/aggregation/post/DoubleLeastPostAggregator.java index cfe26c8c802d..71d352f08556 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/post/DoubleLeastPostAggregator.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/post/DoubleLeastPostAggregator.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Preconditions; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.Queries; import org.apache.druid.query.aggregation.AggregatorFactory; import org.apache.druid.query.aggregation.PostAggregator; @@ -83,7 +82,7 @@ public Comparator getComparator() public Object compute(Map values) { Iterator fieldsIter = fields.iterator(); - Double retVal = NullHandling.replaceWithDefault() ? Double.POSITIVE_INFINITY : null; + Double retVal = null; while (fieldsIter.hasNext()) { Number nextVal = ((Number) fieldsIter.next().compute(values)); // Ignore NULL values and return the greatest out of non-null values. diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/post/LongGreatestPostAggregator.java b/processing/src/main/java/org/apache/druid/query/aggregation/post/LongGreatestPostAggregator.java index c9cac56dc8a6..fbc8a5d28ff3 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/post/LongGreatestPostAggregator.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/post/LongGreatestPostAggregator.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Preconditions; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.Queries; import org.apache.druid.query.aggregation.AggregatorFactory; import org.apache.druid.query.aggregation.PostAggregator; @@ -83,7 +82,7 @@ public Comparator getComparator() public Object compute(Map values) { Iterator fieldsIter = fields.iterator(); - Long retVal = NullHandling.replaceWithDefault() ? Long.MIN_VALUE : null; + Long retVal = null; while (fieldsIter.hasNext()) { Number nextVal = ((Number) fieldsIter.next().compute(values)); // Ignore NULL values and return the greatest out of non-null values. diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/post/LongLeastPostAggregator.java b/processing/src/main/java/org/apache/druid/query/aggregation/post/LongLeastPostAggregator.java index 5ec79a924eaa..287b102a12ac 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/post/LongLeastPostAggregator.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/post/LongLeastPostAggregator.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Preconditions; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.Queries; import org.apache.druid.query.aggregation.AggregatorFactory; import org.apache.druid.query.aggregation.PostAggregator; @@ -83,7 +82,7 @@ public Comparator getComparator() public Object compute(Map values) { Iterator fieldsIter = fields.iterator(); - Long retVal = NullHandling.replaceWithDefault() ? Long.MAX_VALUE : null; + Long retVal = null; while (fieldsIter.hasNext()) { Number nextVal = ((Number) fieldsIter.next().compute(values)); // Ignore NULL values and return the greatest out of non-null values. diff --git a/processing/src/main/java/org/apache/druid/query/dimension/ListFilteredDimensionSpec.java b/processing/src/main/java/org/apache/druid/query/dimension/ListFilteredDimensionSpec.java index 2aecafc24818..d4bdb46d2310 100644 --- a/processing/src/main/java/org/apache/druid/query/dimension/ListFilteredDimensionSpec.java +++ b/processing/src/main/java/org/apache/druid/query/dimension/ListFilteredDimensionSpec.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Preconditions; import com.google.common.base.Predicates; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.query.filter.DimFilterUtils; import org.apache.druid.segment.DimensionSelector; @@ -102,7 +101,7 @@ public static IdMapping buildAllowListIdMapping( } } else { for (int i = 0; i < cardinality; i++) { - if (values.contains(NullHandling.nullToEmptyIfNeeded(fn.get(i)))) { + if (values.contains(fn.get(i))) { builder.addMapping(i); } } @@ -118,7 +117,7 @@ public static IdMapping buildDenyListIdMapping( { final IdMapping.Builder builder = IdMapping.Builder.ofCardinality(cardinality); for (int i = 0; i < cardinality; i++) { - if (!values.contains(NullHandling.nullToEmptyIfNeeded(fn.get(i)))) { + if (!values.contains(fn.get(i))) { builder.addMapping(i); } } diff --git a/processing/src/main/java/org/apache/druid/query/dimension/LookupDimensionSpec.java b/processing/src/main/java/org/apache/druid/query/dimension/LookupDimensionSpec.java index 35e6e6cd200f..1f12b72703b7 100644 --- a/processing/src/main/java/org/apache/druid/query/dimension/LookupDimensionSpec.java +++ b/processing/src/main/java/org/apache/druid/query/dimension/LookupDimensionSpec.java @@ -24,7 +24,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Preconditions; import com.google.common.base.Strings; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.ISE; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.query.extraction.ExtractionFn; @@ -80,7 +79,7 @@ public LookupDimensionSpec( { this.retainMissingValue = retainMissingValue; this.optimize = optimize == null ? true : optimize; - this.replaceMissingValueWith = NullHandling.emptyToNullIfNeeded(replaceMissingValueWith); + this.replaceMissingValueWith = replaceMissingValueWith; this.dimension = Preconditions.checkNotNull(dimension, "dimension can not be Null"); this.outputName = Preconditions.checkNotNull(outputName, "outputName can not be Null"); this.lookupExtractorFactoryContainerProvider = lookupExtractorFactoryContainerProvider; diff --git a/processing/src/main/java/org/apache/druid/query/dimension/PrefixFilteredDimensionSpec.java b/processing/src/main/java/org/apache/druid/query/dimension/PrefixFilteredDimensionSpec.java index 5e6467ef2b2b..7eed3890176d 100644 --- a/processing/src/main/java/org/apache/druid/query/dimension/PrefixFilteredDimensionSpec.java +++ b/processing/src/main/java/org/apache/druid/query/dimension/PrefixFilteredDimensionSpec.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Preconditions; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.query.filter.DimFilterUtils; import org.apache.druid.segment.DimensionSelector; @@ -65,16 +64,13 @@ public DimensionSelector decorate(final DimensionSelector selector) if (selectorCardinality < 0 || !selector.nameLookupPossibleInAdvance()) { return new PredicateFilteredDimensionSelector( selector, - input -> { - String val = NullHandling.nullToEmptyIfNeeded(input); - return val != null && val.startsWith(prefix); - } + input -> input != null && input.startsWith(prefix) ); } final IdMapping.Builder builder = IdMapping.Builder.ofUnknownCardinality(); for (int i = 0; i < selectorCardinality; i++) { - String val = NullHandling.nullToEmptyIfNeeded(selector.lookupName(i)); + String val = selector.lookupName(i); if (val != null && val.startsWith(prefix)) { builder.addForwardMapping(i); } diff --git a/processing/src/main/java/org/apache/druid/query/dimension/RegexFilteredDimensionSpec.java b/processing/src/main/java/org/apache/druid/query/dimension/RegexFilteredDimensionSpec.java index 6767958f5a61..24d2fe0ba4a9 100644 --- a/processing/src/main/java/org/apache/druid/query/dimension/RegexFilteredDimensionSpec.java +++ b/processing/src/main/java/org/apache/druid/query/dimension/RegexFilteredDimensionSpec.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Preconditions; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.query.filter.DimFilterUtils; import org.apache.druid.segment.DimensionSelector; @@ -69,16 +68,13 @@ public DimensionSelector decorate(final DimensionSelector selector) if (selectorCardinality < 0 || !selector.nameLookupPossibleInAdvance()) { return new PredicateFilteredDimensionSelector( selector, - input -> { - String val = NullHandling.nullToEmptyIfNeeded(input); - return val != null && compiledRegex.matcher(val).matches(); - } + input -> input != null && compiledRegex.matcher(input).matches() ); } final IdMapping.Builder builder = IdMapping.Builder.ofUnknownCardinality(); for (int i = 0; i < selectorCardinality; i++) { - String val = NullHandling.nullToEmptyIfNeeded(selector.lookupName(i)); + String val = selector.lookupName(i); if (val != null && compiledRegex.matcher(val).matches()) { builder.addForwardMapping(i); } diff --git a/processing/src/main/java/org/apache/druid/query/expression/ContainsExpr.java b/processing/src/main/java/org/apache/druid/query/expression/ContainsExpr.java index 360888092a9b..f003ed35bebf 100644 --- a/processing/src/main/java/org/apache/druid/query/expression/ContainsExpr.java +++ b/processing/src/main/java/org/apache/druid/query/expression/ContainsExpr.java @@ -20,7 +20,6 @@ package org.apache.druid.query.expression; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.IAE; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.math.expr.Expr; @@ -67,7 +66,7 @@ private ContainsExpr( @Override public ExprEval eval(final Expr.ObjectBinding bindings) { - final String s = NullHandling.nullToEmptyIfNeeded(arg.eval(bindings).asString()); + final String s = arg.eval(bindings).asString(); if (s == null) { // same behavior as regexp_like. diff --git a/processing/src/main/java/org/apache/druid/query/expression/ExprUtils.java b/processing/src/main/java/org/apache/druid/query/expression/ExprUtils.java index be513b402489..86b76b58e14a 100644 --- a/processing/src/main/java/org/apache/druid/query/expression/ExprUtils.java +++ b/processing/src/main/java/org/apache/druid/query/expression/ExprUtils.java @@ -19,7 +19,6 @@ package org.apache.druid.query.expression; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.InvalidInput; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.IAE; @@ -80,30 +79,17 @@ static PeriodGranularity toPeriodGranularity( } else { Chronology chronology = timeZone == null ? ISOChronology.getInstanceUTC() : ISOChronology.getInstance(timeZone); final Object value = originArg.eval(bindings).valueOrDefault(); - if (value instanceof String && NullHandling.isNullOrEquivalent((String) value)) { - // We get a blank string here, when sql compatible null handling is enabled - // and expression contains empty string for origin - // e.g timestamp_floor(\"__time\",'PT1M','','UTC') - origin = null; - } else { - origin = value != null ? new DateTime(value, chronology) : null; - } + origin = value != null ? new DateTime(value, chronology) : null; } return new PeriodGranularity(period, origin, timeZone); } /** - * True if Expr is a string literal. - * - * In non-SQL-compliant null handling mode, this method will return true for null literals as well (because they are - * treated equivalently to empty strings, and we cannot tell the difference.) - * - * In SQL-compliant null handling mode, this method will return true for actual strings only, not nulls. + * True if Expr is a non-null string literal. */ static boolean isStringLiteral(final Expr expr) { - return (expr.isLiteral() && expr.getLiteralValue() instanceof String) - || (NullHandling.replaceWithDefault() && expr.isNullLiteral()); + return expr.isLiteral() && expr.getLiteralValue() instanceof String; } } diff --git a/processing/src/main/java/org/apache/druid/query/expression/HyperUniqueExpressions.java b/processing/src/main/java/org/apache/druid/query/expression/HyperUniqueExpressions.java index 3f45fa077d91..3ce8866302bb 100644 --- a/processing/src/main/java/org/apache/druid/query/expression/HyperUniqueExpressions.java +++ b/processing/src/main/java/org/apache/druid/query/expression/HyperUniqueExpressions.java @@ -19,7 +19,6 @@ package org.apache.druid.query.expression; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.hll.HyperLogLogCollector; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.math.expr.Expr; @@ -28,7 +27,6 @@ import org.apache.druid.math.expr.ExprType; import org.apache.druid.math.expr.ExpressionType; import org.apache.druid.query.aggregation.cardinality.CardinalityAggregator; -import org.apache.druid.query.aggregation.cardinality.types.StringCardinalityAggregatorColumnSelectorStrategy; import org.apache.druid.query.aggregation.hyperloglog.HyperUniquesAggregatorFactory; import javax.annotation.Nullable; @@ -163,26 +161,18 @@ public ExprEval eval(ObjectBinding bindings) ExprEval input = args.get(0).eval(bindings); switch (input.type().getType()) { case STRING: - if (input.value() == null) { - if (NullHandling.replaceWithDefault()) { - collector.add( - CardinalityAggregator.HASH_FUNCTION.hashUnencodedChars( - StringCardinalityAggregatorColumnSelectorStrategy.CARDINALITY_AGG_NULL_STRING - ).asBytes() - ); - } - } else { + if (input.value() != null) { collector.add(CardinalityAggregator.HASH_FUNCTION.hashUnencodedChars(input.asString()).asBytes()); } break; case DOUBLE: - if (NullHandling.replaceWithDefault() || !input.isNumericNull()) { + if (!input.isNumericNull()) { collector.add(CardinalityAggregator.HASH_FUNCTION.hashLong(Double.doubleToLongBits(input.asDouble())) .asBytes()); } break; case LONG: - if (NullHandling.replaceWithDefault() || !input.isNumericNull()) { + if (!input.isNumericNull()) { collector.add(CardinalityAggregator.HASH_FUNCTION.hashLong(input.asLong()).asBytes()); } break; diff --git a/processing/src/main/java/org/apache/druid/query/expression/LikeExprMacro.java b/processing/src/main/java/org/apache/druid/query/expression/LikeExprMacro.java index 5cd0d0d375c8..d73699fcac2b 100644 --- a/processing/src/main/java/org/apache/druid/query/expression/LikeExprMacro.java +++ b/processing/src/main/java/org/apache/druid/query/expression/LikeExprMacro.java @@ -19,7 +19,6 @@ package org.apache.druid.query.expression; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.math.expr.Expr; import org.apache.druid.math.expr.ExprEval; import org.apache.druid.math.expr.ExprMacroTable; @@ -65,7 +64,7 @@ public Expr apply(final List args) } final LikeDimFilter.LikeMatcher likeMatcher = LikeDimFilter.LikeMatcher.from( - NullHandling.nullToEmptyIfNeeded((String) patternExpr.getLiteralValue()), + (String) patternExpr.getLiteralValue(), escapeChar ); diff --git a/processing/src/main/java/org/apache/druid/query/expression/LookupExprMacro.java b/processing/src/main/java/org/apache/druid/query/expression/LookupExprMacro.java index 18c3ecee8582..aa2bc30b5328 100644 --- a/processing/src/main/java/org/apache/druid/query/expression/LookupExprMacro.java +++ b/processing/src/main/java/org/apache/druid/query/expression/LookupExprMacro.java @@ -20,7 +20,6 @@ package org.apache.druid.query.expression; import com.google.inject.Inject; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.math.expr.Evals; import org.apache.druid.math.expr.Expr; import org.apache.druid.math.expr.ExprEval; @@ -88,7 +87,7 @@ private LookupExpr(final List args) @Override public ExprEval eval(final ObjectBinding bindings) { - return ExprEval.of(extractionFn.apply(NullHandling.emptyToNullIfNeeded(arg.eval(bindings).asString()))); + return ExprEval.of(extractionFn.apply(arg.eval(bindings).asString())); } @Nullable diff --git a/processing/src/main/java/org/apache/druid/query/expression/RegexpExtractExprMacro.java b/processing/src/main/java/org/apache/druid/query/expression/RegexpExtractExprMacro.java index 03ec99d1fba3..e4eddc5857b1 100644 --- a/processing/src/main/java/org/apache/druid/query/expression/RegexpExtractExprMacro.java +++ b/processing/src/main/java/org/apache/druid/query/expression/RegexpExtractExprMacro.java @@ -19,7 +19,6 @@ package org.apache.druid.query.expression; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.math.expr.Expr; import org.apache.druid.math.expr.ExprEval; @@ -77,13 +76,13 @@ private RegexpExtractExpr(List args) @Override public ExprEval eval(final ObjectBinding bindings) { - final String s = NullHandling.nullToEmptyIfNeeded(arg.eval(bindings).asString()); + final String s = arg.eval(bindings).asString(); if (s == null) { // True nulls do not match anything. Note: this branch only executes in SQL-compatible null handling mode. return ExprEval.of(null); } else { - final Matcher matcher = pattern.matcher(NullHandling.nullToEmptyIfNeeded(s)); + final Matcher matcher = pattern.matcher(s); final String retVal = matcher.find() ? matcher.group(index) : null; return ExprEval.of(retVal); } diff --git a/processing/src/main/java/org/apache/druid/query/expression/RegexpLikeExprMacro.java b/processing/src/main/java/org/apache/druid/query/expression/RegexpLikeExprMacro.java index 9518016024ff..7d59e03eb389 100644 --- a/processing/src/main/java/org/apache/druid/query/expression/RegexpLikeExprMacro.java +++ b/processing/src/main/java/org/apache/druid/query/expression/RegexpLikeExprMacro.java @@ -19,7 +19,6 @@ package org.apache.druid.query.expression; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.math.expr.Expr; import org.apache.druid.math.expr.ExprEval; @@ -70,7 +69,7 @@ private RegexpLikeExpr(List args) @Override public ExprEval eval(final ObjectBinding bindings) { - final String s = NullHandling.nullToEmptyIfNeeded(arg.eval(bindings).asString()); + final String s = arg.eval(bindings).asString(); if (s == null) { // True nulls do not match anything. Note: this branch only executes in SQL-compatible null handling mode. diff --git a/processing/src/main/java/org/apache/druid/query/expression/RegexpReplaceExprMacro.java b/processing/src/main/java/org/apache/druid/query/expression/RegexpReplaceExprMacro.java index 03f67e709ff2..cf7dbdd7de87 100644 --- a/processing/src/main/java/org/apache/druid/query/expression/RegexpReplaceExprMacro.java +++ b/processing/src/main/java/org/apache/druid/query/expression/RegexpReplaceExprMacro.java @@ -19,7 +19,6 @@ package org.apache.druid.query.expression; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.math.expr.Expr; import org.apache.druid.math.expr.ExprEval; import org.apache.druid.math.expr.ExprMacroTable; @@ -94,11 +93,11 @@ private RegexpReplaceExpr(List args) throw validationFailed("replacement must be a string literal"); } - final String patternString = NullHandling.nullToEmptyIfNeeded((String) patternExpr.getLiteralValue()); + final String patternString = (String) patternExpr.getLiteralValue(); this.arg = args.get(0); this.pattern = patternString != null ? Pattern.compile(patternString) : null; - this.replacement = NullHandling.nullToEmptyIfNeeded((String) replacementExpr.getLiteralValue()); + this.replacement = (String) replacementExpr.getLiteralValue(); } @Nonnull @@ -109,7 +108,7 @@ public ExprEval eval(final ObjectBinding bindings) return ExprEval.of(null); } - final String s = NullHandling.nullToEmptyIfNeeded(arg.eval(bindings).asString()); + final String s = arg.eval(bindings).asString(); if (s == null) { return ExprEval.of(null); @@ -135,9 +134,9 @@ private RegexpReplaceDynamicExpr(List args) @Override public ExprEval eval(final ObjectBinding bindings) { - final String s = NullHandling.nullToEmptyIfNeeded(args.get(0).eval(bindings).asString()); - final String pattern = NullHandling.nullToEmptyIfNeeded(args.get(1).eval(bindings).asString()); - final String replacement = NullHandling.nullToEmptyIfNeeded(args.get(2).eval(bindings).asString()); + final String s = args.get(0).eval(bindings).asString(); + final String pattern = args.get(1).eval(bindings).asString(); + final String replacement = args.get(2).eval(bindings).asString(); if (s == null || pattern == null || replacement == null) { return ExprEval.of(null); diff --git a/processing/src/main/java/org/apache/druid/query/extraction/FunctionalExtraction.java b/processing/src/main/java/org/apache/druid/query/extraction/FunctionalExtraction.java index ec58aa08ed77..4ecc0866fd2a 100644 --- a/processing/src/main/java/org/apache/druid/query/extraction/FunctionalExtraction.java +++ b/processing/src/main/java/org/apache/druid/query/extraction/FunctionalExtraction.java @@ -21,7 +21,6 @@ import com.google.common.base.Function; import com.google.common.base.Preconditions; -import org.apache.druid.common.config.NullHandling; import javax.annotation.Nullable; @@ -52,7 +51,7 @@ public FunctionalExtraction( ) { this.retainMissingValue = retainMissingValue; - this.replaceMissingValueWith = NullHandling.emptyToNullIfNeeded(replaceMissingValueWith); + this.replaceMissingValueWith = replaceMissingValueWith; Preconditions.checkArgument( !(this.retainMissingValue && !(this.replaceMissingValueWith == null)), "Cannot specify a [replaceMissingValueWith] and set [retainMissingValue] to true" @@ -69,7 +68,7 @@ public FunctionalExtraction( public String apply(@Nullable String dimValue) { final String retval = extractionFunction.apply(dimValue); - return NullHandling.isNullOrEquivalent(retval) ? NullHandling.emptyToNullIfNeeded(dimValue) : retval; + return retval == null ? dimValue : retval; } }; } else { @@ -79,7 +78,7 @@ public String apply(@Nullable String dimValue) @Override public String apply(@Nullable String dimValue) { - final String retval = NullHandling.emptyToNullIfNeeded(extractionFunction.apply(dimValue)); + final String retval = extractionFunction.apply(dimValue); return retval == null ? FunctionalExtraction.this.replaceMissingValueWith : retval; diff --git a/processing/src/main/java/org/apache/druid/query/extraction/IdentityExtractionFn.java b/processing/src/main/java/org/apache/druid/query/extraction/IdentityExtractionFn.java index 68ef7e3c0a20..d9408c0dc93e 100644 --- a/processing/src/main/java/org/apache/druid/query/extraction/IdentityExtractionFn.java +++ b/processing/src/main/java/org/apache/druid/query/extraction/IdentityExtractionFn.java @@ -19,8 +19,6 @@ package org.apache.druid.query.extraction; -import org.apache.druid.common.config.NullHandling; - import javax.annotation.Nullable; public class IdentityExtractionFn implements ExtractionFn @@ -42,14 +40,14 @@ public byte[] getCacheKey() @Nullable public String apply(@Nullable Object value) { - return value == null ? null : NullHandling.emptyToNullIfNeeded(value.toString()); + return value == null ? null : value.toString(); } @Override @Nullable public String apply(@Nullable String value) { - return NullHandling.emptyToNullIfNeeded(value); + return value; } @Override diff --git a/processing/src/main/java/org/apache/druid/query/extraction/JavaScriptExtractionFn.java b/processing/src/main/java/org/apache/druid/query/extraction/JavaScriptExtractionFn.java index ad73cff52f3a..949894dc9de8 100644 --- a/processing/src/main/java/org/apache/druid/query/extraction/JavaScriptExtractionFn.java +++ b/processing/src/main/java/org/apache/druid/query/extraction/JavaScriptExtractionFn.java @@ -24,7 +24,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Function; import com.google.common.base.Preconditions; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.js.JavaScriptConfig; import org.checkerframework.checker.nullness.qual.EnsuresNonNull; @@ -123,7 +122,7 @@ public byte[] getCacheKey() public String apply(@Nullable Object value) { Function fn = getCompiledScript(); - return NullHandling.emptyToNullIfNeeded(fn.apply(value)); + return fn.apply(value); } /** @@ -154,7 +153,7 @@ private Function getCompiledScript() @Nullable public String apply(@Nullable String value) { - return this.apply((Object) NullHandling.emptyToNullIfNeeded(value)); + return this.apply((Object) value); } @Override diff --git a/processing/src/main/java/org/apache/druid/query/extraction/LowerExtractionFn.java b/processing/src/main/java/org/apache/druid/query/extraction/LowerExtractionFn.java index 87789091ed71..3f37ebc6b5b8 100644 --- a/processing/src/main/java/org/apache/druid/query/extraction/LowerExtractionFn.java +++ b/processing/src/main/java/org/apache/druid/query/extraction/LowerExtractionFn.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeName; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import javax.annotation.Nullable; @@ -53,7 +52,7 @@ public LowerExtractionFn(@JsonProperty("locale") String localeString) @Override public String apply(@Nullable String key) { - if (NullHandling.isNullOrEquivalent(key)) { + if (key == null) { return null; } return key.toLowerCase(locale); diff --git a/processing/src/main/java/org/apache/druid/query/extraction/MapLookupExtractor.java b/processing/src/main/java/org/apache/druid/query/extraction/MapLookupExtractor.java index 763e5bc706ae..d2f22ee38ce8 100644 --- a/processing/src/main/java/org/apache/druid/query/extraction/MapLookupExtractor.java +++ b/processing/src/main/java/org/apache/druid/query/extraction/MapLookupExtractor.java @@ -26,7 +26,6 @@ import com.google.common.base.Strings; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Iterators; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.query.lookup.ImmutableLookupMap; import org.apache.druid.query.lookup.LookupExtractor; @@ -105,13 +104,10 @@ public Map getMap() @Override public String apply(@Nullable String key) { - String keyEquivalent = NullHandling.nullToEmptyIfNeeded(key); - if (keyEquivalent == null) { - // keyEquivalent is null only for SQL Compatible Null Behavior - // otherwise null will be replaced with empty string in nullToEmptyIfNeeded above. + if (key == null) { return null; } - return NullHandling.emptyToNullIfNeeded(map.get(keyEquivalent)); + return map.get(key); } @Override @@ -129,11 +125,11 @@ public Iterator unapplyAll(Set values) Iterators.filter( map.entrySet().iterator(), entry -> { - if (NullHandling.sqlCompatible() && entry.getKey() == null) { - // Null keys are omitted in SQL-compatible mode. + if (entry.getKey() == null) { + // Null keys are omitted. return false; } else { - return values.contains(NullHandling.emptyToNullIfNeeded(entry.getValue())); + return values.contains(entry.getValue()); } } ), diff --git a/processing/src/main/java/org/apache/druid/query/extraction/MatchingDimExtractionFn.java b/processing/src/main/java/org/apache/druid/query/extraction/MatchingDimExtractionFn.java index 4c1d2c2a118b..736a40b3c1d0 100644 --- a/processing/src/main/java/org/apache/druid/query/extraction/MatchingDimExtractionFn.java +++ b/processing/src/main/java/org/apache/druid/query/extraction/MatchingDimExtractionFn.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Preconditions; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import javax.annotation.Nullable; @@ -62,7 +61,7 @@ public byte[] getCacheKey() @Override public String apply(@Nullable String dimValue) { - if (NullHandling.isNullOrEquivalent(dimValue)) { + if (dimValue == null) { // We'd return null whether or not the pattern matched return null; } diff --git a/processing/src/main/java/org/apache/druid/query/extraction/RegexDimExtractionFn.java b/processing/src/main/java/org/apache/druid/query/extraction/RegexDimExtractionFn.java index e911340fe778..99c4aab35c2f 100644 --- a/processing/src/main/java/org/apache/druid/query/extraction/RegexDimExtractionFn.java +++ b/processing/src/main/java/org/apache/druid/query/extraction/RegexDimExtractionFn.java @@ -23,7 +23,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Preconditions; import com.google.common.primitives.Ints; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import javax.annotation.Nullable; @@ -106,14 +105,13 @@ public byte[] getCacheKey() public String apply(@Nullable String dimValue) { final String retVal; - String val = NullHandling.nullToEmptyIfNeeded(dimValue); - final Matcher matcher = val == null ? null : pattern.matcher(val); + final Matcher matcher = dimValue == null ? null : pattern.matcher(dimValue); if (matcher != null && matcher.find()) { retVal = matcher.group(index); } else { retVal = replaceMissingValue ? replaceMissingValueWith : dimValue; } - return NullHandling.emptyToNullIfNeeded(retVal); + return retVal; } @JsonProperty("expr") diff --git a/processing/src/main/java/org/apache/druid/query/extraction/SearchQuerySpecDimExtractionFn.java b/processing/src/main/java/org/apache/druid/query/extraction/SearchQuerySpecDimExtractionFn.java index e75103b2b30e..543cf78e85d2 100644 --- a/processing/src/main/java/org/apache/druid/query/extraction/SearchQuerySpecDimExtractionFn.java +++ b/processing/src/main/java/org/apache/druid/query/extraction/SearchQuerySpecDimExtractionFn.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Preconditions; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.search.SearchQuerySpec; import javax.annotation.Nullable; @@ -64,7 +63,7 @@ public byte[] getCacheKey() @Override public String apply(@Nullable String dimValue) { - return searchQuerySpec.accept(dimValue) ? NullHandling.emptyToNullIfNeeded(dimValue) : null; + return searchQuerySpec.accept(dimValue) ? dimValue : null; } @Override diff --git a/processing/src/main/java/org/apache/druid/query/extraction/StringFormatExtractionFn.java b/processing/src/main/java/org/apache/druid/query/extraction/StringFormatExtractionFn.java index 2e8bb77eed7a..5c965c179ac6 100644 --- a/processing/src/main/java/org/apache/druid/query/extraction/StringFormatExtractionFn.java +++ b/processing/src/main/java/org/apache/druid/query/extraction/StringFormatExtractionFn.java @@ -107,7 +107,7 @@ public String apply(@Nullable String value) value = ""; } } - return org.apache.druid.common.config.NullHandling.emptyToNullIfNeeded(StringUtils.format(format, value)); + return StringUtils.format(format, value); } @Override diff --git a/processing/src/main/java/org/apache/druid/query/extraction/StrlenExtractionFn.java b/processing/src/main/java/org/apache/druid/query/extraction/StrlenExtractionFn.java index 9f98f92355d5..78a1b0f2bcf3 100644 --- a/processing/src/main/java/org/apache/druid/query/extraction/StrlenExtractionFn.java +++ b/processing/src/main/java/org/apache/druid/query/extraction/StrlenExtractionFn.java @@ -20,7 +20,6 @@ package org.apache.druid.query.extraction; import com.fasterxml.jackson.annotation.JsonCreator; -import org.apache.druid.common.config.NullHandling; import javax.annotation.Nullable; @@ -42,10 +41,10 @@ public static StrlenExtractionFn instance() @Nullable public String apply(@Nullable String value) { - if (NullHandling.sqlCompatible() && value == null) { + if (value == null) { return null; } - return String.valueOf(value == null ? 0 : value.length()); + return String.valueOf(value.length()); } @Override diff --git a/processing/src/main/java/org/apache/druid/query/extraction/SubstringDimExtractionFn.java b/processing/src/main/java/org/apache/druid/query/extraction/SubstringDimExtractionFn.java index f8f80b2175df..7437ef9f4fab 100644 --- a/processing/src/main/java/org/apache/druid/query/extraction/SubstringDimExtractionFn.java +++ b/processing/src/main/java/org/apache/druid/query/extraction/SubstringDimExtractionFn.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Preconditions; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import javax.annotation.Nullable; @@ -63,7 +62,7 @@ public byte[] getCacheKey() @Override public String apply(@Nullable String dimValue) { - if (NullHandling.isNullOrEquivalent(dimValue)) { + if (dimValue == null) { return null; } diff --git a/processing/src/main/java/org/apache/druid/query/extraction/TimeDimExtractionFn.java b/processing/src/main/java/org/apache/druid/query/extraction/TimeDimExtractionFn.java index 1e82b3eb1ec0..97c8abacd3c1 100644 --- a/processing/src/main/java/org/apache/druid/query/extraction/TimeDimExtractionFn.java +++ b/processing/src/main/java/org/apache/druid/query/extraction/TimeDimExtractionFn.java @@ -23,7 +23,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Preconditions; import com.ibm.icu.text.SimpleDateFormat; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.StringUtils; import org.joda.time.DateTime; @@ -121,7 +120,7 @@ public byte[] getCacheKey() @Override public String apply(@Nullable String dimValue) { - if (NullHandling.isNullOrEquivalent(dimValue)) { + if (dimValue == null) { return null; } diff --git a/processing/src/main/java/org/apache/druid/query/extraction/UpperExtractionFn.java b/processing/src/main/java/org/apache/druid/query/extraction/UpperExtractionFn.java index 40f22b1756e8..33b55edd8f03 100644 --- a/processing/src/main/java/org/apache/druid/query/extraction/UpperExtractionFn.java +++ b/processing/src/main/java/org/apache/druid/query/extraction/UpperExtractionFn.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeName; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import javax.annotation.Nullable; @@ -52,7 +51,7 @@ public UpperExtractionFn(@JsonProperty("locale") String localeString) @Override public String apply(@Nullable String key) { - if (NullHandling.isNullOrEquivalent(key)) { + if (key == null) { return null; } return key.toUpperCase(locale); diff --git a/processing/src/main/java/org/apache/druid/query/filter/DimFilter.java b/processing/src/main/java/org/apache/druid/query/filter/DimFilter.java index bcd0c514a00c..db1f0ecd7fa9 100644 --- a/processing/src/main/java/org/apache/druid/query/filter/DimFilter.java +++ b/processing/src/main/java/org/apache/druid/query/filter/DimFilter.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.google.common.collect.RangeSet; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.Cacheable; import org.apache.druid.query.extraction.ExtractionFn; import org.apache.druid.segment.CursorBuildSpec; @@ -65,7 +64,6 @@ public interface DimFilter extends Cacheable * Returns an optimized version of this filter. * * @param mayIncludeUnknown whether the optimized filter may need to operate in "includeUnknown" mode. - * See {@link NullHandling#useThreeValueLogic()}. */ DimFilter optimize(boolean mayIncludeUnknown); @@ -81,7 +79,6 @@ public interface DimFilter extends Cacheable * for an example} * * @param mayIncludeUnknown whether the optimized filter may need to operate in "includeUnknown" mode. - * See {@link NullHandling#useThreeValueLogic()}. */ Filter toOptimizedFilter(boolean mayIncludeUnknown); diff --git a/processing/src/main/java/org/apache/druid/query/filter/Filter.java b/processing/src/main/java/org/apache/druid/query/filter/Filter.java index 147406b2261b..e406380cfc35 100644 --- a/processing/src/main/java/org/apache/druid/query/filter/Filter.java +++ b/processing/src/main/java/org/apache/druid/query/filter/Filter.java @@ -21,7 +21,6 @@ import org.apache.druid.annotations.SubclassesMustOverrideEqualsAndHashCode; import org.apache.druid.collections.bitmap.ImmutableBitmap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.UOE; import org.apache.druid.query.BitmapResultFactory; import org.apache.druid.query.filter.vector.VectorValueMatcher; @@ -60,7 +59,6 @@ public interface Filter * @param includeUnknown mapping for Druid native two state logic system into SQL three-state logic system. If * set to true, bitmaps returned by this method should include true bits for any rows * where the matching result is 'unknown', such as from the input being null valued. - * See {@link NullHandling#useThreeValueLogic()} * @param type of {@link BitmapResultFactory} results, {@link ImmutableBitmap} by default * @return {@link FilterBundle} containing any indexes and/or matchers that are needed to build * a cursor diff --git a/processing/src/main/java/org/apache/druid/query/filter/InDimFilter.java b/processing/src/main/java/org/apache/druid/query/filter/InDimFilter.java index d678f4b53f12..67eb8f01e9fa 100644 --- a/processing/src/main/java/org/apache/druid/query/filter/InDimFilter.java +++ b/processing/src/main/java/org/apache/druid/query/filter/InDimFilter.java @@ -42,7 +42,6 @@ import it.unimi.dsi.fastutil.ints.IntOpenHashSet; import it.unimi.dsi.fastutil.longs.LongArrayList; import it.unimi.dsi.fastutil.longs.LongOpenHashSet; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.IAE; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.java.util.common.guava.Comparators; @@ -86,9 +85,7 @@ public class InDimFilter extends AbstractOptimizableDimFilter implements Filter { /** - * Values matched by this filter. Values are sorted (nulls-first). Values can contain `null` in SQL-compatible null - * handling mode. When {@link NullHandling#replaceWithDefault()}, the values set does not contain empty string. - * (It may contain null.) + * Values matched by this filter. Values are sorted (nulls-first). */ private final ValuesSet values; // Computed eagerly, not lazily, because lazy computations would block all processing threads for a given query. @@ -277,14 +274,13 @@ public RangeSet getDimensionRangeSet(String dimension) } RangeSet retSet = TreeRangeSet.create(); for (String value : values) { - String valueEquivalent = NullHandling.nullToEmptyIfNeeded(value); - if (valueEquivalent == null) { + if (value == null) { // Case when SQL compatible null handling is enabled // Range.singleton(null) is invalid, so use the fact that // only null values are less than empty string. retSet.add(Range.lessThan("")); } else { - retSet.add(Range.singleton(valueEquivalent)); + retSet.add(Range.singleton(value)); } } return retSet; @@ -473,7 +469,7 @@ public static ValuesSet optimizeLookup(final InDimFilter inFilter, final boolean if (!exFn.isInjective() && !exFn.isRetainMissingValue() - && inFilter.values.contains(NullHandling.emptyToNullIfNeeded(exFn.getReplaceMissingValueWith()))) { + && inFilter.values.contains(exFn.getReplaceMissingValueWith())) { // We cannot do an unapply()-based optimization when the original filter is configured to match on values that are // not present in the lookup key set. This would require creating a filter like "NOT IN (lookup key set)", which // we aren't willing to do, since it requires iterating the entire lookup and may be prohibitively large. @@ -492,7 +488,7 @@ public static ValuesSet optimizeLookup(final InDimFilter inFilter, final boolean boolean ok = false; - if (!NullHandling.isNullOrEquivalent(exFn.getReplaceMissingValueWith()) || exFn.isInjective()) { + if (exFn.getReplaceMissingValueWith() != null || exFn.isInjective()) { final Iterator keysWithNullValues = lookup.unapplyAll(Collections.singleton(null)); if (keysWithNullValues != null) { if (!keysWithNullValues.hasNext()) { @@ -512,7 +508,7 @@ public static ValuesSet optimizeLookup(final InDimFilter inFilter, final boolean } final Set valuesToUnapply; - if (!NullHandling.isNullOrEquivalent(exFn.getReplaceMissingValueWith()) + if (exFn.getReplaceMissingValueWith() != null && inFilter.values.contains(exFn.getReplaceMissingValueWith())) { // When matching against replaceMissingValueWith, this filter matches null values. valuesToUnapply = Sets.union(inFilter.values, Collections.singleton(null)); @@ -534,10 +530,9 @@ public static ValuesSet optimizeLookup(final InDimFilter inFilter, final boolean } } - // In SQL-compatible null handling mode, lookup of null is always "replaceMissingValueWith", regardless of contents - // of the lookup. So, if we're matching against "replaceMissingValueWith", we need to include null in the - // unapplied set. - if (NullHandling.sqlCompatible() && inFilter.values.contains(exFn.getReplaceMissingValueWith())) { + // lookup of null is always "replaceMissingValueWith", regardless of contents of the lookup. So, if we're matching + // against "replaceMissingValueWith", we need to include null in the unapplied set. + if (inFilter.values.contains(exFn.getReplaceMissingValueWith())) { unapplied.add(null); } @@ -547,7 +542,7 @@ public static ValuesSet optimizeLookup(final InDimFilter inFilter, final boolean // If the selector value is overwritten in the lookup map, don't add selector value to keys. if (exFn.isRetainMissingValue()) { for (final String value : inFilter.values) { - if (NullHandling.isNullOrEquivalent(lookup.apply(NullHandling.emptyToNullIfNeeded(value)))) { + if (lookup.apply(value) == null) { unapplied.add(value); } } @@ -756,20 +751,16 @@ public ValuesSet() /** * Create a ValuesSet from another Collection. The Collection will be reused if it is a {@link SortedSet} with - * the {@link Comparators#naturalNullsFirst()} comparator, and doesn't contain empty string in - * {@link NullHandling#replaceWithDefault()} mode. + * the {@link Comparators#naturalNullsFirst()} comparator. */ private ValuesSet(final Collection values) { if (values instanceof SortedSet - && Comparators.naturalNullsFirst().equals(((SortedSet) values).comparator()) - && !(NullHandling.replaceWithDefault() && values.contains(""))) { + && Comparators.naturalNullsFirst().equals(((SortedSet) values).comparator())) { this.values = (SortedSet) values; } else { this.values = new TreeSet<>(Comparators.naturalNullsFirst()); - for (String value : values) { - this.values.add(NullHandling.emptyToNullIfNeeded(value)); - } + this.values.addAll(values); } } @@ -782,26 +773,25 @@ public static ValuesSet create() } /** - * Creates a ValuesSet wrapping the provided single value, with {@link NullHandling#emptyToNullIfNeeded(String)} - * applied. + * Creates a ValuesSet wrapping the provided single value. * * @throws IllegalStateException if the provided collection cannot be wrapped since it has the wrong comparator */ public static ValuesSet of(@Nullable final String value) { final ValuesSet retVal = ValuesSet.create(); - retVal.add(NullHandling.emptyToNullIfNeeded(value)); + retVal.add(value); return retVal; } /** - * Creates a ValuesSet copying the provided iterator, with {@link NullHandling#emptyToNullIfNeeded(String)} applied. + * Creates a ValuesSet copying the provided iterator. */ public static ValuesSet copyOf(final Iterator values) { final TreeSet copyOfValues = new TreeSet<>(Comparators.naturalNullsFirst()); while (values.hasNext()) { - copyOfValues.add(NullHandling.emptyToNullIfNeeded(values.next())); + copyOfValues.add(values.next()); } return new ValuesSet(copyOfValues); } @@ -832,8 +822,7 @@ public List toUtf8() @Override public boolean add(String s) { - // In non-SQL-compatible mode, empty strings must be converted to nulls for the filter. - return delegate().add(NullHandling.emptyToNullIfNeeded(s)); + return delegate().add(s); } @Override diff --git a/processing/src/main/java/org/apache/druid/query/filter/LikeDimFilter.java b/processing/src/main/java/org/apache/druid/query/filter/LikeDimFilter.java index be759f2009c2..b5f67595ffa4 100644 --- a/processing/src/main/java/org/apache/druid/query/filter/LikeDimFilter.java +++ b/processing/src/main/java/org/apache/druid/query/filter/LikeDimFilter.java @@ -28,7 +28,6 @@ import com.google.common.collect.RangeSet; import com.google.common.io.BaseEncoding; import com.google.common.primitives.Chars; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.query.extraction.ExtractionFn; import org.apache.druid.segment.filter.LikeFilter; @@ -230,7 +229,7 @@ private LikeMatcher( { this.likePattern = likePattern; this.suffixMatch = Preconditions.checkNotNull(suffixMatch, "suffixMatch"); - this.prefix = NullHandling.nullToEmptyIfNeeded(prefix); + this.prefix = prefix; this.pattern = Preconditions.checkNotNull(pattern, "pattern"); } @@ -303,20 +302,19 @@ public DruidPredicateMatch matches(@Nullable final String s) private static DruidPredicateMatch matches(@Nullable final String s, List pattern) { - String val = NullHandling.nullToEmptyIfNeeded(s); - if (val == null) { + if (s == null) { return DruidPredicateMatch.UNKNOWN; } if (pattern.size() == 1) { // Most common case is a single pattern: a% => ^a, %z => z$, %m% => m - return DruidPredicateMatch.of(pattern.get(0).matcher(val).find()); + return DruidPredicateMatch.of(pattern.get(0).matcher(s).find()); } int offset = 0; for (Pattern part : pattern) { - Matcher matcher = part.matcher(val); + Matcher matcher = part.matcher(s); if (!matcher.find(offset)) { return DruidPredicateMatch.FALSE; diff --git a/processing/src/main/java/org/apache/druid/query/filter/NotDimFilter.java b/processing/src/main/java/org/apache/druid/query/filter/NotDimFilter.java index 8314e71308f2..67f96221d3d1 100644 --- a/processing/src/main/java/org/apache/druid/query/filter/NotDimFilter.java +++ b/processing/src/main/java/org/apache/druid/query/filter/NotDimFilter.java @@ -24,7 +24,6 @@ import com.google.common.base.Preconditions; import com.google.common.collect.Lists; import com.google.common.collect.RangeSet; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.segment.filter.NotFilter; import java.nio.ByteBuffer; @@ -70,7 +69,7 @@ public byte[] getCacheKey() @Override public DimFilter optimize(final boolean mayIncludeUnknown) { - final DimFilter optimized = this.getField().optimize(!mayIncludeUnknown && NullHandling.useThreeValueLogic()); + final DimFilter optimized = this.getField().optimize(!mayIncludeUnknown); if (optimized == FalseDimFilter.instance()) { return TrueDimFilter.instance(); } else if (optimized == TrueDimFilter.instance()) { diff --git a/processing/src/main/java/org/apache/druid/query/filter/SelectorDimFilter.java b/processing/src/main/java/org/apache/druid/query/filter/SelectorDimFilter.java index 019862e5014a..afb25d7e370c 100644 --- a/processing/src/main/java/org/apache/druid/query/filter/SelectorDimFilter.java +++ b/processing/src/main/java/org/apache/druid/query/filter/SelectorDimFilter.java @@ -64,7 +64,7 @@ public SelectorDimFilter( Preconditions.checkArgument(dimension != null, "dimension must not be null"); this.dimension = dimension; - this.value = NullHandling.emptyToNullIfNeeded(value); + this.value = value; this.extractionFn = extractionFn; this.filterTuning = filterTuning; @@ -180,13 +180,12 @@ public RangeSet getDimensionRangeSet(String dimension) return null; } RangeSet retSet = TreeRangeSet.create(); - String valueEquivalent = NullHandling.nullToEmptyIfNeeded(value); - if (valueEquivalent == null) { + if (value == null) { // Case when SQL compatible null handling is enabled // Nulls are less than empty String in segments retSet.add(Range.lessThan("")); } else { - retSet.add(Range.singleton(valueEquivalent)); + retSet.add(Range.singleton(value)); } return retSet; } diff --git a/processing/src/main/java/org/apache/druid/query/filter/TypedInFilter.java b/processing/src/main/java/org/apache/druid/query/filter/TypedInFilter.java index 1230b5221115..247c0dcaada2 100644 --- a/processing/src/main/java/org/apache/druid/query/filter/TypedInFilter.java +++ b/processing/src/main/java/org/apache/druid/query/filter/TypedInFilter.java @@ -43,7 +43,6 @@ import it.unimi.dsi.fastutil.longs.LongOpenHashSet; import it.unimi.dsi.fastutil.longs.LongSet; import it.unimi.dsi.fastutil.objects.ObjectArrays; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.guava.GuavaUtils; import org.apache.druid.error.InvalidInput; import org.apache.druid.java.util.common.IAE; @@ -229,9 +228,6 @@ public byte[] getCacheKey() @Override public DimFilter optimize(final boolean mayIncludeUnknown) { - if (NullHandling.replaceWithDefault()) { - return convertToLegacy().optimize(mayIncludeUnknown); - } final List matchValues = this.sortedMatchValues.get(); if (matchValues.isEmpty()) { return FalseDimFilter.instance(); @@ -252,9 +248,6 @@ public DimFilter optimize(final boolean mayIncludeUnknown) @Override public Filter toFilter() { - if (NullHandling.replaceWithDefault()) { - return convertToLegacy().toFilter(); - } return this; } diff --git a/processing/src/main/java/org/apache/druid/query/filter/ValueMatcher.java b/processing/src/main/java/org/apache/druid/query/filter/ValueMatcher.java index 6248d1e82bc8..2b2aa628ae87 100644 --- a/processing/src/main/java/org/apache/druid/query/filter/ValueMatcher.java +++ b/processing/src/main/java/org/apache/druid/query/filter/ValueMatcher.java @@ -19,7 +19,6 @@ package org.apache.druid.query.filter; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.monomorphicprocessing.CalledFromHotLoop; import org.apache.druid.query.monomorphicprocessing.HotLoopCallee; @@ -37,7 +36,7 @@ public interface ValueMatcher extends HotLoopCallee * * @param includeUnknown mapping for Druid native two state logic system into SQL three-state logic system. If set * to true, this method should also return true if the matching result is 'unknown', such - * as from the input being null valued. See {@link NullHandling#useThreeValueLogic()}. + * as from the input being null valued.. * * @return true if the current row matches the condition, or is unknown and {@code includeUnknown} is set to true */ diff --git a/processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java b/processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java index 435d718d906f..d18eaf337bd5 100644 --- a/processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java +++ b/processing/src/main/java/org/apache/druid/query/filter/vector/MultiValueStringVectorValueMatcher.java @@ -19,7 +19,6 @@ package org.apache.druid.query.filter.vector; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.math.expr.ExprEval; import org.apache.druid.math.expr.ExpressionType; import org.apache.druid.query.filter.DruidObjectPredicate; @@ -44,14 +43,13 @@ public MultiValueStringVectorValueMatcher(final MultiValueDimensionVectorSelecto @Override public VectorValueMatcher makeMatcher(@Nullable final String value) { - final String etnValue = NullHandling.emptyToNullIfNeeded(value); final IdLookup idLookup = selector.idLookup(); final int id; if (idLookup != null) { // Optimization when names can be looked up to IDs ahead of time. - id = idLookup.lookupId(etnValue); - final boolean hasNull = NullHandling.isNullOrEquivalent(selector.lookupName(0)); + id = idLookup.lookupId(value); + final boolean hasNull = selector.lookupName(0) == null; if (id < 0) { // Value doesn't exist in this column. @@ -78,7 +76,7 @@ public ReadableVectorMatch match(final ReadableVectorMatch mask, boolean include if (n == 0) { // null should match empty rows in multi-value columns - if (etnValue == null || includeUnknown) { + if (value == null || includeUnknown) { selection[numRows++] = rowNum; } } else { @@ -97,7 +95,7 @@ public ReadableVectorMatch match(final ReadableVectorMatch mask, boolean include } }; } else { - return makeMatcher(etnValue == null ? DruidObjectPredicate.isNull() : DruidObjectPredicate.equalTo(etnValue)); + return makeMatcher(value == null ? DruidObjectPredicate.isNull() : DruidObjectPredicate.equalTo(value)); } } diff --git a/processing/src/main/java/org/apache/druid/query/filter/vector/SingleValueStringVectorValueMatcher.java b/processing/src/main/java/org/apache/druid/query/filter/vector/SingleValueStringVectorValueMatcher.java index 51db2cbcb59c..a51bd78f9dbf 100644 --- a/processing/src/main/java/org/apache/druid/query/filter/vector/SingleValueStringVectorValueMatcher.java +++ b/processing/src/main/java/org/apache/druid/query/filter/vector/SingleValueStringVectorValueMatcher.java @@ -19,7 +19,6 @@ package org.apache.druid.query.filter.vector; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.math.expr.ExprEval; import org.apache.druid.math.expr.ExpressionType; import org.apache.druid.query.filter.DruidObjectPredicate; @@ -45,12 +44,10 @@ public SingleValueStringVectorValueMatcher(final SingleValueDimensionVectorSelec @Override public VectorValueMatcher makeMatcher(@Nullable final String value) { - final String etnValue = NullHandling.emptyToNullIfNeeded(value); - final ConstantMatcherType constantMatcherType = ValueMatchers.toConstantMatcherTypeIfPossible( selector, false, - etnValue == null ? DruidObjectPredicate.isNull() : DruidObjectPredicate.equalTo(etnValue) + value == null ? DruidObjectPredicate.isNull() : DruidObjectPredicate.equalTo(value) ); if (constantMatcherType != null) { return constantMatcherType.asVectorMatcher(selector); @@ -61,13 +58,13 @@ public VectorValueMatcher makeMatcher(@Nullable final String value) if (idLookup != null) { // Optimization when names can be looked up to IDs ahead of time. - id = idLookup.lookupId(etnValue); + id = idLookup.lookupId(value); if (id < 0) { // Value doesn't exist in this column. return VectorValueMatcher.allFalseSingleValueDimensionMatcher(selector); } - final boolean hasNull = NullHandling.isNullOrEquivalent(selector.lookupName(0)); + final boolean hasNull = selector.lookupName(0) == null; // Check for "id". return new BaseVectorValueMatcher(selector) @@ -95,7 +92,7 @@ public ReadableVectorMatch match(final ReadableVectorMatch mask, boolean include } }; } else { - return makeMatcher(DruidObjectPredicate.equalTo(etnValue)); + return makeMatcher(DruidObjectPredicate.equalTo(value)); } } diff --git a/processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java b/processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java index fa193fa1bd2e..9a2812f59135 100644 --- a/processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java +++ b/processing/src/main/java/org/apache/druid/query/filter/vector/VectorValueMatcher.java @@ -19,7 +19,6 @@ package org.apache.druid.query.filter.vector; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.filter.Filter; import org.apache.druid.segment.IdLookup; import org.apache.druid.segment.data.IndexedInts; @@ -50,7 +49,6 @@ public interface VectorValueMatcher extends VectorSizeInspector * @param includeUnknown mapping for Druid native two state logic system into SQL three-state logic system. If set * to true, match vectors returned by this method should include true values wherever the * matching result is 'unknown', such as from the input being null valued. - * See {@link NullHandling#useThreeValueLogic()}. * * @return the subset of "mask" that this value matcher accepts. May be the same instance as {@param mask} if * every row in the mask matches the filter. @@ -104,7 +102,7 @@ public ReadableVectorMatch match(ReadableVectorMatch mask, boolean includeUnknow for (int i = 0; i < inputSelectionSize; i++) { final int rowNum = inputSelection[i]; - if (NullHandling.isNullOrEquivalent(selector.lookupName(vector[rowNum]))) { + if (selector.lookupName(vector[rowNum]) == null) { outputSelection[outputSelectionSize++] = rowNum; } } @@ -180,7 +178,7 @@ public ReadableVectorMatch match(ReadableVectorMatch mask, boolean includeUnknow } else { final int size = row.size(); for (int j = 0; j < size; j++) { - if (NullHandling.isNullOrEquivalent(selector.lookupName(row.get(j)))) { + if (selector.lookupName(row.get(j)) == null) { selection[numRows++] = rowNum; break; } diff --git a/processing/src/main/java/org/apache/druid/query/groupby/GroupingEngine.java b/processing/src/main/java/org/apache/druid/query/groupby/GroupingEngine.java index 5dc995b55386..acb07c2298fd 100644 --- a/processing/src/main/java/org/apache/druid/query/groupby/GroupingEngine.java +++ b/processing/src/main/java/org/apache/druid/query/groupby/GroupingEngine.java @@ -32,7 +32,6 @@ import org.apache.druid.collections.NonBlockingPool; import org.apache.druid.collections.ReferenceCountingResourceHolder; import org.apache.druid.collections.ResourceHolder; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.guice.annotations.Json; import org.apache.druid.guice.annotations.Merging; import org.apache.druid.guice.annotations.Smile; @@ -501,9 +500,7 @@ public Sequence process( Closer closer = Closer.create(); closer.register(bufferHolder); try { - final String fudgeTimestampString = NullHandling.emptyToNullIfNeeded( - query.context().getString(GroupingEngine.CTX_KEY_FUDGE_TIMESTAMP) - ); + final String fudgeTimestampString = query.context().getString(GroupingEngine.CTX_KEY_FUDGE_TIMESTAMP); final DateTime fudgeTimestamp = fudgeTimestampString == null ? null diff --git a/processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/GroupByQueryEngine.java b/processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/GroupByQueryEngine.java index 35d958f7ad1f..0e17cc4572db 100644 --- a/processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/GroupByQueryEngine.java +++ b/processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/GroupByQueryEngine.java @@ -23,7 +23,6 @@ import com.google.common.base.Preconditions; import com.google.common.base.Suppliers; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.IAE; import org.apache.druid.java.util.common.ISE; import org.apache.druid.java.util.common.granularity.Granularities; @@ -837,7 +836,7 @@ protected void putToRow(IntKey key, ResultRow resultRow) if (intKey != GroupByColumnSelectorStrategy.GROUP_BY_MISSING_VALUE) { resultRow.set(dim.getResultRowPosition(), ((DimensionSelector) dim.getSelector()).lookupName(intKey)); } else { - resultRow.set(dim.getResultRowPosition(), NullHandling.defaultStringValue()); + resultRow.set(dim.getResultRowPosition(), null); } } } diff --git a/processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/RowBasedGrouperHelper.java b/processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/RowBasedGrouperHelper.java index 96e4e9d24380..0f64988ddf2e 100644 --- a/processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/RowBasedGrouperHelper.java +++ b/processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/RowBasedGrouperHelper.java @@ -644,10 +644,7 @@ public static CloseableGrouperIterator makeGrouperIterat for (int i = resultRowDimensionStart; i < entry.getKey().getKey().length; i++) { if (dimsToInclude == null || dimsToIncludeBitSet.get(i - resultRowDimensionStart)) { final Object dimVal = entry.getKey().getKey()[i]; - resultRow.set( - i, - dimVal instanceof String ? NullHandling.emptyToNullIfNeeded((String) dimVal) : dimVal - ); + resultRow.set(i, dimVal); } } @@ -1571,19 +1568,15 @@ private RowBasedKeySerdeHelper makeNullHandlingNumericSerdeHelper( @Nullable StringComparator stringComparator ) { - if (NullHandling.sqlCompatible()) { - return new NullableRowBasedKeySerdeHelper( - makeNumericSerdeHelper( - valueType, - keyBufferPosition + Byte.BYTES, - pushLimitDown, - stringComparator - ), - keyBufferPosition - ); - } else { - return makeNumericSerdeHelper(valueType, keyBufferPosition, pushLimitDown, stringComparator); - } + return new NullableRowBasedKeySerdeHelper( + makeNumericSerdeHelper( + valueType, + keyBufferPosition + Byte.BYTES, + pushLimitDown, + stringComparator + ), + keyBufferPosition + ); } private RowBasedKeySerdeHelper makeNumericSerdeHelper( diff --git a/processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/column/KeyMappingMultiValueGroupByColumnSelectorStrategy.java b/processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/column/KeyMappingMultiValueGroupByColumnSelectorStrategy.java index aac9f2f14e7a..0b5882b0f304 100644 --- a/processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/column/KeyMappingMultiValueGroupByColumnSelectorStrategy.java +++ b/processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/column/KeyMappingMultiValueGroupByColumnSelectorStrategy.java @@ -21,7 +21,6 @@ import com.google.common.base.Preconditions; import it.unimi.dsi.fastutil.objects.Object2IntMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.groupby.ResultRow; import org.apache.druid.query.groupby.epinephelinae.DictionaryBuildingUtils; import org.apache.druid.query.groupby.epinephelinae.Grouper; @@ -136,7 +135,7 @@ public void processValueFromGroupingKey( ); } else { // Since this is used for String dimensions only, we can directly put the default string value here - resultRow.set(selectorPlus.getResultRowPosition(), NullHandling.defaultStringValue()); + resultRow.set(selectorPlus.getResultRowPosition(), null); } } @@ -218,7 +217,7 @@ public void processValueFromGroupingKey( final String value = dictionary.get(id); resultRow.set(selectorPlus.getResultRowPosition(), value); } else { - resultRow.set(selectorPlus.getResultRowPosition(), NullHandling.defaultStringValue()); + resultRow.set(selectorPlus.getResultRowPosition(), null); } } diff --git a/processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/DictionaryBuildingSingleValueStringGroupByVectorColumnSelector.java b/processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/DictionaryBuildingSingleValueStringGroupByVectorColumnSelector.java index 393c7173ebb4..0c4640c85f92 100644 --- a/processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/DictionaryBuildingSingleValueStringGroupByVectorColumnSelector.java +++ b/processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/DictionaryBuildingSingleValueStringGroupByVectorColumnSelector.java @@ -21,7 +21,6 @@ import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; import org.apache.datasketches.memory.WritableMemory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.groupby.ResultRow; import org.apache.druid.query.groupby.epinephelinae.DictionaryBuildingUtils; import org.apache.druid.query.groupby.epinephelinae.collection.MemoryPointer; @@ -106,7 +105,7 @@ public void writeKeyToResultRow( final String value = dictionary.get(id); resultRow.set(resultRowPosition, value); } else { - resultRow.set(resultRowPosition, NullHandling.defaultStringValue()); + resultRow.set(resultRowPosition, null); } } diff --git a/processing/src/main/java/org/apache/druid/query/groupby/orderby/DefaultLimitSpec.java b/processing/src/main/java/org/apache/druid/query/groupby/orderby/DefaultLimitSpec.java index db7a8f1f02d4..0c04839c3d2c 100644 --- a/processing/src/main/java/org/apache/druid/query/groupby/orderby/DefaultLimitSpec.java +++ b/processing/src/main/java/org/apache/druid/query/groupby/orderby/DefaultLimitSpec.java @@ -30,7 +30,6 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Ordering; import com.google.common.primitives.Longs; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.Rows; import org.apache.druid.java.util.common.ISE; import org.apache.druid.java.util.common.granularity.Granularities; @@ -425,9 +424,7 @@ private Ordering metricOrdering(final int column, final Comparato { // As per SQL standard we need to have same ordering for metrics as dimensions i.e nulls first // If SQL compatibility is not enabled we use nullsLast ordering for null metrics for backwards compatibility. - final Comparator nullFriendlyComparator = NullHandling.sqlCompatible() - ? Comparator.nullsFirst(comparator) - : Comparator.nullsLast(comparator); + final Comparator nullFriendlyComparator = Comparator.nullsFirst(comparator); //noinspection unchecked return Ordering.from(Comparator.comparing(row -> (T) row.get(column), nullFriendlyComparator)); diff --git a/processing/src/main/java/org/apache/druid/query/lookup/ImmutableLookupMap.java b/processing/src/main/java/org/apache/druid/query/lookup/ImmutableLookupMap.java index 520f3d55521b..0c737d5c4b3a 100644 --- a/processing/src/main/java/org/apache/druid/query/lookup/ImmutableLookupMap.java +++ b/processing/src/main/java/org/apache/druid/query/lookup/ImmutableLookupMap.java @@ -24,7 +24,6 @@ import com.google.common.collect.Maps; import it.unimi.dsi.fastutil.objects.Object2IntMap; import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.Pair; import org.apache.druid.java.util.common.guava.Comparators; import org.apache.druid.query.extraction.MapLookupExtractor; @@ -147,38 +146,22 @@ private ImmutableLookupExtractor(final boolean isOneToOne, final Supplier unapply(@Nullable String value) { - final List unapplied = unapplyInternal(value, !NullHandling.sqlCompatible()); - - if (NullHandling.replaceWithDefault() && value == null) { - // Also check empty string, if the value was null. - final List emptyStringUnapplied = unapplyInternal("", true); - if (!emptyStringUnapplied.isEmpty()) { - final List combined = new ArrayList<>(unapplied.size() + emptyStringUnapplied.size()); - combined.addAll(unapplied); - combined.addAll(emptyStringUnapplied); - return combined; - } - } - - return unapplied; + return unapplyInternal(value, false); } @Override diff --git a/processing/src/main/java/org/apache/druid/query/lookup/LookupExtractor.java b/processing/src/main/java/org/apache/druid/query/lookup/LookupExtractor.java index 183007c41a4b..accda06b4f0f 100644 --- a/processing/src/main/java/org/apache/druid/query/lookup/LookupExtractor.java +++ b/processing/src/main/java/org/apache/druid/query/lookup/LookupExtractor.java @@ -23,7 +23,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.google.common.collect.Iterators; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.extraction.MapLookupExtractor; import javax.annotation.Nullable; @@ -45,8 +44,8 @@ public abstract class LookupExtractor * * @param key The value to apply the lookup to. * - * @return The value for this key, or null when key is `null` in {@link NullHandling#sqlCompatible()} mode, or when - * key cannot have the lookup applied to it and should be treated as missing. + * @return The value for this key, or null when key is `null` or when key cannot have the lookup applied to it and + * should be treated as missing. */ @Nullable public abstract String apply(@Nullable String key); @@ -76,8 +75,7 @@ public Map applyAll(Iterable keys) * Otherwise unused. Implementations that override {@link #unapplyAll(Set)} may throw * {@link UnsupportedOperationException} from this method. * - * @param value the value to apply the reverse lookup. {@link NullHandling#emptyToNullIfNeeded(String)} will have - * been applied to the value. + * @param value the value to apply the reverse lookup. * * @return the list of keys that maps to the provided value. In SQL-compatible null handling mode, null keys * are omitted. @@ -87,8 +85,7 @@ public Map applyAll(Iterable keys) /** * Reverse lookup from a given set of values. * - * @param values set of values to reverse lookup. {@link NullHandling#emptyToNullIfNeeded(String)} will have - * been applied to each value. + * @param values set of values to reverse lookup. * * @return iterator of keys that map to to the provided set of values. May contain duplicate keys. Returns null if * this lookup instance does not support reverse lookups. In SQL-compatible null handling mode, null keys are diff --git a/processing/src/main/java/org/apache/druid/query/metadata/SegmentAnalyzer.java b/processing/src/main/java/org/apache/druid/query/metadata/SegmentAnalyzer.java index d0015ba80277..82d10a5a9447 100644 --- a/processing/src/main/java/org/apache/druid/query/metadata/SegmentAnalyzer.java +++ b/processing/src/main/java/org/apache/druid/query/metadata/SegmentAnalyzer.java @@ -21,7 +21,6 @@ import com.google.common.base.Function; import com.google.common.base.Preconditions; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.java.util.common.logger.Logger; import org.apache.druid.query.dimension.DefaultDimensionSpec; @@ -218,8 +217,8 @@ private ColumnAnalysis analyzeStringColumn( } } if (analyzingMinMax() && cardinality > 0) { - min = NullHandling.nullToEmptyIfNeeded(valueIndex.getValue(0)); - max = NullHandling.nullToEmptyIfNeeded(valueIndex.getValue(cardinality - 1)); + min = valueIndex.getValue(0); + max = valueIndex.getValue(cardinality - 1); } } else if (capabilities.isDictionaryEncoded().isTrue()) { // fallback if no bitmap index @@ -228,8 +227,8 @@ private ColumnAnalysis analyzeStringColumn( DictionaryEncodedColumn theColumn = (DictionaryEncodedColumn) column; cardinality = theColumn.getCardinality(); if (analyzingMinMax() && cardinality > 0) { - min = NullHandling.nullToEmptyIfNeeded(theColumn.lookupName(0)); - max = NullHandling.nullToEmptyIfNeeded(theColumn.lookupName(cardinality - 1)); + min = theColumn.lookupName(0); + max = theColumn.lookupName(cardinality - 1); } } else { cardinality = 0; diff --git a/processing/src/main/java/org/apache/druid/query/metadata/metadata/ColumnAnalysis.java b/processing/src/main/java/org/apache/druid/query/metadata/metadata/ColumnAnalysis.java index 131920177d38..9e09292464c6 100644 --- a/processing/src/main/java/org/apache/druid/query/metadata/metadata/ColumnAnalysis.java +++ b/processing/src/main/java/org/apache/druid/query/metadata/metadata/ColumnAnalysis.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.segment.column.ColumnCapabilities; import org.apache.druid.segment.column.ColumnType; @@ -187,11 +186,6 @@ public ColumnAnalysis fold(ColumnAnalysis rhs) Comparable newMin = choose(minValue, rhs.minValue, false); Comparable newMax = choose(maxValue, rhs.maxValue, true); - // min and max are currently set for only string columns - if (typeSignature.equals(ColumnType.STRING)) { - newMin = NullHandling.nullToEmptyIfNeeded((String) newMin); - newMax = NullHandling.nullToEmptyIfNeeded((String) newMax); - } return builder().withType(typeSignature) .withTypeName(type) .hasMultipleValues(multipleValues) diff --git a/processing/src/main/java/org/apache/druid/query/search/SearchHit.java b/processing/src/main/java/org/apache/druid/query/search/SearchHit.java index 643ee883a4d1..91bc48d9b784 100644 --- a/processing/src/main/java/org/apache/druid/query/search/SearchHit.java +++ b/processing/src/main/java/org/apache/druid/query/search/SearchHit.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Preconditions; -import org.apache.druid.common.config.NullHandling; /** */ @@ -40,7 +39,7 @@ public SearchHit( ) { this.dimension = Preconditions.checkNotNull(dimension); - this.value = NullHandling.nullToEmptyIfNeeded(value); + this.value = value; this.count = count; } diff --git a/processing/src/main/java/org/apache/druid/query/topn/types/NullableNumericTopNColumnAggregatesProcessor.java b/processing/src/main/java/org/apache/druid/query/topn/types/NullableNumericTopNColumnAggregatesProcessor.java index 41709e354975..61cc964d24d1 100644 --- a/processing/src/main/java/org/apache/druid/query/topn/types/NullableNumericTopNColumnAggregatesProcessor.java +++ b/processing/src/main/java/org/apache/druid/query/topn/types/NullableNumericTopNColumnAggregatesProcessor.java @@ -19,7 +19,6 @@ package org.apache.druid.query.topn.types; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.CursorGranularizer; import org.apache.druid.query.aggregation.Aggregator; import org.apache.druid.query.topn.BaseTopNAlgorithm; @@ -45,7 +44,6 @@ public abstract class NullableNumericTopNColumnAggregatesProcessor implements TopNColumnAggregatesProcessor { - private final boolean hasNulls = !NullHandling.replaceWithDefault(); final Function converter; Aggregator[] nullValueAggregates; @@ -96,7 +94,7 @@ public long scanAndAggregate( long processedRows = 0; if (granularizer.currentOffsetWithinBucket()) { while (!cursor.isDone()) { - if (hasNulls && selector.isNull()) { + if (selector.isNull()) { if (nullValueAggregates == null) { nullValueAggregates = BaseTopNAlgorithm.makeAggregators(cursor, query.getAggregatorSpecs()); } diff --git a/processing/src/main/java/org/apache/druid/segment/AutoTypeColumnIndexer.java b/processing/src/main/java/org/apache/druid/segment/AutoTypeColumnIndexer.java index dafd7dc96005..28b679d49e28 100644 --- a/processing/src/main/java/org/apache/druid/segment/AutoTypeColumnIndexer.java +++ b/processing/src/main/java/org/apache/druid/segment/AutoTypeColumnIndexer.java @@ -22,7 +22,6 @@ import com.google.common.primitives.Doubles; import org.apache.druid.collections.bitmap.BitmapFactory; import org.apache.druid.collections.bitmap.MutableBitmap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.guava.GuavaUtils; import org.apache.druid.data.input.impl.DimensionSchema; import org.apache.druid.java.util.common.IAE; @@ -592,7 +591,6 @@ private ColumnValueSelector getRootLiteralValueSelector( if (root == null) { return null; } - final Object defaultValue = getDefaultValueForType(getLogicalType()); return new ColumnValueSelector<>() { @Override @@ -647,11 +645,11 @@ public Object getObject() final StructuredData data = (StructuredData) dims[dimIndex]; if (data != null) { final Object o = ExprEval.bestEffortOf(data.getValue()).valueOrDefault(); - return o == null ? defaultValue : o; + return o; } } - return defaultValue; + return null; } @Nullable @@ -824,15 +822,6 @@ public ColumnCapabilities toColumnCapabilities() @Nullable private static Object getDefaultValueForType(@Nullable ColumnType columnType) { - if (NullHandling.replaceWithDefault()) { - if (columnType != null) { - if (ColumnType.LONG.equals(columnType)) { - return NullHandling.defaultLongValue(); - } else if (ColumnType.DOUBLE.equals(columnType)) { - return NullHandling.defaultDoubleValue(); - } - } - } return null; } } diff --git a/processing/src/main/java/org/apache/druid/segment/ConstantDimensionSelector.java b/processing/src/main/java/org/apache/druid/segment/ConstantDimensionSelector.java index b8d94649dbe2..a5448162098d 100644 --- a/processing/src/main/java/org/apache/druid/segment/ConstantDimensionSelector.java +++ b/processing/src/main/java/org/apache/druid/segment/ConstantDimensionSelector.java @@ -19,7 +19,6 @@ package org.apache.druid.segment; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.filter.DruidObjectPredicate; import org.apache.druid.query.filter.DruidPredicateFactory; import org.apache.druid.query.filter.DruidPredicateMatch; @@ -39,7 +38,7 @@ public class ConstantDimensionSelector implements SingleValueHistoricalDimension public ConstantDimensionSelector(final String value) { - if (NullHandling.isNullOrEquivalent(value)) { + if (value == null) { // There's an optimized implementation for nulls that callers should use instead. throw new IllegalArgumentException("Use DimensionSelector.constant(null)"); } diff --git a/processing/src/main/java/org/apache/druid/segment/ConstantExprEvalSelector.java b/processing/src/main/java/org/apache/druid/segment/ConstantExprEvalSelector.java index 67b883779d3e..22640d27e7d2 100644 --- a/processing/src/main/java/org/apache/druid/segment/ConstantExprEvalSelector.java +++ b/processing/src/main/java/org/apache/druid/segment/ConstantExprEvalSelector.java @@ -20,7 +20,6 @@ package org.apache.druid.segment; import com.google.common.base.Preconditions; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.math.expr.ExprEval; import org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector; @@ -36,7 +35,7 @@ public ConstantExprEvalSelector(final ExprEval eval) { this.eval = Preconditions.checkNotNull(eval, "eval"); - if (NullHandling.sqlCompatible() && eval.isNumericNull()) { + if (eval.isNumericNull()) { longValue = 0L; floatValue = 0f; doubleValue = 0d; diff --git a/processing/src/main/java/org/apache/druid/segment/DimensionSelector.java b/processing/src/main/java/org/apache/druid/segment/DimensionSelector.java index e4cebe9d46b1..9989d745f367 100644 --- a/processing/src/main/java/org/apache/druid/segment/DimensionSelector.java +++ b/processing/src/main/java/org/apache/druid/segment/DimensionSelector.java @@ -19,7 +19,6 @@ package org.apache.druid.segment; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.guice.annotations.PublicApi; import org.apache.druid.query.extraction.ExtractionFn; import org.apache.druid.query.filter.DruidObjectPredicate; @@ -162,7 +161,7 @@ static DimensionSelector nilSelector() static DimensionSelector constant(@Nullable final String value) { - if (NullHandling.isNullOrEquivalent(value)) { + if (value == null) { return nilSelector(); } else { return new ConstantDimensionSelector(value); @@ -263,7 +262,7 @@ public IndexedInts getRow(int offset) @Override public ValueMatcher makeValueMatcher(@Nullable String value) { - if (NullHandling.isNullOrEquivalent(value)) { + if (value == null) { return ValueMatchers.allTrue(); } return ValueMatchers.allUnknown(); @@ -314,7 +313,7 @@ public IdLookup idLookup() @Override public int lookupId(@Nullable String name) { - return NullHandling.isNullOrEquivalent(name) ? 0 : -1; + return name == null ? 0 : -1; } @Nullable @@ -339,7 +338,7 @@ public void inspectRuntimeShape(RuntimeShapeInspector inspector) @Override public boolean isNull() { - return NullHandling.sqlCompatible(); + return true; } } } diff --git a/processing/src/main/java/org/apache/druid/segment/DoubleDimensionIndexer.java b/processing/src/main/java/org/apache/druid/segment/DoubleDimensionIndexer.java index 6f1e5184747a..75043851f557 100644 --- a/processing/src/main/java/org/apache/druid/segment/DoubleDimensionIndexer.java +++ b/processing/src/main/java/org/apache/druid/segment/DoubleDimensionIndexer.java @@ -21,7 +21,6 @@ import org.apache.druid.collections.bitmap.BitmapFactory; import org.apache.druid.collections.bitmap.MutableBitmap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.guava.Comparators; import org.apache.druid.query.dimension.DimensionSpec; import org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector; @@ -55,7 +54,7 @@ public EncodedKeyComponent processRowValsToUnsortedEncodedKeyComponent( { Double d = DimensionHandlerUtils.convertObjectToDouble(dimValues, reportParseExceptions, dimensionName); if (d == null) { - hasNulls = NullHandling.sqlCompatible(); + hasNulls = true; } return new EncodedKeyComponent<>(d, Double.BYTES); } @@ -63,7 +62,7 @@ public EncodedKeyComponent processRowValsToUnsortedEncodedKeyComponent( @Override public void setSparseIndexed() { - hasNulls = NullHandling.sqlCompatible(); + hasNulls = true; } @Override @@ -139,7 +138,7 @@ public double getDouble() final Object[] dims = currEntry.get().getDims(); if (dimIndex >= dims.length || dims[dimIndex] == null) { - assert NullHandling.replaceWithDefault(); + assert !isNull(); return 0.0; } return (Double) dims[dimIndex]; @@ -153,7 +152,7 @@ public Double getObject() final Object[] dims = currEntry.get().getDims(); if (dimIndex >= dims.length || dims[dimIndex] == null) { - return NullHandling.defaultDoubleValue(); + return null; } return (Double) dims[dimIndex]; } diff --git a/processing/src/main/java/org/apache/druid/segment/FloatDimensionIndexer.java b/processing/src/main/java/org/apache/druid/segment/FloatDimensionIndexer.java index 16b3c9f70528..2d0eec440006 100644 --- a/processing/src/main/java/org/apache/druid/segment/FloatDimensionIndexer.java +++ b/processing/src/main/java/org/apache/druid/segment/FloatDimensionIndexer.java @@ -21,7 +21,6 @@ import org.apache.druid.collections.bitmap.BitmapFactory; import org.apache.druid.collections.bitmap.MutableBitmap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.guava.Comparators; import org.apache.druid.query.dimension.DimensionSpec; import org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector; @@ -55,7 +54,7 @@ public EncodedKeyComponent processRowValsToUnsortedEncodedKeyComponent( { Float f = DimensionHandlerUtils.convertObjectToFloat(dimValues, reportParseExceptions, dimensionName); if (f == null) { - hasNulls = NullHandling.sqlCompatible(); + hasNulls = true; } return new EncodedKeyComponent<>(f, Float.BYTES); } @@ -63,7 +62,7 @@ public EncodedKeyComponent processRowValsToUnsortedEncodedKeyComponent( @Override public void setSparseIndexed() { - hasNulls = NullHandling.sqlCompatible(); + hasNulls = true; } @Override @@ -139,7 +138,7 @@ public float getFloat() final Object[] dims = currEntry.get().getDims(); if (dimIndex >= dims.length || dims[dimIndex] == null) { - assert NullHandling.replaceWithDefault(); + assert !isNull(); return 0.0f; } @@ -154,7 +153,7 @@ public Float getObject() final Object[] dims = currEntry.get().getDims(); if (dimIndex >= dims.length || dims[dimIndex] == null) { - return NullHandling.defaultFloatValue(); + return null; } return (Float) dims[dimIndex]; diff --git a/processing/src/main/java/org/apache/druid/segment/IndexMergerV9.java b/processing/src/main/java/org/apache/druid/segment/IndexMergerV9.java index 7da89edaff75..e0666b18a97c 100644 --- a/processing/src/main/java/org/apache/druid/segment/IndexMergerV9.java +++ b/processing/src/main/java/org/apache/druid/segment/IndexMergerV9.java @@ -27,7 +27,6 @@ import com.google.common.io.Files; import com.google.common.primitives.Ints; import com.google.inject.Inject; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.impl.DimensionsSpec; import org.apache.druid.error.DruidException; import org.apache.druid.io.ZeroCopyByteArrayOutputStream; @@ -57,11 +56,8 @@ import org.apache.druid.segment.serde.ComplexColumnPartSerde; import org.apache.druid.segment.serde.ComplexMetricSerde; import org.apache.druid.segment.serde.ComplexMetrics; -import org.apache.druid.segment.serde.DoubleNumericColumnPartSerde; import org.apache.druid.segment.serde.DoubleNumericColumnPartSerdeV2; -import org.apache.druid.segment.serde.FloatNumericColumnPartSerde; import org.apache.druid.segment.serde.FloatNumericColumnPartSerdeV2; -import org.apache.druid.segment.serde.LongNumericColumnPartSerde; import org.apache.druid.segment.serde.LongNumericColumnPartSerdeV2; import org.apache.druid.segment.serde.NullColumnPartSerde; import org.apache.druid.segment.writeout.SegmentWriteOutMedium; @@ -724,53 +720,29 @@ private void makeMetricsColumns( static ColumnPartSerde createLongColumnPartSerde(GenericColumnSerializer serializer, IndexSpec indexSpec) { - // If using default values for null use LongNumericColumnPartSerde to allow rollback to previous versions. - if (NullHandling.replaceWithDefault()) { - return LongNumericColumnPartSerde.serializerBuilder() + return LongNumericColumnPartSerdeV2.serializerBuilder() .withByteOrder(IndexIO.BYTE_ORDER) + .withBitmapSerdeFactory(indexSpec.getBitmapSerdeFactory()) .withDelegate(serializer) .build(); - } else { - return LongNumericColumnPartSerdeV2.serializerBuilder() - .withByteOrder(IndexIO.BYTE_ORDER) - .withBitmapSerdeFactory(indexSpec.getBitmapSerdeFactory()) - .withDelegate(serializer) - .build(); - } } static ColumnPartSerde createDoubleColumnPartSerde(GenericColumnSerializer serializer, IndexSpec indexSpec) { - // If using default values for null use DoubleNumericColumnPartSerde to allow rollback to previous versions. - if (NullHandling.replaceWithDefault()) { - return DoubleNumericColumnPartSerde.serializerBuilder() + return DoubleNumericColumnPartSerdeV2.serializerBuilder() .withByteOrder(IndexIO.BYTE_ORDER) + .withBitmapSerdeFactory(indexSpec.getBitmapSerdeFactory()) .withDelegate(serializer) .build(); - } else { - return DoubleNumericColumnPartSerdeV2.serializerBuilder() - .withByteOrder(IndexIO.BYTE_ORDER) - .withBitmapSerdeFactory(indexSpec.getBitmapSerdeFactory()) - .withDelegate(serializer) - .build(); - } } static ColumnPartSerde createFloatColumnPartSerde(GenericColumnSerializer serializer, IndexSpec indexSpec) { - // If using default values for null use FloatNumericColumnPartSerde to allow rollback to previous versions. - if (NullHandling.replaceWithDefault()) { - return FloatNumericColumnPartSerde.serializerBuilder() + return FloatNumericColumnPartSerdeV2.serializerBuilder() .withByteOrder(IndexIO.BYTE_ORDER) + .withBitmapSerdeFactory(indexSpec.getBitmapSerdeFactory()) .withDelegate(serializer) .build(); - } else { - return FloatNumericColumnPartSerdeV2.serializerBuilder() - .withByteOrder(IndexIO.BYTE_ORDER) - .withBitmapSerdeFactory(indexSpec.getBitmapSerdeFactory()) - .withDelegate(serializer) - .build(); - } } private void makeTimeColumn( @@ -995,25 +967,14 @@ static GenericColumnSerializer createLongColumnSerializer( IndexSpec indexSpec ) { - // If using default values for null use LongColumnSerializer to allow rollback to previous versions. - if (NullHandling.replaceWithDefault()) { - return LongColumnSerializer.create( - columnName, - segmentWriteOutMedium, - columnName, - indexSpec.getMetricCompression(), - indexSpec.getLongEncoding() - ); - } else { - return LongColumnSerializerV2.create( - columnName, - segmentWriteOutMedium, - columnName, - indexSpec.getMetricCompression(), - indexSpec.getLongEncoding(), - indexSpec.getBitmapSerdeFactory() - ); - } + return LongColumnSerializerV2.create( + columnName, + segmentWriteOutMedium, + columnName, + indexSpec.getMetricCompression(), + indexSpec.getLongEncoding(), + indexSpec.getBitmapSerdeFactory() + ); } static GenericColumnSerializer createDoubleColumnSerializer( @@ -1022,23 +983,13 @@ static GenericColumnSerializer createDoubleColumnSerializer( IndexSpec indexSpec ) { - // If using default values for null use DoubleColumnSerializer to allow rollback to previous versions. - if (NullHandling.replaceWithDefault()) { - return DoubleColumnSerializer.create( - columnName, - segmentWriteOutMedium, - columnName, - indexSpec.getMetricCompression() - ); - } else { - return DoubleColumnSerializerV2.create( - columnName, - segmentWriteOutMedium, - columnName, - indexSpec.getMetricCompression(), - indexSpec.getBitmapSerdeFactory() - ); - } + return DoubleColumnSerializerV2.create( + columnName, + segmentWriteOutMedium, + columnName, + indexSpec.getMetricCompression(), + indexSpec.getBitmapSerdeFactory() + ); } static GenericColumnSerializer createFloatColumnSerializer( @@ -1047,23 +998,13 @@ static GenericColumnSerializer createFloatColumnSerializer( IndexSpec indexSpec ) { - // If using default values for null use FloatColumnSerializer to allow rollback to previous versions. - if (NullHandling.replaceWithDefault()) { - return FloatColumnSerializer.create( - columnName, - segmentWriteOutMedium, - columnName, - indexSpec.getMetricCompression() - ); - } else { - return FloatColumnSerializerV2.create( - columnName, - segmentWriteOutMedium, - columnName, - indexSpec.getMetricCompression(), - indexSpec.getBitmapSerdeFactory() - ); - } + return FloatColumnSerializerV2.create( + columnName, + segmentWriteOutMedium, + columnName, + indexSpec.getMetricCompression(), + indexSpec.getBitmapSerdeFactory() + ); } private void writeDimValuesAndSetupDimConversion( diff --git a/processing/src/main/java/org/apache/druid/segment/LongDimensionIndexer.java b/processing/src/main/java/org/apache/druid/segment/LongDimensionIndexer.java index 3b273bb7f021..53f7b39e2604 100644 --- a/processing/src/main/java/org/apache/druid/segment/LongDimensionIndexer.java +++ b/processing/src/main/java/org/apache/druid/segment/LongDimensionIndexer.java @@ -21,7 +21,6 @@ import org.apache.druid.collections.bitmap.BitmapFactory; import org.apache.druid.collections.bitmap.MutableBitmap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.guava.Comparators; import org.apache.druid.query.dimension.DimensionSpec; import org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector; @@ -55,7 +54,7 @@ public EncodedKeyComponent processRowValsToUnsortedEncodedKeyComponent( { Long l = DimensionHandlerUtils.convertObjectToLong(dimValues, reportParseExceptions, dimensionName); if (l == null) { - hasNulls = NullHandling.sqlCompatible(); + hasNulls = true; } return new EncodedKeyComponent<>(l, Long.BYTES); } @@ -63,7 +62,7 @@ public EncodedKeyComponent processRowValsToUnsortedEncodedKeyComponent( @Override public void setSparseIndexed() { - hasNulls = NullHandling.sqlCompatible(); + hasNulls = true; } @Override @@ -139,7 +138,7 @@ public long getLong() final Object[] dims = currEntry.get().getDims(); if (dimIndex >= dims.length || dims[dimIndex] == null) { - assert NullHandling.replaceWithDefault(); + assert !isNull(); return 0; } @@ -154,7 +153,7 @@ public Long getObject() final Object[] dims = currEntry.get().getDims(); if (dimIndex >= dims.length || dims[dimIndex] == null) { - return NullHandling.defaultLongValue(); + return null; } return (Long) dims[dimIndex]; diff --git a/processing/src/main/java/org/apache/druid/segment/NilColumnValueSelector.java b/processing/src/main/java/org/apache/druid/segment/NilColumnValueSelector.java index 98d6ee645920..8b4941ab68aa 100644 --- a/processing/src/main/java/org/apache/druid/segment/NilColumnValueSelector.java +++ b/processing/src/main/java/org/apache/druid/segment/NilColumnValueSelector.java @@ -19,7 +19,6 @@ package org.apache.druid.segment; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.guice.annotations.PublicApi; import org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector; @@ -31,9 +30,7 @@ @PublicApi public class NilColumnValueSelector implements ColumnValueSelector { - private static final NilColumnValueSelector INSTANCE = NullHandling.sqlCompatible() - ? new SqlCompatibleNilColumnValueSelector() - : new NilColumnValueSelector(); + private static final NilColumnValueSelector INSTANCE = new NilColumnValueSelector(); public static NilColumnValueSelector instance() { @@ -45,36 +42,30 @@ private NilColumnValueSelector() } /** - * always returns 0, if {@link NullHandling#replaceWithDefault} is set to true, - * or always throws an exception, if {@link NullHandling#replaceWithDefault} is - * set to false. + * always throws an exception, all values in this column are null */ @Override public double getDouble() { - return 0.0; + throw new IllegalStateException("Cannot return null value as double"); } /** - * always returns 0.0f, if {@link NullHandling#replaceWithDefault} is set to true, - * or always throws an exception, if {@link NullHandling#replaceWithDefault} is - * set to false. + * always throws an exception, all values in this column are null */ @Override public float getFloat() { - return 0.0f; + throw new IllegalStateException("Cannot return null value as float"); } /** - * always returns 0L, if {@link NullHandling#replaceWithDefault} is set to true, - * or always throws an exception, if {@link NullHandling#replaceWithDefault} is - * set to false. + * always throws an exception, all values in this column are null */ @Override public long getLong() { - return 0L; + throw new IllegalStateException("Cannot return null value as long"); } /** @@ -107,26 +98,4 @@ public void inspectRuntimeShape(RuntimeShapeInspector inspector) { // nothing to inspect } - - private static class SqlCompatibleNilColumnValueSelector extends NilColumnValueSelector - { - @Override - public double getDouble() - { - throw new IllegalStateException("Cannot return null value as double"); - } - - @Override - public float getFloat() - { - throw new IllegalStateException("Cannot return null value as float"); - } - - @Override - public long getLong() - { - throw new IllegalStateException("Cannot return null value as long"); - } - - } } diff --git a/processing/src/main/java/org/apache/druid/segment/RowBasedColumnSelectorFactory.java b/processing/src/main/java/org/apache/druid/segment/RowBasedColumnSelectorFactory.java index 035e036f153f..eb1f79937eae 100644 --- a/processing/src/main/java/org/apache/druid/segment/RowBasedColumnSelectorFactory.java +++ b/processing/src/main/java/org/apache/druid/segment/RowBasedColumnSelectorFactory.java @@ -20,7 +20,6 @@ package org.apache.druid.segment; import com.google.common.base.Preconditions; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.Rows; import org.apache.druid.query.dimension.DimensionSpec; import org.apache.druid.query.extraction.ExtractionFn; @@ -243,8 +242,7 @@ public boolean matches(boolean includeUnknown) } for (String dimensionValue : dimensionValues) { - final String coerced = NullHandling.emptyToNullIfNeeded(dimensionValue); - if ((includeUnknown && coerced == null) || Objects.equals(coerced, value)) { + if ((includeUnknown && dimensionValue == null) || Objects.equals(dimensionValue, value)) { return true; } } @@ -277,8 +275,7 @@ public boolean matches(boolean includeUnknown) } for (String dimensionValue : dimensionValues) { - final String coerced = NullHandling.emptyToNullIfNeeded(dimensionValue); - if (predicate.apply(coerced).matches(includeUnknown)) { + if (predicate.apply(dimensionValue).matches(includeUnknown)) { return true; } } @@ -305,7 +302,7 @@ public int getValueCardinality() public String lookupName(int id) { updateCurrentValues(); - return NullHandling.emptyToNullIfNeeded(dimensionValues.get(id)); + return dimensionValues.get(id); } @Override @@ -353,7 +350,7 @@ private void updateCurrentValues() final Object rawValue = dimFunction.apply(rowSupplier.get()); if (rawValue == null || rawValue instanceof String) { - final String s = NullHandling.emptyToNullIfNeeded((String) rawValue); + final String s = (String) rawValue; if (extractionFn == null) { dimensionValues = Collections.singletonList(s); @@ -390,12 +387,10 @@ private void updateCurrentValues() dimensionValues = new ArrayList<>(nonExtractedValues.size()); for (final String value : nonExtractedValues) { - final String s = NullHandling.emptyToNullIfNeeded(value); - if (extractionFn == null) { - dimensionValues.add(s); + dimensionValues.add(value); } else { - dimensionValues.add(extractionFn.apply(s)); + dimensionValues.add(extractionFn.apply(value)); } } } @@ -461,31 +456,31 @@ public void inspectRuntimeShape(RuntimeShapeInspector inspector) public boolean isNull() { updateCurrentValueAsNumber(); - return !NullHandling.replaceWithDefault() && currentValueAsNumber == null; + return currentValueAsNumber == null; } @Override public double getDouble() { updateCurrentValueAsNumber(); - assert NullHandling.replaceWithDefault() || currentValueAsNumber != null; - return currentValueAsNumber != null ? currentValueAsNumber.doubleValue() : 0d; + assert currentValueAsNumber != null; + return currentValueAsNumber.doubleValue(); } @Override public float getFloat() { updateCurrentValueAsNumber(); - assert NullHandling.replaceWithDefault() || currentValueAsNumber != null; - return currentValueAsNumber != null ? currentValueAsNumber.floatValue() : 0f; + assert currentValueAsNumber != null; + return currentValueAsNumber.floatValue(); } @Override public long getLong() { updateCurrentValueAsNumber(); - assert NullHandling.replaceWithDefault() || currentValueAsNumber != null; - return currentValueAsNumber != null ? currentValueAsNumber.longValue() : 0L; + assert currentValueAsNumber != null; + return currentValueAsNumber.longValue(); } @Nullable diff --git a/processing/src/main/java/org/apache/druid/segment/StringDimensionIndexer.java b/processing/src/main/java/org/apache/druid/segment/StringDimensionIndexer.java index 42b1a9ae1f54..7f07ed0f15d4 100644 --- a/processing/src/main/java/org/apache/druid/segment/StringDimensionIndexer.java +++ b/processing/src/main/java/org/apache/druid/segment/StringDimensionIndexer.java @@ -23,12 +23,12 @@ import it.unimi.dsi.fastutil.ints.IntArrays; import org.apache.druid.collections.bitmap.BitmapFactory; import org.apache.druid.collections.bitmap.MutableBitmap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.impl.DimensionSchema.MultiValueHandling; import org.apache.druid.error.DruidException; import org.apache.druid.java.util.common.ISE; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.java.util.common.guava.Comparators; +import org.apache.druid.math.expr.Evals; import org.apache.druid.query.dimension.DimensionSpec; import org.apache.druid.query.extraction.ExtractionFn; import org.apache.druid.query.filter.DruidObjectPredicate; @@ -54,12 +54,6 @@ public class StringDimensionIndexer extends DictionaryEncodedColumnIndexer { - @Nullable - private static String emptyToNullIfNeeded(@Nullable Object o) - { - return o != null ? NullHandling.emptyToNullIfNeeded(o.toString()) : null; - } - private final MultiValueHandling multiValueHandling; private final boolean hasBitmapIndexes; private final boolean hasSpatialIndexes; @@ -101,12 +95,12 @@ public EncodedKeyComponent processRowValsToUnsortedEncodedKeyComponent(@N dimLookup.add(null); encodedDimensionValues = IntArrays.EMPTY_ARRAY; } else if (dimValuesList.size() == 1) { - encodedDimensionValues = new int[]{dimLookup.add(emptyToNullIfNeeded(dimValuesList.get(0)))}; + encodedDimensionValues = new int[]{dimLookup.add(Evals.asString(dimValuesList.get(0)))}; } else { hasMultipleValues = true; final String[] dimensionValues = new String[dimValuesList.size()]; for (int i = 0; i < dimValuesList.size(); i++) { - dimensionValues[i] = emptyToNullIfNeeded(dimValuesList.get(i)); + dimensionValues[i] = Evals.asString(dimValuesList.get(i)); } if (multiValueHandling.needSorting()) { // Sort multival row by their unencoded values first. @@ -132,9 +126,9 @@ public EncodedKeyComponent processRowValsToUnsortedEncodedKeyComponent(@N } } else if (dimValues instanceof byte[]) { encodedDimensionValues = - new int[]{dimLookup.add(emptyToNullIfNeeded(StringUtils.encodeBase64String((byte[]) dimValues)))}; + new int[]{dimLookup.add(Evals.asString(StringUtils.encodeBase64String((byte[]) dimValues)))}; } else { - encodedDimensionValues = new int[]{dimLookup.add(emptyToNullIfNeeded(dimValues))}; + encodedDimensionValues = new int[]{dimLookup.add(Evals.asString(dimValues))}; } // If dictionary size has changed, the sorted lookup is no longer valid. @@ -549,7 +543,7 @@ public Object convertUnsortedEncodedKeyComponentToActualList(int[] key) String[] rowArray = new String[key.length]; for (int i = 0; i < key.length; i++) { String val = getActualValue(key[i], false); - rowArray[i] = NullHandling.nullToEmptyIfNeeded(val); + rowArray[i] = val; } return Arrays.asList(rowArray); } diff --git a/processing/src/main/java/org/apache/druid/segment/StringDimensionMergerV9.java b/processing/src/main/java/org/apache/druid/segment/StringDimensionMergerV9.java index b0f9c6f466a9..cc731e8e6189 100644 --- a/processing/src/main/java/org/apache/druid/segment/StringDimensionMergerV9.java +++ b/processing/src/main/java/org/apache/druid/segment/StringDimensionMergerV9.java @@ -27,7 +27,6 @@ import org.apache.druid.collections.spatial.ImmutableRTree; import org.apache.druid.collections.spatial.RTree; import org.apache.druid.collections.spatial.split.LinearGutmanSplitStrategy; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; import org.apache.druid.java.util.common.Pair; import org.apache.druid.java.util.common.io.Closer; @@ -113,7 +112,7 @@ protected ObjectStrategy getObjectStrategy() @Override protected String coerceValue(String value) { - return NullHandling.emptyToNullIfNeeded(value); + return value; } @Override diff --git a/processing/src/main/java/org/apache/druid/segment/column/ColumnCapabilitiesImpl.java b/processing/src/main/java/org/apache/druid/segment/column/ColumnCapabilitiesImpl.java index f0b13a7115ea..9b3ca2709d5c 100644 --- a/processing/src/main/java/org/apache/druid/segment/column/ColumnCapabilitiesImpl.java +++ b/processing/src/main/java/org/apache/druid/segment/column/ColumnCapabilitiesImpl.java @@ -23,7 +23,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; import com.google.common.base.Preconditions; -import org.apache.druid.common.config.NullHandling; import javax.annotation.Nullable; @@ -125,9 +124,6 @@ public static ColumnCapabilitiesImpl createSimpleNumericColumnCapabilities(TypeS .setDictionaryValuesSorted(false) .setDictionaryValuesUnique(false) .setHasSpatialIndexes(false); - if (NullHandling.replaceWithDefault()) { - builder.setHasNulls(false); - } return builder; } diff --git a/processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java b/processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java index 4c8ee6f06513..ef731c36b3ef 100644 --- a/processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java +++ b/processing/src/main/java/org/apache/druid/segment/data/ColumnarDoubles.java @@ -20,7 +20,6 @@ package org.apache.druid.segment.data; import org.apache.druid.collections.bitmap.ImmutableBitmap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector; import org.apache.druid.segment.ColumnValueSelector; import org.apache.druid.segment.DoubleColumnSelector; @@ -128,14 +127,14 @@ public boolean isNull() public double getDouble() { //noinspection AssertWithSideEffects (ignore null handling test initialization check side effect) - assert NullHandling.replaceWithDefault() || !isNull(); + assert !isNull(); return ColumnarDoubles.this.get(offset.getOffset()); } @Override public double getDouble(int offset) { - assert NullHandling.replaceWithDefault() || !nullValueBitmap.get(offset); + assert !nullValueBitmap.get(offset); return ColumnarDoubles.this.get(offset); } diff --git a/processing/src/main/java/org/apache/druid/segment/data/ColumnarFloats.java b/processing/src/main/java/org/apache/druid/segment/data/ColumnarFloats.java index a6b81084756c..ba9e99e5429e 100644 --- a/processing/src/main/java/org/apache/druid/segment/data/ColumnarFloats.java +++ b/processing/src/main/java/org/apache/druid/segment/data/ColumnarFloats.java @@ -20,7 +20,6 @@ package org.apache.druid.segment.data; import org.apache.druid.collections.bitmap.ImmutableBitmap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector; import org.apache.druid.segment.ColumnValueSelector; import org.apache.druid.segment.FloatColumnSelector; @@ -123,14 +122,14 @@ public boolean isNull() public float getFloat() { //noinspection AssertWithSideEffects (ignore null handling test initialization check side effect) - assert NullHandling.replaceWithDefault() || !isNull(); + assert !isNull(); return ColumnarFloats.this.get(offset.getOffset()); } @Override public double getDouble(int offset) { - assert NullHandling.replaceWithDefault() || !nullValueBitmap.get(offset); + assert !nullValueBitmap.get(offset); return ColumnarFloats.this.get(offset); } diff --git a/processing/src/main/java/org/apache/druid/segment/data/ColumnarLongs.java b/processing/src/main/java/org/apache/druid/segment/data/ColumnarLongs.java index 6d8162ef2670..bb029b3c645b 100644 --- a/processing/src/main/java/org/apache/druid/segment/data/ColumnarLongs.java +++ b/processing/src/main/java/org/apache/druid/segment/data/ColumnarLongs.java @@ -20,7 +20,6 @@ package org.apache.druid.segment.data; import org.apache.druid.collections.bitmap.ImmutableBitmap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector; import org.apache.druid.segment.ColumnValueSelector; import org.apache.druid.segment.LongColumnSelector; @@ -134,14 +133,14 @@ public boolean isNull() public long getLong() { //noinspection AssertWithSideEffects (ignore null handling test initialization check side effect) - assert NullHandling.replaceWithDefault() || !isNull(); + assert !isNull(); return ColumnarLongs.this.get(offset.getOffset()); } @Override public double getDouble(int offset) { - assert NullHandling.replaceWithDefault() || !nullValueBitmap.get(offset); + assert !nullValueBitmap.get(offset); return ColumnarLongs.this.get(offset); } diff --git a/processing/src/main/java/org/apache/druid/segment/data/EncodedStringDictionaryWriter.java b/processing/src/main/java/org/apache/druid/segment/data/EncodedStringDictionaryWriter.java index 799ed3766f28..ca78fb5786be 100644 --- a/processing/src/main/java/org/apache/druid/segment/data/EncodedStringDictionaryWriter.java +++ b/processing/src/main/java/org/apache/druid/segment/data/EncodedStringDictionaryWriter.java @@ -19,7 +19,6 @@ package org.apache.druid.segment.data; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.java.util.common.io.smoosh.FileSmoosher; import org.apache.druid.segment.column.StringEncodingStrategy; @@ -60,7 +59,7 @@ public void open() throws IOException @Override public int write(@Nullable String objectToWrite) throws IOException { - return delegate.write(StringUtils.toUtf8Nullable(NullHandling.emptyToNullIfNeeded(objectToWrite))); + return delegate.write(StringUtils.toUtf8Nullable(objectToWrite)); } @Nullable diff --git a/processing/src/main/java/org/apache/druid/segment/data/GenericIndexed.java b/processing/src/main/java/org/apache/druid/segment/data/GenericIndexed.java index 0bf8aebd22ac..2c61d85a2ed1 100644 --- a/processing/src/main/java/org/apache/druid/segment/data/GenericIndexed.java +++ b/processing/src/main/java/org/apache/druid/segment/data/GenericIndexed.java @@ -21,7 +21,6 @@ import com.google.common.primitives.Ints; import org.apache.druid.collections.ResourceHolder; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.utils.SerializerUtils; import org.apache.druid.io.Channels; import org.apache.druid.java.util.common.ByteBufferUtils; @@ -159,7 +158,7 @@ public String fromByteBuffer(final ByteBuffer buffer, final int numBytes) @Nullable public byte[] toBytes(@Nullable String val) { - return StringUtils.toUtf8Nullable(NullHandling.nullToEmptyIfNeeded(val)); + return StringUtils.toUtf8Nullable(val); } @Override @@ -560,10 +559,7 @@ protected T copyBufferAndGet(ByteBuffer valueBuffer, int startOffset, int endOff { ByteBuffer copyValueBuffer = valueBuffer.asReadOnlyBuffer(); int size = endOffset - startOffset; - // When size is 0 and SQL compatibility is enabled also check for null marker before returning null. - // When SQL compatibility is not enabled return null for both null as well as empty string case. - if (size == 0 && (NullHandling.replaceWithDefault() - || copyValueBuffer.get(startOffset - Integer.BYTES) == NULL_VALUE_SIZE_MARKER)) { + if (size == 0 && (copyValueBuffer.get(startOffset - Integer.BYTES) == NULL_VALUE_SIZE_MARKER)) { return null; } copyValueBuffer.position(startOffset); @@ -601,10 +597,7 @@ public T get(final int index) ByteBuffer bufferedIndexedGetByteBuffer(ByteBuffer copyValueBuffer, int startOffset, int endOffset) { int size = endOffset - startOffset; - // When size is 0 and SQL compatibility is enabled also check for null marker before returning null. - // When SQL compatibility is not enabled return null for both null as well as empty string case. - if (size == 0 && (NullHandling.replaceWithDefault() - || copyValueBuffer.get(startOffset - Integer.BYTES) == NULL_VALUE_SIZE_MARKER)) { + if (size == 0 && (copyValueBuffer.get(startOffset - Integer.BYTES) == NULL_VALUE_SIZE_MARKER)) { return null; } diff --git a/processing/src/main/java/org/apache/druid/segment/data/GenericIndexedWriter.java b/processing/src/main/java/org/apache/druid/segment/data/GenericIndexedWriter.java index ebf8f08d768e..ddc6bbe88767 100644 --- a/processing/src/main/java/org/apache/druid/segment/data/GenericIndexedWriter.java +++ b/processing/src/main/java/org/apache/druid/segment/data/GenericIndexedWriter.java @@ -24,7 +24,6 @@ import com.google.common.primitives.Ints; import it.unimi.dsi.fastutil.longs.LongArrayList; import it.unimi.dsi.fastutil.longs.LongList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.IAE; import org.apache.druid.java.util.common.ISE; import org.apache.druid.java.util.common.StringUtils; @@ -296,9 +295,6 @@ public T get(int index) throws IOException long endOffset = getOffset(index); int valueSize = checkedCastNonnegativeLongToInt(endOffset - startOffset); if (valueSize == 0) { - if (NullHandling.replaceWithDefault()) { - return null; - } ByteBuffer bb = ByteBuffer.allocate(Integer.BYTES); valuesOut.readFully(startOffset - Integer.BYTES, bb); bb.flip(); diff --git a/processing/src/main/java/org/apache/druid/segment/filter/BoundFilter.java b/processing/src/main/java/org/apache/druid/segment/filter/BoundFilter.java index ca6f66b8fdaf..ea052455e6dc 100644 --- a/processing/src/main/java/org/apache/druid/segment/filter/BoundFilter.java +++ b/processing/src/main/java/org/apache/druid/segment/filter/BoundFilter.java @@ -23,7 +23,6 @@ import com.google.common.base.Supplier; import com.google.common.collect.ImmutableList; import com.google.common.primitives.Doubles; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.IAE; import org.apache.druid.query.BitmapResultFactory; import org.apache.druid.query.extraction.ExtractionFn; @@ -270,10 +269,10 @@ private static boolean doesMatch(String input, BoundDimFilter boundDimFilter) { if (input == null) { return (!boundDimFilter.hasLowerBound() - || (NullHandling.isNullOrEquivalent(boundDimFilter.getLower()) && !boundDimFilter.isLowerStrict())) + || (boundDimFilter.getLower() == null && !boundDimFilter.isLowerStrict())) // lower bound allows null && (!boundDimFilter.hasUpperBound() - || !NullHandling.isNullOrEquivalent(boundDimFilter.getUpper()) + || boundDimFilter.getUpper() != null || !boundDimFilter.isUpperStrict()); // upper bound allows null } int lowerComparing = 1; diff --git a/processing/src/main/java/org/apache/druid/segment/filter/ExpressionFilter.java b/processing/src/main/java/org/apache/druid/segment/filter/ExpressionFilter.java index dcd818489ca4..7d1424d76daa 100644 --- a/processing/src/main/java/org/apache/druid/segment/filter/ExpressionFilter.java +++ b/processing/src/main/java/org/apache/druid/segment/filter/ExpressionFilter.java @@ -22,7 +22,6 @@ import com.google.common.base.Supplier; import com.google.common.base.Suppliers; import com.google.common.collect.Iterables; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.UOE; import org.apache.druid.math.expr.Evals; import org.apache.druid.math.expr.Expr; @@ -364,7 +363,7 @@ public DruidObjectPredicate makeStringPredicate() final ExprEval eval = expr.get().eval( InputBindings.forInputSupplier( ExpressionType.STRING, - () -> NullHandling.nullToEmptyIfNeeded(value) + () -> value ) ); if (eval.value() == null) { diff --git a/processing/src/main/java/org/apache/druid/segment/filter/IsBooleanFilter.java b/processing/src/main/java/org/apache/druid/segment/filter/IsBooleanFilter.java index d39afdecb7f0..813d4ac2f5ae 100644 --- a/processing/src/main/java/org/apache/druid/segment/filter/IsBooleanFilter.java +++ b/processing/src/main/java/org/apache/druid/segment/filter/IsBooleanFilter.java @@ -19,7 +19,6 @@ package org.apache.druid.segment.filter; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.query.BitmapResultFactory; import org.apache.druid.query.filter.ColumnIndexSelector; @@ -71,7 +70,6 @@ public BitmapColumnIndex getBitmapColumnIndex(ColumnIndexSelector selector) if (baseIndex != null && (isTrue || baseIndex.getIndexCapabilities().isInvertible())) { return new BitmapColumnIndex() { - private final boolean useThreeValueLogic = NullHandling.useThreeValueLogic(); @Override public ColumnIndexCapabilities getIndexCapabilities() { @@ -91,7 +89,7 @@ public T computeBitmapResult(BitmapResultFactory bitmapResultFactory, boo return baseIndex.computeBitmapResult(bitmapResultFactory, false); } return bitmapResultFactory.complement( - baseIndex.computeBitmapResult(bitmapResultFactory, useThreeValueLogic), + baseIndex.computeBitmapResult(bitmapResultFactory, true), selector.getNumRows() ); } @@ -118,7 +116,7 @@ public T computeBitmapResult( bitmapResultFactory, applyRowCount, totalRowCount, - useThreeValueLogic + true ); if (result == null) { @@ -139,14 +137,13 @@ public ValueMatcher makeMatcher(ColumnSelectorFactory factory) return new ValueMatcher() { - private final boolean useThreeValueLogic = NullHandling.useThreeValueLogic(); @Override public boolean matches(boolean includeUnknown) { if (isTrue) { return baseMatcher.matches(false); } - return !baseMatcher.matches(useThreeValueLogic); + return !baseMatcher.matches(true); } @Override @@ -165,7 +162,6 @@ public VectorValueMatcher makeVectorMatcher(final VectorColumnSelectorFactory fa return new BaseVectorValueMatcher(baseMatcher) { private final VectorMatch scratch = VectorMatch.wrap(new int[factory.getMaxVectorSize()]); - private final boolean useThreeValueLogic = NullHandling.useThreeValueLogic(); @Override public ReadableVectorMatch match(final ReadableVectorMatch mask, boolean includeUnknown) @@ -173,7 +169,7 @@ public ReadableVectorMatch match(final ReadableVectorMatch mask, boolean include if (isTrue) { return baseMatcher.match(mask, false); } - final ReadableVectorMatch baseMatch = baseMatcher.match(mask, useThreeValueLogic); + final ReadableVectorMatch baseMatch = baseMatcher.match(mask, true); scratch.copyFrom(mask); scratch.removeAll(baseMatch); diff --git a/processing/src/main/java/org/apache/druid/segment/filter/LikeFilter.java b/processing/src/main/java/org/apache/druid/segment/filter/LikeFilter.java index d45a18ebbee0..4376480957e8 100644 --- a/processing/src/main/java/org/apache/druid/segment/filter/LikeFilter.java +++ b/processing/src/main/java/org/apache/druid/segment/filter/LikeFilter.java @@ -20,7 +20,6 @@ package org.apache.druid.segment.filter; import com.google.common.collect.ImmutableSet; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.IAE; import org.apache.druid.query.extraction.ExtractionFn; import org.apache.druid.query.filter.ColumnIndexSelector; @@ -82,16 +81,14 @@ public BitmapColumnIndex getBitmapColumnIndex(ColumnIndexSelector selector) if (isSimpleEquals()) { StringValueSetIndexes valueIndexes = indexSupplier.as(StringValueSetIndexes.class); if (valueIndexes != null) { - return valueIndexes.forValue( - NullHandling.emptyToNullIfNeeded(likeMatcher.getPrefix()) - ); + return valueIndexes.forValue(likeMatcher.getPrefix()); } } if (isSimplePrefix()) { final LexicographicalRangeIndexes rangeIndexes = indexSupplier.as(LexicographicalRangeIndexes.class); if (rangeIndexes != null) { - final String lower = NullHandling.nullToEmptyIfNeeded(likeMatcher.getPrefix()); - final String upper = NullHandling.nullToEmptyIfNeeded(likeMatcher.getPrefix()) + Character.MAX_VALUE; + final String lower = likeMatcher.getPrefix(); + final String upper = likeMatcher.getPrefix() + Character.MAX_VALUE; if (likeMatcher.getSuffixMatch() == LikeDimFilter.LikeMatcher.SuffixMatch.MATCH_ANY) { return rangeIndexes.forRange(lower, false, upper, false); diff --git a/processing/src/main/java/org/apache/druid/segment/filter/NotFilter.java b/processing/src/main/java/org/apache/druid/segment/filter/NotFilter.java index e44cf2b57e44..52e66d561e86 100644 --- a/processing/src/main/java/org/apache/druid/segment/filter/NotFilter.java +++ b/processing/src/main/java/org/apache/druid/segment/filter/NotFilter.java @@ -19,7 +19,6 @@ package org.apache.druid.segment.filter; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.query.BitmapResultFactory; import org.apache.druid.query.filter.ColumnIndexSelector; @@ -44,10 +43,10 @@ /** * Nice filter you have there... NOT! * - * If {@link NullHandling#sqlCompatible()} is true, this filter inverts the {@code includeUnknown} flag to properly - * map Druids native two-valued logic (true, false) to SQL three-valued logic (true, false, unknown). At the top level, - * this flag is always passed in as 'false', and is only flipped by this filter. Other logical filters - * ({@link AndFilter} and {@link OrFilter}) propagate the value of {@code includeUnknown} to their children. + * This filter inverts the {@code includeUnknown} flag to properly ap Druids native two-valued logic (true, false) to + * SQL three-valued logic (true, false, unknown). At the top level, this flag is always passed in as 'false', and is + * only flipped by this filter. Other logical filters ({@link AndFilter} and {@link OrFilter}) propagate the value of + * {@code includeUnknown} to their children. * * For example, if the base filter is equality, by default value matchers and indexes only return true for the rows * that are equal to the value. When wrapped in a not filter, the not filter indicates that the equality matchers and @@ -71,7 +70,6 @@ public BitmapColumnIndex getBitmapColumnIndex(ColumnIndexSelector selector) if (baseIndex != null && baseIndex.getIndexCapabilities().isInvertible()) { return new BitmapColumnIndex() { - private final boolean useThreeValueLogic = NullHandling.useThreeValueLogic(); @Override public ColumnIndexCapabilities getIndexCapabilities() { @@ -88,7 +86,7 @@ public int estimatedComputeCost() public T computeBitmapResult(BitmapResultFactory bitmapResultFactory, boolean includeUnknown) { return bitmapResultFactory.complement( - baseIndex.computeBitmapResult(bitmapResultFactory, !includeUnknown && useThreeValueLogic), + baseIndex.computeBitmapResult(bitmapResultFactory, !includeUnknown), selector.getNumRows() ); } @@ -106,7 +104,7 @@ public T computeBitmapResult( bitmapResultFactory, applyRowCount, totalRowCount, - !includeUnknown && useThreeValueLogic + !includeUnknown ); if (result == null) { return null; @@ -125,11 +123,10 @@ public ValueMatcher makeMatcher(ColumnSelectorFactory factory) return new ValueMatcher() { - private final boolean useThreeValueLogic = NullHandling.useThreeValueLogic(); @Override public boolean matches(boolean includeUnknown) { - return !baseMatcher.matches(!includeUnknown && useThreeValueLogic); + return !baseMatcher.matches(!includeUnknown); } @Override @@ -148,12 +145,11 @@ public VectorValueMatcher makeVectorMatcher(final VectorColumnSelectorFactory fa return new BaseVectorValueMatcher(baseMatcher) { private final VectorMatch scratch = VectorMatch.wrap(new int[factory.getMaxVectorSize()]); - private final boolean useThreeValueLogic = NullHandling.useThreeValueLogic(); @Override public ReadableVectorMatch match(final ReadableVectorMatch mask, boolean includeUnknown) { - final ReadableVectorMatch baseMatch = baseMatcher.match(mask, !includeUnknown && useThreeValueLogic); + final ReadableVectorMatch baseMatch = baseMatcher.match(mask, !includeUnknown); scratch.copyFrom(mask); scratch.removeAll(baseMatch); diff --git a/processing/src/main/java/org/apache/druid/segment/filter/PredicateValueMatcherFactory.java b/processing/src/main/java/org/apache/druid/segment/filter/PredicateValueMatcherFactory.java index fdc50ed801f1..b17e25ff47cb 100644 --- a/processing/src/main/java/org/apache/druid/segment/filter/PredicateValueMatcherFactory.java +++ b/processing/src/main/java/org/apache/druid/segment/filter/PredicateValueMatcherFactory.java @@ -19,7 +19,6 @@ package org.apache.druid.segment.filter; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.Rows; import org.apache.druid.math.expr.ExprEval; import org.apache.druid.query.filter.DruidDoublePredicate; @@ -209,8 +208,7 @@ public boolean matches(boolean includeUnknown) } for (String rowValueString : rowValueStrings) { - final String coerced = NullHandling.emptyToNullIfNeeded(rowValueString); - if (getStringPredicate().apply(coerced).matches(includeUnknown)) { + if (getStringPredicate().apply(rowValueString).matches(includeUnknown)) { return true; } } diff --git a/processing/src/main/java/org/apache/druid/segment/filter/SelectorFilter.java b/processing/src/main/java/org/apache/druid/segment/filter/SelectorFilter.java index 9a7e1c3abe79..4e57354c5aff 100644 --- a/processing/src/main/java/org/apache/druid/segment/filter/SelectorFilter.java +++ b/processing/src/main/java/org/apache/druid/segment/filter/SelectorFilter.java @@ -20,7 +20,6 @@ package org.apache.druid.segment.filter; import com.google.common.collect.ImmutableSet; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.IAE; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.query.filter.ColumnIndexSelector; @@ -85,7 +84,7 @@ public BitmapColumnIndex getBitmapColumnIndex(ColumnIndexSelector selector) if (!Filters.checkFilterTuningUseIndex(dimension, selector, filterTuning)) { return null; } - final boolean isNull = NullHandling.isNullOrEquivalent(value); + final boolean isNull = value == null; final ColumnIndexSupplier indexSupplier = selector.getIndexSupplier(dimension); if (indexSupplier == null) { if (isNull) { diff --git a/processing/src/main/java/org/apache/druid/segment/filter/StringConstantValueMatcherFactory.java b/processing/src/main/java/org/apache/druid/segment/filter/StringConstantValueMatcherFactory.java index d4fd0a87e21b..a4a516b9140c 100644 --- a/processing/src/main/java/org/apache/druid/segment/filter/StringConstantValueMatcherFactory.java +++ b/processing/src/main/java/org/apache/druid/segment/filter/StringConstantValueMatcherFactory.java @@ -19,7 +19,6 @@ package org.apache.druid.segment.filter; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.filter.SelectorPredicateFactory; import org.apache.druid.query.filter.ValueMatcher; import org.apache.druid.segment.BaseDoubleColumnValueSelector; @@ -43,7 +42,7 @@ public class StringConstantValueMatcherFactory implements ColumnProcessorFactory StringConstantValueMatcherFactory(@Nullable String matchValue) { - this.matchValue = NullHandling.emptyToNullIfNeeded(matchValue); + this.matchValue = matchValue; } @Override diff --git a/processing/src/main/java/org/apache/druid/segment/filter/ValueMatchers.java b/processing/src/main/java/org/apache/druid/segment/filter/ValueMatchers.java index 344fbbb70cbf..40ebd1fe217e 100644 --- a/processing/src/main/java/org/apache/druid/segment/filter/ValueMatchers.java +++ b/processing/src/main/java/org/apache/druid/segment/filter/ValueMatchers.java @@ -19,7 +19,6 @@ package org.apache.druid.segment.filter; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.filter.DruidDoublePredicate; import org.apache.druid.query.filter.DruidFloatPredicate; import org.apache.druid.query.filter.DruidLongPredicate; @@ -90,11 +89,10 @@ public static ValueMatcher makeStringValueMatcher( final boolean hasMultipleValues ) { - final String constant = NullHandling.emptyToNullIfNeeded(value); final ConstantMatcherType matcherType = toConstantMatcherTypeIfPossible( selector, hasMultipleValues, - constant == null ? DruidObjectPredicate.isNull() : DruidObjectPredicate.equalTo(constant) + value == null ? DruidObjectPredicate.isNull() : DruidObjectPredicate.equalTo(value) ); if (matcherType != null) { return matcherType.asValueMatcher(); @@ -393,7 +391,7 @@ public boolean matches(boolean includeUnknown) return true; } for (int i = 0; i < size; i++) { - if (NullHandling.isNullOrEquivalent(selector.lookupName(row.get(i)))) { + if (selector.lookupName(row.get(i)) == null) { return true; } } diff --git a/processing/src/main/java/org/apache/druid/segment/incremental/IncrementalIndex.java b/processing/src/main/java/org/apache/druid/segment/incremental/IncrementalIndex.java index 9f8efaf73bc0..a07299154544 100644 --- a/processing/src/main/java/org/apache/druid/segment/incremental/IncrementalIndex.java +++ b/processing/src/main/java/org/apache/druid/segment/incremental/IncrementalIndex.java @@ -30,7 +30,6 @@ import com.google.common.primitives.Ints; import com.google.common.primitives.Longs; import com.google.errorprone.annotations.concurrent.GuardedBy; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.data.input.ListBasedInputRow; import org.apache.druid.data.input.MapBasedInputRow; @@ -1339,7 +1338,7 @@ public DoubleMetricColumnSelector( @Override public double getDouble() { - assert NullHandling.replaceWithDefault() || !isNull(); + assert !isNull(); return rowSelector.getMetricDoubleValue(currEntry.get().getRowIndex(), metricIndex); } diff --git a/processing/src/main/java/org/apache/druid/segment/index/BitmapColumnIndex.java b/processing/src/main/java/org/apache/druid/segment/index/BitmapColumnIndex.java index 97d24ff0babf..8ef83f979751 100644 --- a/processing/src/main/java/org/apache/druid/segment/index/BitmapColumnIndex.java +++ b/processing/src/main/java/org/apache/druid/segment/index/BitmapColumnIndex.java @@ -19,7 +19,6 @@ package org.apache.druid.segment.index; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.BitmapResultFactory; import org.apache.druid.segment.column.ColumnIndexCapabilities; @@ -52,7 +51,6 @@ public interface BitmapColumnIndex * @param includeUnknown mapping for Druid native two state logic system into SQL three-state logic system. If set * to true, bitmaps returned by this method should include true bits for any rows where * the matching result is 'unknown', such as from the input being null valued. - * See {@link NullHandling#useThreeValueLogic()}. * @return bitmap result representing rows matched by this index */ T computeBitmapResult( @@ -75,7 +73,7 @@ T computeBitmapResult( * @param includeUnknown mapping for Druid native two state logic system into SQL three-state logic system. If * set to true, bitmaps returned by this method should include true bits for any rows where * the matching result is 'unknown', such as from the input being null valued. - * See {@link NullHandling#useThreeValueLogic()}. + * * @return bitmap result representing rows matched by this index */ @Nullable diff --git a/processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java b/processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java index 60e67e22d36b..4ca1140ea767 100644 --- a/processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java +++ b/processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8LexicographicalRangeIndexes.java @@ -25,7 +25,6 @@ import it.unimi.dsi.fastutil.ints.IntIterator; import org.apache.druid.collections.bitmap.BitmapFactory; import org.apache.druid.collections.bitmap.ImmutableBitmap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.query.filter.DruidObjectPredicate; import org.apache.druid.query.filter.DruidPredicateMatch; @@ -100,7 +99,7 @@ public ImmutableBitmap next() @Override protected ImmutableBitmap getUnknownsBitmap() { - if (NullHandling.isNullOrEquivalent(dictionary.get(0))) { + if (dictionary.get(0) == null) { return bitmaps.get(0); } return null; @@ -172,7 +171,7 @@ public ImmutableBitmap next() @Override protected ImmutableBitmap getUnknownsBitmap() { - if (NullHandling.isNullOrEquivalent(dictionary.get(0))) { + if (dictionary.get(0) == null) { return bitmaps.get(0); } return null; @@ -202,8 +201,7 @@ private IntIntPair getRange( if (startValue == null) { startIndex = firstValue; } else { - final String startValueToUse = NullHandling.emptyToNullIfNeeded(startValue); - final int found = dictionary.indexOf(StringUtils.toUtf8ByteBuffer(startValueToUse)); + final int found = dictionary.indexOf(StringUtils.toUtf8ByteBuffer(startValue)); if (found >= firstValue) { startIndex = startStrict ? found + 1 : found; } else { @@ -214,8 +212,7 @@ private IntIntPair getRange( if (endValue == null) { endIndex = dictionary.size(); } else { - final String endValueToUse = NullHandling.emptyToNullIfNeeded(endValue); - final int found = dictionary.indexOf(StringUtils.toUtf8ByteBuffer(endValueToUse)); + final int found = dictionary.indexOf(StringUtils.toUtf8ByteBuffer(endValue)); if (found >= firstValue) { endIndex = endStrict ? found : found + 1; } else { diff --git a/processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8ValueIndexes.java b/processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8ValueIndexes.java index a9819fd75cb3..e0ca5f5780b8 100644 --- a/processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8ValueIndexes.java +++ b/processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8ValueIndexes.java @@ -26,7 +26,6 @@ import org.apache.druid.annotations.SuppressFBWarnings; import org.apache.druid.collections.bitmap.BitmapFactory; import org.apache.druid.collections.bitmap.ImmutableBitmap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.ByteBufferUtils; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.math.expr.ExprEval; @@ -92,7 +91,7 @@ public int estimatedComputeCost() @Override public T computeBitmapResult(BitmapResultFactory bitmapResultFactory, boolean includeUnknown) { - if (includeUnknown && NullHandling.isNullOrEquivalent(dictionary.get(0))) { + if (includeUnknown && dictionary.get(0) == null) { return bitmapResultFactory.unionDimensionValueBitmaps( ImmutableList.of(getBitmapForValue(), getBitmap(0)) ); @@ -187,7 +186,7 @@ private BitmapColumnIndex getBitmapColumnIndexForSortedIterableUtf8( dictionary, bitmaps, () -> { - if (!valuesContainsNull && NullHandling.isNullOrEquivalent(dictionary.get(0))) { + if (!valuesContainsNull && dictionary.get(0) == null) { return bitmaps.get(0); } return null; @@ -204,7 +203,7 @@ private BitmapColumnIndex getBitmapColumnIndexForSortedIterableUtf8( dictionary, bitmaps, () -> { - if (!valuesContainsNull && NullHandling.isNullOrEquivalent(dictionary.get(0))) { + if (!valuesContainsNull && dictionary.get(0) == null) { return bitmaps.get(0); } return null; diff --git a/processing/src/main/java/org/apache/druid/segment/join/PossiblyNullColumnValueSelector.java b/processing/src/main/java/org/apache/druid/segment/join/PossiblyNullColumnValueSelector.java index 483ebbe5d1d4..d67265d59de8 100644 --- a/processing/src/main/java/org/apache/druid/segment/join/PossiblyNullColumnValueSelector.java +++ b/processing/src/main/java/org/apache/druid/segment/join/PossiblyNullColumnValueSelector.java @@ -19,7 +19,6 @@ package org.apache.druid.segment.join; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector; import org.apache.druid.segment.ColumnValueSelector; @@ -34,32 +33,29 @@ public class PossiblyNullColumnValueSelector implements ColumnValueSelector baseSelector; private final BooleanSupplier beNull; - @Nullable - private final T nullValue; PossiblyNullColumnValueSelector(final ColumnValueSelector baseSelector, final BooleanSupplier beNull) { this.baseSelector = baseSelector; this.beNull = beNull; - this.nullValue = NullHandling.defaultValueForClass(baseSelector.classOfObject()); } @Override public double getDouble() { - return beNull.getAsBoolean() ? NullHandling.ZERO_DOUBLE : baseSelector.getDouble(); + return beNull.getAsBoolean() ? 0.0d : baseSelector.getDouble(); } @Override public float getFloat() { - return beNull.getAsBoolean() ? NullHandling.ZERO_FLOAT : baseSelector.getFloat(); + return beNull.getAsBoolean() ? 0.0f : baseSelector.getFloat(); } @Override public long getLong() { - return beNull.getAsBoolean() ? NullHandling.ZERO_LONG : baseSelector.getLong(); + return beNull.getAsBoolean() ? 0L : baseSelector.getLong(); } @Override @@ -73,7 +69,7 @@ public void inspectRuntimeShape(RuntimeShapeInspector inspector) @Override public T getObject() { - return beNull.getAsBoolean() ? nullValue : baseSelector.getObject(); + return beNull.getAsBoolean() ? null : baseSelector.getObject(); } @Override diff --git a/processing/src/main/java/org/apache/druid/segment/join/lookup/LookupJoinMatcher.java b/processing/src/main/java/org/apache/druid/segment/join/lookup/LookupJoinMatcher.java index 235ffd7c4dbc..1f3dcb8bb2f0 100644 --- a/processing/src/main/java/org/apache/druid/segment/join/lookup/LookupJoinMatcher.java +++ b/processing/src/main/java/org/apache/druid/segment/join/lookup/LookupJoinMatcher.java @@ -21,7 +21,6 @@ import com.google.common.base.Preconditions; import com.google.common.collect.Iterators; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.guava.SettableSupplier; import org.apache.druid.java.util.common.IAE; import org.apache.druid.java.util.common.Pair; @@ -86,31 +85,19 @@ public Supplier makeDimensionProcessor(DimensionSelector selector, boole @Override public Supplier makeFloatProcessor(BaseFloatColumnValueSelector selector) { - if (NullHandling.replaceWithDefault()) { - return () -> DimensionHandlerUtils.convertObjectToString(selector.getFloat()); - } else { - return () -> selector.isNull() ? null : DimensionHandlerUtils.convertObjectToString(selector.getFloat()); - } + return () -> selector.isNull() ? null : DimensionHandlerUtils.convertObjectToString(selector.getFloat()); } @Override public Supplier makeDoubleProcessor(BaseDoubleColumnValueSelector selector) { - if (NullHandling.replaceWithDefault()) { - return () -> DimensionHandlerUtils.convertObjectToString(selector.getDouble()); - } else { - return () -> selector.isNull() ? null : DimensionHandlerUtils.convertObjectToString(selector.getDouble()); - } + return () -> selector.isNull() ? null : DimensionHandlerUtils.convertObjectToString(selector.getDouble()); } @Override public Supplier makeLongProcessor(BaseLongColumnValueSelector selector) { - if (NullHandling.replaceWithDefault()) { - return () -> DimensionHandlerUtils.convertObjectToString(selector.getLong()); - } else { - return () -> selector.isNull() ? null : DimensionHandlerUtils.convertObjectToString(selector.getLong()); - } + return () -> selector.isNull() ? null : DimensionHandlerUtils.convertObjectToString(selector.getLong()); } @Override diff --git a/processing/src/main/java/org/apache/druid/segment/join/lookup/LookupJoinable.java b/processing/src/main/java/org/apache/druid/segment/join/lookup/LookupJoinable.java index f0c9a34526d0..34886b16cf91 100644 --- a/processing/src/main/java/org/apache/druid/segment/join/lookup/LookupJoinable.java +++ b/processing/src/main/java/org/apache/druid/segment/join/lookup/LookupJoinable.java @@ -22,7 +22,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Sets; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.io.Closer; import org.apache.druid.query.filter.InDimFilter; import org.apache.druid.query.lookup.LookupExtractor; @@ -109,9 +108,6 @@ public ColumnValuesWithUniqueFlag getMatchableColumnValues(String columnName, bo } else { nonMatchingValues = new HashSet<>(); nonMatchingValues.add(null); - if (NullHandling.replaceWithDefault()) { - nonMatchingValues.add(NullHandling.defaultStringValue()); - } } // size() of Sets.difference is slow; avoid it. diff --git a/processing/src/main/java/org/apache/druid/segment/join/table/IndexedTableColumnValueSelector.java b/processing/src/main/java/org/apache/druid/segment/join/table/IndexedTableColumnValueSelector.java index e59b412a6247..70c07b783142 100644 --- a/processing/src/main/java/org/apache/druid/segment/join/table/IndexedTableColumnValueSelector.java +++ b/processing/src/main/java/org/apache/druid/segment/join/table/IndexedTableColumnValueSelector.java @@ -19,7 +19,7 @@ package org.apache.druid.segment.join.table; -import org.apache.druid.common.config.NullHandling; +import org.apache.druid.error.DruidException; import org.apache.druid.java.util.common.io.Closer; import org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector; import org.apache.druid.segment.ColumnValueSelector; @@ -52,10 +52,8 @@ public double getDouble() } } - // Otherwise this shouldn't have been called (due to isNull returning true). - assert NullHandling.replaceWithDefault(); - //noinspection ConstantConditions assert statement above guarantees this is non null. - return NullHandling.defaultDoubleValue(); + assert !isNull(); + throw DruidException.defensive("Called getDouble on a non-numeric value"); } @Override @@ -71,10 +69,8 @@ public float getFloat() } } - // Otherwise this shouldn't have been called (due to isNull returning true). - assert NullHandling.replaceWithDefault(); - //noinspection ConstantConditions assert statement above guarantees this is non null. - return NullHandling.defaultFloatValue(); + assert !isNull(); + throw DruidException.defensive("Called getFloat on a non-numeric value"); } @Override @@ -90,10 +86,8 @@ public long getLong() } } - // Otherwise this shouldn't have been called (due to isNull returning true). - assert NullHandling.replaceWithDefault(); - //noinspection ConstantConditions assert statement above guarantees this is non null. - return NullHandling.defaultLongValue(); + assert !isNull(); + throw DruidException.defensive("Called getLong on a non-numeric value"); } @Override diff --git a/processing/src/main/java/org/apache/druid/segment/join/table/IndexedTableJoinMatcher.java b/processing/src/main/java/org/apache/druid/segment/join/table/IndexedTableJoinMatcher.java index 3f3c75770f0b..4ad151dbfc8a 100644 --- a/processing/src/main/java/org/apache/druid/segment/join/table/IndexedTableJoinMatcher.java +++ b/processing/src/main/java/org/apache/druid/segment/join/table/IndexedTableJoinMatcher.java @@ -31,7 +31,6 @@ import it.unimi.dsi.fastutil.ints.IntSortedSet; import it.unimi.dsi.fastutil.ints.IntSortedSets; import org.apache.druid.collections.RangeIntSet; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.IAE; import org.apache.druid.java.util.common.Pair; import org.apache.druid.java.util.common.io.Closer; @@ -394,7 +393,7 @@ static class ConditionMatcherFactory implements ColumnProcessorFactory index.find(selector.getFloat()); - } else if (includeNull) { + if (includeNull) { return () -> selector.isNull() ? index.find(null) : index.find(selector.getFloat()); } else { return () -> selector.isNull() ? IntSortedSets.EMPTY_SET : index.find(selector.getFloat()); @@ -474,9 +471,7 @@ public ConditionMatcher makeFloatProcessor(BaseFloatColumnValueSelector selector @Override public ConditionMatcher makeDoubleProcessor(BaseDoubleColumnValueSelector selector) { - if (NullHandling.replaceWithDefault()) { - return () -> index.find(selector.getDouble()); - } else if (includeNull) { + if (includeNull) { return () -> selector.isNull() ? index.find(null) : index.find(selector.getDouble()); } else { return () -> selector.isNull() ? IntSortedSets.EMPTY_SET : index.find(selector.getDouble()); @@ -488,8 +483,6 @@ public ConditionMatcher makeLongProcessor(BaseLongColumnValueSelector selector) { if (index.keyType().is(ValueType.LONG)) { return makePrimitiveLongMatcher(selector); - } else if (NullHandling.replaceWithDefault()) { - return () -> index.find(selector.getLong()); } else if (includeNull) { return () -> selector.isNull() ? index.find(null) : index.find(selector.getLong()); } else { @@ -533,22 +526,7 @@ public IntSortedSet match() */ private ConditionMatcher makePrimitiveLongMatcher(BaseLongColumnValueSelector selector) { - if (NullHandling.replaceWithDefault()) { - return new ConditionMatcher() - { - @Override - public int matchSingleRow() - { - return index.findUniqueLong(selector.getLong()); - } - - @Override - public IntSortedSet match() - { - return index.find(selector.getLong()); - } - }; - } else if (includeNull) { + if (includeNull) { return new ConditionMatcher() { @Override diff --git a/processing/src/main/java/org/apache/druid/segment/join/table/IndexedTableJoinable.java b/processing/src/main/java/org/apache/druid/segment/join/table/IndexedTableJoinable.java index 10384b373a6b..911e7f403535 100644 --- a/processing/src/main/java/org/apache/druid/segment/join/table/IndexedTableJoinable.java +++ b/processing/src/main/java/org/apache/druid/segment/join/table/IndexedTableJoinable.java @@ -22,7 +22,6 @@ import com.google.common.collect.ImmutableSet; import it.unimi.dsi.fastutil.ints.IntBidirectionalIterator; import it.unimi.dsi.fastutil.ints.IntSortedSet; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.io.Closer; import org.apache.druid.query.filter.InDimFilter; import org.apache.druid.segment.ColumnSelectorFactory; @@ -105,7 +104,7 @@ public ColumnValuesWithUniqueFlag getMatchableColumnValues(String columnName, bo for (int i = 0; i < table.numRows(); i++) { final String s = DimensionHandlerUtils.convertObjectToString(reader.read(i)); - if (includeNull || !NullHandling.isNullOrEquivalent(s)) { + if (includeNull || s != null) { if (!matchableValues.add(s)) { // Duplicate found allUnique = false; diff --git a/processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSerializer.java b/processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSerializer.java index 57802fdd3d25..3dcef1d2d85b 100644 --- a/processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSerializer.java +++ b/processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSerializer.java @@ -23,7 +23,6 @@ import com.google.common.collect.Maps; import org.apache.druid.collections.bitmap.ImmutableBitmap; import org.apache.druid.collections.bitmap.MutableBitmap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; import org.apache.druid.java.util.common.io.Closer; import org.apache.druid.java.util.common.io.smoosh.FileSmoosher; @@ -349,7 +348,6 @@ public void serializeDictionaries( // null is always 0 dictionaryWriter.write(null); for (String value : strings) { - value = NullHandling.emptyToNullIfNeeded(value); if (value == null) { continue; } diff --git a/processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSerializerV4.java b/processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSerializerV4.java index 87240f3fadc0..c30559dd43f0 100644 --- a/processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSerializerV4.java +++ b/processing/src/main/java/org/apache/druid/segment/nested/NestedDataColumnSerializerV4.java @@ -23,7 +23,6 @@ import com.google.common.collect.Maps; import org.apache.druid.collections.bitmap.ImmutableBitmap; import org.apache.druid.collections.bitmap.MutableBitmap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.FileUtils; import org.apache.druid.java.util.common.ISE; import org.apache.druid.java.util.common.RE; @@ -276,7 +275,6 @@ public void serializeDictionaries( // null is always 0 dictionaryWriter.write(null); for (String value : strings) { - value = NullHandling.emptyToNullIfNeeded(value); if (value == null) { continue; } diff --git a/processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java b/processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java index 3947013274c5..8b78c76c3434 100644 --- a/processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java +++ b/processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java @@ -39,7 +39,6 @@ import org.apache.druid.annotations.SuppressFBWarnings; import org.apache.druid.collections.bitmap.BitmapFactory; import org.apache.druid.collections.bitmap.ImmutableBitmap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.guava.GuavaUtils; import org.apache.druid.error.DruidException; import org.apache.druid.java.util.common.StringUtils; @@ -512,9 +511,9 @@ public BitmapColumnIndex forRange( ) { return makeRangeIndex( - StringUtils.toUtf8ByteBuffer(NullHandling.emptyToNullIfNeeded(startValue)), + StringUtils.toUtf8ByteBuffer(startValue), startStrict, - StringUtils.toUtf8ByteBuffer(NullHandling.emptyToNullIfNeeded(endValue)), + StringUtils.toUtf8ByteBuffer(endValue), endStrict, localDictionarySupplier.get(), globalStringDictionarySupplier.get(), diff --git a/processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumn.java b/processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumn.java index 527819cb47d7..d1b4b8c73f75 100644 --- a/processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumn.java +++ b/processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumn.java @@ -21,7 +21,6 @@ import org.apache.druid.collections.bitmap.BitmapFactory; import org.apache.druid.collections.bitmap.ImmutableBitmap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.semantic.SemanticUtils; import org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector; import org.apache.druid.segment.ColumnValueSelector; @@ -110,9 +109,6 @@ public void inspectRuntimeShape(RuntimeShapeInspector inspector) @Override public boolean isNull() { - if (NullHandling.replaceWithDefault()) { - return false; - } final int i = offset.getOffset(); if (i < offsetMark) { // offset was reset, reset iterator state @@ -156,9 +152,6 @@ public double[] getDoubleVector() @Override public boolean[] getNullVector() { - if (NullHandling.replaceWithDefault()) { - return null; - } computeVectorsIfNeeded(); return nullVector; } diff --git a/processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java b/processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java index 8d1dd4227730..6f7e2f8a2905 100644 --- a/processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java +++ b/processing/src/main/java/org/apache/druid/segment/nested/ScalarDoubleColumnAndIndexSupplier.java @@ -32,7 +32,6 @@ import org.apache.druid.annotations.SuppressFBWarnings; import org.apache.druid.collections.bitmap.BitmapFactory; import org.apache.druid.collections.bitmap.ImmutableBitmap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.RE; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.java.util.common.io.smoosh.SmooshedFileMapper; @@ -218,12 +217,7 @@ public NestedCommonFormatColumn get() public T as(Class clazz) { if (clazz.equals(NullValueIndex.class)) { - final BitmapColumnIndex nullIndex; - if (NullHandling.replaceWithDefault()) { - nullIndex = new SimpleImmutableBitmapIndex(bitmapFactory.makeEmptyImmutableBitmap()); - } else { - nullIndex = new SimpleImmutableBitmapIndex(nullValueBitmap); - } + final BitmapColumnIndex nullIndex = new SimpleImmutableBitmapIndex(nullValueBitmap); return (T) (NullValueIndex) () -> nullIndex; } else if (clazz.equals(ValueIndexes.class)) { return (T) new DoubleValueIndexes(); @@ -377,7 +371,6 @@ public BitmapColumnIndex forValue(@Nullable String value) final boolean inputNull = value == null; final Double doubleValue = Strings.isNullOrEmpty(value) ? null : Doubles.tryParse(value); final FixedIndexed dictionary = doubleDictionarySupplier.get(); - int defaultValueIndex = dictionary.indexOf(NullHandling.defaultDoubleValue()); return new SimpleBitmapColumnIndex() { @@ -391,24 +384,13 @@ public int estimatedComputeCost() public T computeBitmapResult(BitmapResultFactory bitmapResultFactory, boolean includeUnknown) { if (doubleValue == null) { - if (inputNull && NullHandling.sqlCompatible()) { + if (inputNull) { return bitmapResultFactory.wrapDimensionValue(getBitmap(0)); } else { // input was not null but not a double... no match return bitmapResultFactory.wrapDimensionValue(bitmapFactory.makeEmptyImmutableBitmap()); } } - if (NullHandling.replaceWithDefault() && doubleValue.equals(NullHandling.defaultDoubleValue())) { - if (defaultValueIndex >= 0) { - return bitmapResultFactory.unionDimensionValueBitmaps( - ImmutableList.of( - getBitmap(0), - getBitmap(defaultValueIndex) - ) - ); - } - return bitmapResultFactory.wrapDimensionValue(getBitmap(0)); - } final int id = dictionary.indexOf(doubleValue); if (includeUnknown) { if (id < 0) { @@ -449,10 +431,6 @@ public Iterable getBitmapIterable() Double theValue = Doubles.tryParse(value); if (theValue != null) { doubles.add(theValue.doubleValue()); - // add null value index in default value mode - if (NullHandling.replaceWithDefault() && theValue.equals(NullHandling.defaultDoubleValue())) { - needNullCheck = true; - } } } } @@ -623,11 +601,7 @@ private void findNext() Double nextValue = iterator.next(); index++; if (nextValue == null) { - if (NullHandling.sqlCompatible()) { - nextSet = doublePredicate.applyNull().matches(includeUnknown); - } else { - nextSet = doublePredicate.applyDouble(NullHandling.defaultDoubleValue()).matches(includeUnknown); - } + nextSet = doublePredicate.applyNull().matches(includeUnknown); } else { nextSet = doublePredicate.applyDouble(nextValue).matches(includeUnknown); } diff --git a/processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumn.java b/processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumn.java index 54a7812da760..6630a5500705 100644 --- a/processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumn.java +++ b/processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumn.java @@ -21,7 +21,6 @@ import org.apache.druid.collections.bitmap.BitmapFactory; import org.apache.druid.collections.bitmap.ImmutableBitmap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.semantic.SemanticUtils; import org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector; import org.apache.druid.segment.ColumnValueSelector; @@ -111,9 +110,6 @@ public void inspectRuntimeShape(RuntimeShapeInspector inspector) @Override public boolean isNull() { - if (NullHandling.replaceWithDefault()) { - return false; - } final int i = offset.getOffset(); if (i < offsetMark) { // offset was reset, reset iterator state @@ -157,9 +153,6 @@ public long[] getLongVector() @Override public boolean[] getNullVector() { - if (NullHandling.replaceWithDefault()) { - return null; - } computeVectorsIfNeeded(); return nullVector; } diff --git a/processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java b/processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java index 5a55a5f7c145..063dc2bfb9c0 100644 --- a/processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java +++ b/processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java @@ -30,7 +30,6 @@ import org.apache.druid.annotations.SuppressFBWarnings; import org.apache.druid.collections.bitmap.BitmapFactory; import org.apache.druid.collections.bitmap.ImmutableBitmap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.guava.GuavaUtils; import org.apache.druid.java.util.common.RE; import org.apache.druid.java.util.common.StringUtils; @@ -218,12 +217,7 @@ public NestedCommonFormatColumn get() public T as(Class clazz) { if (clazz.equals(NullValueIndex.class)) { - final BitmapColumnIndex nullIndex; - if (NullHandling.replaceWithDefault()) { - nullIndex = new SimpleImmutableBitmapIndex(bitmapFactory.makeEmptyImmutableBitmap()); - } else { - nullIndex = new SimpleImmutableBitmapIndex(nullValueBitmap); - } + final BitmapColumnIndex nullIndex = new SimpleImmutableBitmapIndex(nullValueBitmap); return (T) (NullValueIndex) () -> nullIndex; } else if (clazz.equals(ValueIndexes.class)) { return (T) new LongValueIndexes(); @@ -372,7 +366,6 @@ public BitmapColumnIndex forSortedValues(@Nonnull List sortedValues, TypeSign private class LongStringValueSetIndexes implements StringValueSetIndexes { final FixedIndexed dictionary = longDictionarySupplier.get(); - int defaultValueIndex = dictionary.indexOf(NullHandling.defaultLongValue()); @Override public BitmapColumnIndex forValue(@Nullable String value) @@ -391,23 +384,12 @@ public int estimatedComputeCost() public T computeBitmapResult(BitmapResultFactory bitmapResultFactory, boolean includeUnknown) { if (longValue == null) { - if (inputNull && NullHandling.sqlCompatible()) { + if (inputNull) { return bitmapResultFactory.wrapDimensionValue(getBitmap(0)); } else { return bitmapResultFactory.wrapDimensionValue(bitmapFactory.makeEmptyImmutableBitmap()); } } - if (NullHandling.replaceWithDefault() && longValue.equals(NullHandling.defaultLongValue())) { - if (defaultValueIndex >= 0) { - return bitmapResultFactory.unionDimensionValueBitmaps( - ImmutableList.of( - getBitmap(0), - getBitmap(defaultValueIndex) - ) - ); - } - return bitmapResultFactory.wrapDimensionValue(getBitmap(0)); - } final int id = dictionary.indexOf(longValue); if (includeUnknown) { if (id < 0) { @@ -448,9 +430,6 @@ public Iterable getBitmapIterable() Long theValue = DimensionHandlerUtils.convertObjectToLong(value); if (theValue != null) { longs.add(theValue.longValue()); - if (NullHandling.replaceWithDefault() && theValue.equals(NullHandling.defaultLongValue())) { - needNullCheck = true; - } } } } @@ -633,11 +612,7 @@ private void findNext() Long nextValue = iterator.next(); index++; if (nextValue == null) { - if (NullHandling.sqlCompatible()) { - nextSet = longPredicate.applyNull().matches(includeUnknown); - } else { - nextSet = longPredicate.applyLong(NullHandling.defaultLongValue()).matches(includeUnknown); - } + nextSet = longPredicate.applyNull().matches(includeUnknown); } else { nextSet = longPredicate.applyLong(nextValue).matches(includeUnknown); } diff --git a/processing/src/main/java/org/apache/druid/segment/nested/ScalarStringColumnSerializer.java b/processing/src/main/java/org/apache/druid/segment/nested/ScalarStringColumnSerializer.java index 5a335a312b47..55a62512389b 100644 --- a/processing/src/main/java/org/apache/druid/segment/nested/ScalarStringColumnSerializer.java +++ b/processing/src/main/java/org/apache/druid/segment/nested/ScalarStringColumnSerializer.java @@ -19,7 +19,6 @@ package org.apache.druid.segment.nested; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.ISE; import org.apache.druid.java.util.common.io.Closer; import org.apache.druid.java.util.common.io.smoosh.FileSmoosher; @@ -103,7 +102,6 @@ public void serializeDictionaries( // null is always 0 dictionaryWriter.write(null); for (String value : strings) { - value = NullHandling.emptyToNullIfNeeded(value); if (value == null) { continue; } diff --git a/processing/src/main/java/org/apache/druid/segment/nested/ScalarStringFieldColumnWriter.java b/processing/src/main/java/org/apache/druid/segment/nested/ScalarStringFieldColumnWriter.java index fa4306801452..b6ac6aba1698 100644 --- a/processing/src/main/java/org/apache/druid/segment/nested/ScalarStringFieldColumnWriter.java +++ b/processing/src/main/java/org/apache/druid/segment/nested/ScalarStringFieldColumnWriter.java @@ -19,7 +19,6 @@ package org.apache.druid.segment.nested; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.io.smoosh.FileSmoosher; import org.apache.druid.segment.IndexSpec; import org.apache.druid.segment.writeout.SegmentWriteOutMedium; @@ -49,7 +48,7 @@ String processValue(int row, Object value) if (value == null) { return null; } - return NullHandling.emptyToNullIfNeeded(String.valueOf(value)); + return String.valueOf(value); } @Override diff --git a/processing/src/main/java/org/apache/druid/segment/nested/ValueDictionary.java b/processing/src/main/java/org/apache/druid/segment/nested/ValueDictionary.java index e4827ad43729..028b83aa44ba 100644 --- a/processing/src/main/java/org/apache/druid/segment/nested/ValueDictionary.java +++ b/processing/src/main/java/org/apache/druid/segment/nested/ValueDictionary.java @@ -20,7 +20,6 @@ package org.apache.druid.segment.nested; import com.google.common.base.Preconditions; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector; import org.apache.druid.segment.AutoTypeColumnIndexer; import org.apache.druid.segment.ComparatorDimensionDictionary; @@ -82,12 +81,6 @@ public long estimateSizeOfValue(Double value) this.stringArrays = new TreeSet<>(ColumnType.STRING_ARRAY.getNullableStrategy()); this.longArrays = new TreeSet<>(ColumnType.LONG_ARRAY.getNullableStrategy()); this.doubleArrays = new TreeSet<>(ColumnType.DOUBLE_ARRAY.getNullableStrategy()); - - // always add default values in default value mode. they don't cost much even if they aren't used - if (NullHandling.replaceWithDefault()) { - longDictionary.add(NullHandling.defaultLongValue()); - doubleDictionary.add(NullHandling.defaultDoubleValue()); - } } public int addLongValue(@Nullable Long value) diff --git a/processing/src/main/java/org/apache/druid/segment/nested/VariantColumnSerializer.java b/processing/src/main/java/org/apache/druid/segment/nested/VariantColumnSerializer.java index 6724c69b73a4..0073e595dd73 100644 --- a/processing/src/main/java/org/apache/druid/segment/nested/VariantColumnSerializer.java +++ b/processing/src/main/java/org/apache/druid/segment/nested/VariantColumnSerializer.java @@ -23,7 +23,6 @@ import it.unimi.dsi.fastutil.ints.IntIterator; import org.apache.druid.collections.bitmap.ImmutableBitmap; import org.apache.druid.collections.bitmap.MutableBitmap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; import org.apache.druid.java.util.common.IAE; import org.apache.druid.java.util.common.ISE; @@ -206,7 +205,6 @@ public void serializeDictionaries( // null is always 0 dictionaryWriter.write(null); for (String value : strings) { - value = NullHandling.emptyToNullIfNeeded(value); if (value == null) { continue; } diff --git a/processing/src/main/java/org/apache/druid/segment/selector/settable/SettableDoubleColumnValueSelector.java b/processing/src/main/java/org/apache/druid/segment/selector/settable/SettableDoubleColumnValueSelector.java index 55c036188bdf..bdaef719dea8 100644 --- a/processing/src/main/java/org/apache/druid/segment/selector/settable/SettableDoubleColumnValueSelector.java +++ b/processing/src/main/java/org/apache/druid/segment/selector/settable/SettableDoubleColumnValueSelector.java @@ -19,7 +19,6 @@ package org.apache.druid.segment.selector.settable; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.segment.ColumnValueSelector; import org.apache.druid.segment.DoubleColumnSelector; @@ -42,7 +41,7 @@ public void setValueFrom(ColumnValueSelector selector) @Override public double getDouble() { - assert NullHandling.replaceWithDefault() || !isNull; + assert !isNull; return value; } diff --git a/processing/src/main/java/org/apache/druid/segment/selector/settable/SettableFloatColumnValueSelector.java b/processing/src/main/java/org/apache/druid/segment/selector/settable/SettableFloatColumnValueSelector.java index 54efd6fa8063..6ec85d336e89 100644 --- a/processing/src/main/java/org/apache/druid/segment/selector/settable/SettableFloatColumnValueSelector.java +++ b/processing/src/main/java/org/apache/druid/segment/selector/settable/SettableFloatColumnValueSelector.java @@ -19,7 +19,6 @@ package org.apache.druid.segment.selector.settable; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.segment.ColumnValueSelector; import org.apache.druid.segment.FloatColumnSelector; @@ -42,7 +41,7 @@ public void setValueFrom(ColumnValueSelector selector) @Override public float getFloat() { - assert NullHandling.replaceWithDefault() || !isNull; + assert !isNull; return value; } diff --git a/processing/src/main/java/org/apache/druid/segment/selector/settable/SettableLongColumnValueSelector.java b/processing/src/main/java/org/apache/druid/segment/selector/settable/SettableLongColumnValueSelector.java index 8445c000fb4a..38986105e37a 100644 --- a/processing/src/main/java/org/apache/druid/segment/selector/settable/SettableLongColumnValueSelector.java +++ b/processing/src/main/java/org/apache/druid/segment/selector/settable/SettableLongColumnValueSelector.java @@ -19,7 +19,6 @@ package org.apache.druid.segment.selector.settable; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.segment.ColumnValueSelector; import org.apache.druid.segment.LongColumnSelector; @@ -48,7 +47,7 @@ public void setValue(long value) @Override public long getLong() { - assert NullHandling.replaceWithDefault() || !isNull; + assert !isNull; return value; } diff --git a/processing/src/main/java/org/apache/druid/segment/serde/CombineFirstTwoEntriesIndexed.java b/processing/src/main/java/org/apache/druid/segment/serde/CombineFirstTwoEntriesIndexed.java deleted file mode 100644 index 539b89acf16f..000000000000 --- a/processing/src/main/java/org/apache/druid/segment/serde/CombineFirstTwoEntriesIndexed.java +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.druid.segment.serde; - -import com.google.common.collect.ImmutableList; -import org.apache.druid.collections.bitmap.BitmapFactory; -import org.apache.druid.collections.bitmap.ImmutableBitmap; -import org.apache.druid.common.config.NullHandling; -import org.apache.druid.java.util.common.ISE; -import org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector; -import org.apache.druid.segment.data.Indexed; - -import javax.annotation.Nullable; -import java.util.Iterator; -import java.util.Objects; - -/** - * An {@link Indexed} that delegates to an underyling instance, but combines the first two entries. - * - * Unlike {@link CombineFirstTwoValuesIndexedInts}, this class combines the first two *entries*. - * So [0, 1, 2] becomes [(something), 2]. The first two entries, 0 and 1, were replaced with (something). That something - * is given by {@link #newFirstValue()}. - * - * Provided to enable compatibility for segments written under {@link NullHandling#sqlCompatible()} mode but - * read under {@link NullHandling#replaceWithDefault()} mode. - * - * Important note: {@link #isSorted()} returns the same value as the underlying delegate. In this case, this class - * assumes that {@link #newFirstValue()} is the lowest possible value in the universe: including anything in - * {@link #delegate} and anything that might be passed to {@link #indexOf(Object)}. Callers must ensure that this - * precondition is met. - * - * @see NullHandling#mustCombineNullAndEmptyInDictionary(Indexed) - */ -public abstract class CombineFirstTwoEntriesIndexed implements Indexed -{ - private static final int FIRST_ID = 0; - - protected final Indexed delegate; - - protected CombineFirstTwoEntriesIndexed(Indexed delegate) - { - this.delegate = delegate; - - if (delegate.size() < 2) { - throw new ISE("Size[%s] must be >= 2", delegate.size()); - } - } - - /** - * Combine the first two values into a literal null. - */ - public static CombineFirstTwoEntriesIndexed returnNull(final Indexed delegate) - { - return new CombineFirstTwoEntriesIndexed<>(delegate) - { - @Nullable - @Override - protected T newFirstValue() - { - return null; - } - }; - } - - /** - * Union the first two bitmaps. - */ - public static CombineFirstTwoEntriesIndexed unionBitmaps( - final BitmapFactory bitmapFactory, - final Indexed delegate - ) - { - return new CombineFirstTwoEntriesIndexed<>(delegate) - { - @Nullable - @Override - protected ImmutableBitmap newFirstValue() - { - return bitmapFactory.union(ImmutableList.of(delegate.get(FIRST_ID), delegate.get(FIRST_ID + 1))); - } - }; - } - - @Nullable - protected abstract T newFirstValue(); - - @Override - public int size() - { - return delegate.size() - 1; - } - - @Nullable - @Override - public T get(int index) - { - if (index == FIRST_ID) { - return newFirstValue(); - } else { - return delegate.get(index + 1); - } - } - - @Override - public int indexOf(@Nullable T value) - { - if (Objects.equals(newFirstValue(), value)) { - return FIRST_ID; - } else { - final int index = delegate.indexOf(value); - - if (index > FIRST_ID + 1) { - // Item found, index needs adjustment. - return index - 1; - } else if (index >= 0) { - // Item found, but shadowed, so really not found. - // Insertion point is after FIRST_ID. (See class-level javadoc: newFirstValue is required to be - // lower than all elements in the universe.) - return -2; - } else if (index >= -2) { - // Item not found, and insertion point is prior to, or within, the shadowed portion of delegate. Return - // insertion point immediately after newFirstValue, since that value is required to be lower than all elements - // in the universe. - return -2; - } else { - // Item not found, and insertion point is after the shadowed portion of delegate. Adjust and return. - return index + 1; - } - } - } - - @Override - public Iterator iterator() - { - final Iterator it = delegate.iterator(); - - // Skip first two values. - //CHECKSTYLE.OFF: Regexp - it.next(); - it.next(); - //CHECKSTYLE.ON: Regexp - - class CoalescingIndexedIterator implements Iterator - { - boolean returnedFirstValue; - - @Override - public boolean hasNext() - { - return !returnedFirstValue || it.hasNext(); - } - - @Override - public T next() - { - if (!returnedFirstValue) { - returnedFirstValue = true; - return newFirstValue(); - } else { - return it.next(); - } - } - } - - return new CoalescingIndexedIterator(); - } - - @Override - public void inspectRuntimeShape(RuntimeShapeInspector inspector) - { - delegate.inspectRuntimeShape(inspector); - } - - @Override - public boolean isSorted() - { - return delegate.isSorted(); - } -} diff --git a/processing/src/main/java/org/apache/druid/segment/serde/CombineFirstTwoValuesColumnarInts.java b/processing/src/main/java/org/apache/druid/segment/serde/CombineFirstTwoValuesColumnarInts.java deleted file mode 100644 index 07ccd303db63..000000000000 --- a/processing/src/main/java/org/apache/druid/segment/serde/CombineFirstTwoValuesColumnarInts.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.druid.segment.serde; - -import org.apache.druid.common.config.NullHandling; -import org.apache.druid.segment.data.ColumnarInts; -import org.apache.druid.segment.data.Indexed; - -import java.io.IOException; - -/** - * A {@link ColumnarInts} facade over {@link CombineFirstTwoValuesIndexedInts}. - * - * Provided to enable compatibility for segments written under {@link NullHandling#sqlCompatible()} mode but - * read under {@link NullHandling#replaceWithDefault()} mode. - * - * @see NullHandling#mustCombineNullAndEmptyInDictionary(Indexed) - */ -public class CombineFirstTwoValuesColumnarInts extends CombineFirstTwoValuesIndexedInts implements ColumnarInts -{ - public CombineFirstTwoValuesColumnarInts(ColumnarInts delegate) - { - super(delegate); - } - - @Override - public void close() throws IOException - { - ((ColumnarInts) delegate).close(); - } -} diff --git a/processing/src/main/java/org/apache/druid/segment/serde/CombineFirstTwoValuesColumnarMultiInts.java b/processing/src/main/java/org/apache/druid/segment/serde/CombineFirstTwoValuesColumnarMultiInts.java deleted file mode 100644 index 4d8cc5f61f6f..000000000000 --- a/processing/src/main/java/org/apache/druid/segment/serde/CombineFirstTwoValuesColumnarMultiInts.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.druid.segment.serde; - -import com.google.common.collect.Iterators; -import org.apache.druid.common.config.NullHandling; -import org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector; -import org.apache.druid.segment.data.ColumnarMultiInts; -import org.apache.druid.segment.data.Indexed; -import org.apache.druid.segment.data.IndexedInts; -import org.apache.druid.segment.data.ZeroIndexedInts; - -import javax.annotation.Nullable; -import java.io.IOException; -import java.util.Iterator; - -/** - * A {@link ColumnarMultiInts} that delegates to an underyling instance, but applies - * {@link CombineFirstTwoValuesIndexedInts} to each row's set of values. - * - * Provided to enable compatibility for segments written under {@link NullHandling#sqlCompatible()} mode but - * read under {@link NullHandling#replaceWithDefault()} mode. - * - * @see NullHandling#mustCombineNullAndEmptyInDictionary(Indexed) - */ -public class CombineFirstTwoValuesColumnarMultiInts implements ColumnarMultiInts -{ - private final ColumnarMultiInts delegate; - private final CombineFirstTwoValuesIndexedInts rowValues; - - public CombineFirstTwoValuesColumnarMultiInts(ColumnarMultiInts delegate) - { - this.delegate = delegate; - this.rowValues = new CombineFirstTwoValuesIndexedInts(ZeroIndexedInts.instance()); - } - - @Override - public IndexedInts get(int index) - { - rowValues.delegate = delegate.get(index); - return rowValues; - } - - @Override - public IndexedInts getUnshared(int index) - { - return new CombineFirstTwoValuesIndexedInts(delegate.getUnshared(index)); - } - - @Override - public int size() - { - return delegate.size(); - } - - @Override - public int indexOf(@Nullable IndexedInts value) - { - // No ColumnarMultiInts implement this method - throw new UnsupportedOperationException("Reverse lookup not allowed."); - } - - @Override - public boolean isSorted() - { - return delegate.isSorted(); - } - - @Override - public void inspectRuntimeShape(RuntimeShapeInspector inspector) - { - delegate.inspectRuntimeShape(inspector); - } - - @Override - public Iterator iterator() - { - return Iterators.transform( - delegate.iterator(), - CombineFirstTwoValuesIndexedInts::new - ); - } - - @Override - public void close() throws IOException - { - delegate.close(); - } -} diff --git a/processing/src/main/java/org/apache/druid/segment/serde/CombineFirstTwoValuesIndexedInts.java b/processing/src/main/java/org/apache/druid/segment/serde/CombineFirstTwoValuesIndexedInts.java deleted file mode 100644 index e2e6bf6d6e99..000000000000 --- a/processing/src/main/java/org/apache/druid/segment/serde/CombineFirstTwoValuesIndexedInts.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.druid.segment.serde; - -import org.apache.druid.common.config.NullHandling; -import org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector; -import org.apache.druid.segment.data.Indexed; -import org.apache.druid.segment.data.IndexedInts; - -/** - * A {@link IndexedInts} that delegates to an underyling instance, but combines the values 0 and 1 into 0, and shifts - * all other values down by one. For example: - * - * - [2, 0, 1] => [1, 0, 0] - * - [3, 2, 1] => [2, 1, 0] - * - [0, 1, 0] => [0, 0, 0] - * - * Provided to enable compatibility for segments written under {@link NullHandling#sqlCompatible()} mode but - * read under {@link NullHandling#replaceWithDefault()} mode. - * - * @see NullHandling#mustCombineNullAndEmptyInDictionary(Indexed) - */ -public class CombineFirstTwoValuesIndexedInts implements IndexedInts -{ - private static final int ZERO_ID = 0; - - IndexedInts delegate; - - public CombineFirstTwoValuesIndexedInts(IndexedInts delegate) - { - this.delegate = delegate; - } - - @Override - public int size() - { - return delegate.size(); - } - - @Override - public int get(int index) - { - final int i = delegate.get(index); - if (i == ZERO_ID) { - return i; - } else { - return i - 1; - } - } - - @Override - public void get(int[] out, int start, int length) - { - delegate.get(out, start, length); - - for (int i = 0; i < length; i++) { - if (out[i] != ZERO_ID) { - out[i]--; - } - } - } - - @Override - public void get(int[] out, int[] indexes, int length) - { - delegate.get(out, indexes, length); - - for (int i = 0; i < length; i++) { - if (out[i] != ZERO_ID) { - out[i]--; - } - } - } - - @Override - public void inspectRuntimeShape(RuntimeShapeInspector inspector) - { - delegate.inspectRuntimeShape(inspector); - } -} diff --git a/processing/src/main/java/org/apache/druid/segment/serde/DoubleNumericColumnPartSerdeV2.java b/processing/src/main/java/org/apache/druid/segment/serde/DoubleNumericColumnPartSerdeV2.java index 0fa42f2187a4..520249b923e8 100644 --- a/processing/src/main/java/org/apache/druid/segment/serde/DoubleNumericColumnPartSerdeV2.java +++ b/processing/src/main/java/org/apache/druid/segment/serde/DoubleNumericColumnPartSerdeV2.java @@ -23,7 +23,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Supplier; import org.apache.druid.collections.bitmap.ImmutableBitmap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.io.smoosh.FileSmoosher; import org.apache.druid.segment.column.ValueType; import org.apache.druid.segment.data.BitmapSerde; @@ -155,14 +154,7 @@ public Deserializer getDeserializer() final ImmutableBitmap bitmap; final boolean hasNulls; if (buffer.hasRemaining()) { - if (NullHandling.sqlCompatible()) { - bitmap = bitmapSerdeFactory.getObjectStrategy().fromByteBufferWithSize(buffer); - } else { - // Read from the buffer (to advance its position) but do not actually retain the bitmaps. - bitmapSerdeFactory.getObjectStrategy().fromByteBufferWithSize(buffer); - bitmap = bitmapSerdeFactory.getBitmapFactory().makeEmptyImmutableBitmap(); - } - + bitmap = bitmapSerdeFactory.getObjectStrategy().fromByteBufferWithSize(buffer); hasNulls = !bitmap.isEmpty(); } else { bitmap = bitmapSerdeFactory.getBitmapFactory().makeEmptyImmutableBitmap(); diff --git a/processing/src/main/java/org/apache/druid/segment/serde/FloatNumericColumnPartSerdeV2.java b/processing/src/main/java/org/apache/druid/segment/serde/FloatNumericColumnPartSerdeV2.java index 457612c4f817..116d2dec9b09 100644 --- a/processing/src/main/java/org/apache/druid/segment/serde/FloatNumericColumnPartSerdeV2.java +++ b/processing/src/main/java/org/apache/druid/segment/serde/FloatNumericColumnPartSerdeV2.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import org.apache.druid.collections.bitmap.ImmutableBitmap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.io.smoosh.FileSmoosher; import org.apache.druid.segment.column.ValueType; import org.apache.druid.segment.data.BitmapSerde; @@ -151,15 +150,8 @@ public Deserializer getDeserializer() buffer.position(initialPos + offset); final ImmutableBitmap bitmap; final boolean hasNulls; - if (buffer.hasRemaining() && NullHandling.sqlCompatible()) { - if (NullHandling.sqlCompatible()) { - bitmap = bitmapSerdeFactory.getObjectStrategy().fromByteBufferWithSize(buffer); - } else { - // Read from the buffer (to advance its position) but do not actually retain the bitmaps. - bitmapSerdeFactory.getObjectStrategy().fromByteBufferWithSize(buffer); - bitmap = bitmapSerdeFactory.getBitmapFactory().makeEmptyImmutableBitmap(); - } - + if (buffer.hasRemaining()) { + bitmap = bitmapSerdeFactory.getObjectStrategy().fromByteBufferWithSize(buffer); hasNulls = !bitmap.isEmpty(); } else { bitmap = bitmapSerdeFactory.getBitmapFactory().makeEmptyImmutableBitmap(); diff --git a/processing/src/main/java/org/apache/druid/segment/serde/LongNumericColumnPartSerdeV2.java b/processing/src/main/java/org/apache/druid/segment/serde/LongNumericColumnPartSerdeV2.java index ac81a225de4c..272670e88ef8 100644 --- a/processing/src/main/java/org/apache/druid/segment/serde/LongNumericColumnPartSerdeV2.java +++ b/processing/src/main/java/org/apache/druid/segment/serde/LongNumericColumnPartSerdeV2.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import org.apache.druid.collections.bitmap.ImmutableBitmap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.io.smoosh.FileSmoosher; import org.apache.druid.segment.column.ValueType; import org.apache.druid.segment.data.BitmapSerde; @@ -153,15 +152,8 @@ public Deserializer getDeserializer() buffer.position(initialPos + offset); final ImmutableBitmap bitmap; final boolean hasNulls; - if (buffer.hasRemaining() && NullHandling.sqlCompatible()) { - if (NullHandling.sqlCompatible()) { - bitmap = bitmapSerdeFactory.getObjectStrategy().fromByteBufferWithSize(buffer); - } else { - // Read from the buffer (to advance its position) but do not actually retain the bitmaps. - bitmapSerdeFactory.getObjectStrategy().fromByteBufferWithSize(buffer); - bitmap = bitmapSerdeFactory.getBitmapFactory().makeEmptyImmutableBitmap(); - } - + if (buffer.hasRemaining()) { + bitmap = bitmapSerdeFactory.getObjectStrategy().fromByteBufferWithSize(buffer); hasNulls = !bitmap.isEmpty(); } else { bitmap = bitmapSerdeFactory.getBitmapFactory().makeEmptyImmutableBitmap(); diff --git a/processing/src/main/java/org/apache/druid/segment/serde/NestedCommonFormatColumnPartSerde.java b/processing/src/main/java/org/apache/druid/segment/serde/NestedCommonFormatColumnPartSerde.java index 6e1f0967c83d..ae14d4c16f85 100644 --- a/processing/src/main/java/org/apache/druid/segment/serde/NestedCommonFormatColumnPartSerde.java +++ b/processing/src/main/java/org/apache/druid/segment/serde/NestedCommonFormatColumnPartSerde.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.io.smoosh.SmooshedFileMapper; import org.apache.druid.segment.column.ColumnBuilder; import org.apache.druid.segment.column.ColumnCapabilitiesImpl; @@ -325,12 +324,9 @@ public void read(ByteBuffer buffer, ColumnBuilder builder, ColumnConfig columnCo builder.setType(logicalType); builder.setHasNulls(hasNulls); builder.setNestedCommonFormatColumnSupplier(supplier); - // in default value mode, SQL planning by default uses selector filters for things like 'is null', which does - // not work correctly for complex types (or arrays). so, only hook up this index in sql compatible mode so that - // query results are consistent when using an index or the value matcher - // additionally, nested columns only have a null value index, so we only bother with the index supplier if there - // are actually any null rows, otherwise we use the default 'no indexes' supplier - if (NullHandling.sqlCompatible() && hasNulls) { + // nested columns only have a null value index on the whole values, so we only bother with the index supplier if + // there are actually any null rows, otherwise we use the default 'no indexes' supplier + if (hasNulls) { builder.setIndexSupplier(supplier, false, false); } builder.setColumnFormat(new NestedCommonFormatColumn.Format(logicalType, hasNulls, enforceLogicalType)); diff --git a/processing/src/main/java/org/apache/druid/segment/serde/ReplaceFirstValueWithNullIndexed.java b/processing/src/main/java/org/apache/druid/segment/serde/ReplaceFirstValueWithNullIndexed.java deleted file mode 100644 index be9e1385d944..000000000000 --- a/processing/src/main/java/org/apache/druid/segment/serde/ReplaceFirstValueWithNullIndexed.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.druid.segment.serde; - -import org.apache.druid.common.config.NullHandling; -import org.apache.druid.java.util.common.ISE; -import org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector; -import org.apache.druid.segment.data.Indexed; - -import javax.annotation.Nullable; -import java.util.Iterator; - -/** - * An Indexed that replaces the first value with a literal null. - * - * Provided to enable compatibility for segments written under {@link NullHandling#sqlCompatible()} mode but - * read under {@link NullHandling#replaceWithDefault()} mode. - * - * Important note: {@link #isSorted()} returns the same value as the underlying delegate. In this case, this class - * assumes that {@code null} is the lowest possible value in the universe: including anything in {@link #delegate} and - * anything that might be passed to {@link #indexOf(Object)}. Callers must ensure that this precondition is met. - * - * @see NullHandling#mustReplaceFirstValueWithNullInDictionary(Indexed) - */ -public class ReplaceFirstValueWithNullIndexed implements Indexed -{ - private final Indexed delegate; - - public ReplaceFirstValueWithNullIndexed(Indexed delegate) - { - this.delegate = delegate; - - if (delegate.size() < 1) { - throw new ISE("Size[%s] must be >= 1", delegate.size()); - } - } - - @Override - public int size() - { - return delegate.size(); - } - - @Nullable - @Override - public T get(int index) - { - if (index == 0) { - return null; - } else { - return delegate.get(index); - } - } - - @Override - public int indexOf(@Nullable T value) - { - if (value == null) { - return 0; - } else { - final int result = delegate.indexOf(value); - if (result == 0 || result == -1) { - return -2; - } else { - return result; - } - } - } - - @Override - public boolean isSorted() - { - return delegate.isSorted(); - } - - @Override - public Iterator iterator() - { - final Iterator it = delegate.iterator(); - - // Skip first value. - it.next(); - - class ReplaceFirstValueWithNullIndexedIterator implements Iterator - { - boolean returnedNull; - - @Override - public boolean hasNext() - { - return !returnedNull || it.hasNext(); - } - - @Override - public T next() - { - if (!returnedNull) { - returnedNull = true; - return null; - } else { - return it.next(); - } - } - } - - return new ReplaceFirstValueWithNullIndexedIterator(); - } - - @Override - public void inspectRuntimeShape(RuntimeShapeInspector inspector) - { - delegate.inspectRuntimeShape(inspector); - } -} diff --git a/processing/src/main/java/org/apache/druid/segment/serde/StringUtf8ColumnIndexSupplier.java b/processing/src/main/java/org/apache/druid/segment/serde/StringUtf8ColumnIndexSupplier.java index 51e09434fb06..03f3e2ace4c5 100644 --- a/processing/src/main/java/org/apache/druid/segment/serde/StringUtf8ColumnIndexSupplier.java +++ b/processing/src/main/java/org/apache/druid/segment/serde/StringUtf8ColumnIndexSupplier.java @@ -23,7 +23,6 @@ import org.apache.druid.collections.bitmap.BitmapFactory; import org.apache.druid.collections.bitmap.ImmutableBitmap; import org.apache.druid.collections.spatial.ImmutableRTree; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.segment.column.ColumnIndexSupplier; import org.apache.druid.segment.column.StringEncodingStrategies; import org.apache.druid.segment.data.GenericIndexed; @@ -81,17 +80,9 @@ public T as(Class clazz) Indexed dict = utf8Dictionary.get(); Indexed singleThreadedBitmaps = bitmaps.singleThreaded(); - if (NullHandling.mustCombineNullAndEmptyInDictionary(dict)) { - dict = CombineFirstTwoEntriesIndexed.returnNull(dict); - singleThreadedBitmaps = CombineFirstTwoEntriesIndexed.unionBitmaps(bitmapFactory, singleThreadedBitmaps); - } else if (NullHandling.mustReplaceFirstValueWithNullInDictionary(dict)) { - dict = new ReplaceFirstValueWithNullIndexed<>(dict); - } - if (clazz.equals(NullValueIndex.class)) { final BitmapColumnIndex nullIndex; - final ByteBuffer firstValue = dict.get(0); - if (NullHandling.isNullOrEquivalent(firstValue)) { + if (dict.get(0) == null) { ImmutableBitmap bitmap = singleThreadedBitmaps.get(0); nullIndex = new SimpleImmutableBitmapIndex(bitmap == null ? bitmapFactory.makeEmptyImmutableBitmap() : bitmap); } else { diff --git a/processing/src/main/java/org/apache/druid/segment/serde/StringUtf8DictionaryEncodedColumnSupplier.java b/processing/src/main/java/org/apache/druid/segment/serde/StringUtf8DictionaryEncodedColumnSupplier.java index 6d443ebf11d9..4d1f43d96532 100644 --- a/processing/src/main/java/org/apache/druid/segment/serde/StringUtf8DictionaryEncodedColumnSupplier.java +++ b/processing/src/main/java/org/apache/druid/segment/serde/StringUtf8DictionaryEncodedColumnSupplier.java @@ -21,7 +21,6 @@ import com.google.common.base.Supplier; import org.apache.druid.collections.bitmap.BitmapFactory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.segment.column.DictionaryEncodedColumn; import org.apache.druid.segment.column.StringUtf8DictionaryEncodedColumn; import org.apache.druid.segment.data.ColumnarInts; @@ -64,27 +63,11 @@ public DictionaryEncodedColumn get() { final TIndexed suppliedUtf8Dictionary = utf8Dictionary.get(); - if (NullHandling.mustCombineNullAndEmptyInDictionary(suppliedUtf8Dictionary)) { - return new StringUtf8DictionaryEncodedColumn( - singleValuedColumn != null ? new CombineFirstTwoValuesColumnarInts(singleValuedColumn.get()) : null, - multiValuedColumn != null ? new CombineFirstTwoValuesColumnarMultiInts(multiValuedColumn.get()) : null, - CombineFirstTwoEntriesIndexed.returnNull(suppliedUtf8Dictionary), - bitmapFactory - ); - } else if (NullHandling.mustReplaceFirstValueWithNullInDictionary(suppliedUtf8Dictionary)) { - return new StringUtf8DictionaryEncodedColumn( - singleValuedColumn != null ? singleValuedColumn.get() : null, - multiValuedColumn != null ? multiValuedColumn.get() : null, - new ReplaceFirstValueWithNullIndexed<>(suppliedUtf8Dictionary), - bitmapFactory - ); - } else { - return new StringUtf8DictionaryEncodedColumn( - singleValuedColumn != null ? singleValuedColumn.get() : null, - multiValuedColumn != null ? multiValuedColumn.get() : null, - suppliedUtf8Dictionary, - bitmapFactory - ); - } + return new StringUtf8DictionaryEncodedColumn( + singleValuedColumn != null ? singleValuedColumn.get() : null, + multiValuedColumn != null ? multiValuedColumn.get() : null, + suppliedUtf8Dictionary, + bitmapFactory + ); } } diff --git a/processing/src/main/java/org/apache/druid/segment/vector/NilVectorSelector.java b/processing/src/main/java/org/apache/druid/segment/vector/NilVectorSelector.java index 7362b38a1c62..2257d1844fcf 100644 --- a/processing/src/main/java/org/apache/druid/segment/vector/NilVectorSelector.java +++ b/processing/src/main/java/org/apache/druid/segment/vector/NilVectorSelector.java @@ -19,7 +19,6 @@ package org.apache.druid.segment.vector; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.QueryContexts; import org.apache.druid.segment.IdLookup; @@ -37,7 +36,7 @@ public class NilVectorSelector private static final Object[] DEFAULT_OBJECT_VECTOR = new Object[QueryContexts.DEFAULT_VECTOR_SIZE]; static { - Arrays.fill(DEFAULT_NULLS_VECTOR, NullHandling.sqlCompatible()); + Arrays.fill(DEFAULT_NULLS_VECTOR, true); } private final VectorSizeInspector vectorSizeInspector; @@ -82,9 +81,7 @@ public static NilVectorSelector create(final VectorSizeInspector vectorSizeInspe ); } else { final boolean[] nulls = new boolean[vectorSizeInspector.getMaxVectorSize()]; - if (NullHandling.sqlCompatible()) { - Arrays.fill(nulls, true); - } + Arrays.fill(nulls, true); return new NilVectorSelector( vectorSizeInspector, nulls, @@ -158,7 +155,7 @@ public IdLookup idLookup() @Override public int lookupId(@Nullable final String name) { - return NullHandling.isNullOrEquivalent(name) ? 0 : -1; + return name == null ? 0 : -1; } @Override diff --git a/processing/src/main/java/org/apache/druid/segment/virtual/ExpressionMultiValueDimensionSelector.java b/processing/src/main/java/org/apache/druid/segment/virtual/ExpressionMultiValueDimensionSelector.java index dd70b3566e16..1fd1f7fcd6d9 100644 --- a/processing/src/main/java/org/apache/druid/segment/virtual/ExpressionMultiValueDimensionSelector.java +++ b/processing/src/main/java/org/apache/druid/segment/virtual/ExpressionMultiValueDimensionSelector.java @@ -19,7 +19,6 @@ package org.apache.druid.segment.virtual; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.math.expr.Evals; import org.apache.druid.math.expr.ExprEval; import org.apache.druid.query.extraction.ExtractionFn; @@ -237,7 +236,7 @@ private ExtractionMultiValueDimensionSelector(ColumnValueSelector base String getValue(ExprEval evaluated) { assert !evaluated.isArray(); - return extractionFn.apply(NullHandling.emptyToNullIfNeeded(evaluated.asString())); + return extractionFn.apply(evaluated.asString()); } @Override diff --git a/processing/src/main/java/org/apache/druid/segment/virtual/ExpressionSelectors.java b/processing/src/main/java/org/apache/druid/segment/virtual/ExpressionSelectors.java index 5aac2a2a9e8b..803dffb2f09e 100644 --- a/processing/src/main/java/org/apache/druid/segment/virtual/ExpressionSelectors.java +++ b/processing/src/main/java/org/apache/druid/segment/virtual/ExpressionSelectors.java @@ -23,7 +23,6 @@ import com.google.common.base.Preconditions; import com.google.common.base.Supplier; import com.google.common.collect.Iterables; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.NonnullPair; import org.apache.druid.math.expr.Evals; import org.apache.druid.math.expr.Expr; @@ -419,16 +418,12 @@ public static Supplier makeNullableNumericSupplier( Supplier supplier ) { - if (NullHandling.replaceWithDefault()) { - return supplier; - } else { - return () -> { - if (selector.isNull()) { - return null; - } - return supplier.get(); - }; - } + return () -> { + if (selector.isNull()) { + return null; + } + return supplier.get(); + }; } /** diff --git a/processing/src/main/java/org/apache/druid/segment/virtual/ExpressionSingleValueDimensionSelector.java b/processing/src/main/java/org/apache/druid/segment/virtual/ExpressionSingleValueDimensionSelector.java index 0dd991d1d535..1be5302b8581 100644 --- a/processing/src/main/java/org/apache/druid/segment/virtual/ExpressionSingleValueDimensionSelector.java +++ b/processing/src/main/java/org/apache/druid/segment/virtual/ExpressionSingleValueDimensionSelector.java @@ -19,7 +19,6 @@ package org.apache.druid.segment.virtual; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.math.expr.ExprEval; import org.apache.druid.query.extraction.ExtractionFn; import org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector; @@ -51,7 +50,7 @@ public static ExpressionSingleValueDimensionSelector fromValueSelector( @Override protected String getValue() { - return NullHandling.emptyToNullIfNeeded(baseSelector.getObject().asString()); + return baseSelector.getObject().asString(); } @Override @@ -77,7 +76,7 @@ static class ExtractionExpressionDimensionSelector extends ExpressionSingleValue @Override protected String getValue() { - return extractionFn.apply(NullHandling.emptyToNullIfNeeded(baseSelector.getObject().asString())); + return extractionFn.apply(baseSelector.getObject().asString()); } @Override diff --git a/processing/src/main/java/org/apache/druid/segment/virtual/ListFilteredVirtualColumn.java b/processing/src/main/java/org/apache/druid/segment/virtual/ListFilteredVirtualColumn.java index dceae11099b4..271473f481ef 100644 --- a/processing/src/main/java/org/apache/druid/segment/virtual/ListFilteredVirtualColumn.java +++ b/processing/src/main/java/org/apache/druid/segment/virtual/ListFilteredVirtualColumn.java @@ -30,7 +30,6 @@ import it.unimi.dsi.fastutil.ints.IntIntPair; import org.apache.druid.collections.bitmap.BitmapFactory; import org.apache.druid.collections.bitmap.ImmutableBitmap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.BitmapResultFactory; import org.apache.druid.query.cache.CacheKeyBuilder; import org.apache.druid.query.dimension.DefaultDimensionSpec; @@ -302,7 +301,7 @@ private static Iterable getNonNullBitmaps( IdMapping idMapping ) { - final int start = NullHandling.isNullOrEquivalent(delegateIndex.getValue(idMapping.getReverseId(0))) ? 1 : 0; + final int start = delegateIndex.getValue(idMapping.getReverseId(0)) == null ? 1 : 0; return getBitmapsInRange( delegateIndex, idMapping, @@ -663,11 +662,11 @@ private IntIntPair getRange( ) { int startIndex, endIndex; - final int firstValue = NullHandling.isNullOrEquivalent(delegate.getValue(idMapping.getReverseId(0))) ? 1 : 0; + final int firstValue = delegate.getValue(idMapping.getReverseId(0)) == null ? 1 : 0; if (startValue == null) { startIndex = firstValue; } else { - final int found = getReverseIndex(NullHandling.emptyToNullIfNeeded(startValue)); + final int found = getReverseIndex(startValue); if (found >= 0) { startIndex = startStrict ? found + 1 : found; } else { @@ -678,7 +677,7 @@ private IntIntPair getRange( if (endValue == null) { endIndex = idMapping.getValueCardinality(); } else { - final int found = getReverseIndex(NullHandling.emptyToNullIfNeeded(endValue)); + final int found = getReverseIndex(endValue); if (found >= 0) { endIndex = endStrict ? found : found + 1; } else { diff --git a/processing/src/test/java/org/apache/druid/collections/bitmap/BitmapOperationTestBase.java b/processing/src/test/java/org/apache/druid/collections/bitmap/BitmapOperationTestBase.java index e94db7f42e34..da8a686effa3 100644 --- a/processing/src/test/java/org/apache/druid/collections/bitmap/BitmapOperationTestBase.java +++ b/processing/src/test/java/org/apache/druid/collections/bitmap/BitmapOperationTestBase.java @@ -20,7 +20,6 @@ package org.apache.druid.collections.bitmap; import org.apache.druid.collections.ResourceHolder; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.extendedset.intset.ImmutableConciseSet; import org.apache.druid.java.util.common.ByteBufferUtils; import org.apache.druid.utils.CloseableUtils; @@ -59,10 +58,6 @@ public abstract class BitmapOperationTestBase static long unionCount = 0; static long minIntersection = 0; - static { - NullHandling.initializeForTests(); - } - protected static ResourceHolder makeOffheapConcise(ImmutableConciseSet concise) { final byte[] bytes = concise.toBytes(); diff --git a/processing/src/test/java/org/apache/druid/common/config/NullHandlingTest.java b/processing/src/test/java/org/apache/druid/common/config/NullHandlingTest.java deleted file mode 100644 index a919f5b4447f..000000000000 --- a/processing/src/test/java/org/apache/druid/common/config/NullHandlingTest.java +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.druid.common.config; - -import org.apache.druid.java.util.common.StringUtils; -import org.apache.druid.segment.column.ValueType; -import org.apache.druid.segment.data.ListIndexed; -import org.apache.druid.testing.InitializedNullHandlingTest; -import org.junit.Assert; -import org.junit.Test; - -import java.util.Collections; - -import static org.apache.druid.common.config.NullHandling.defaultValueForClass; -import static org.apache.druid.common.config.NullHandling.defaultValueForType; -import static org.apache.druid.common.config.NullHandling.replaceWithDefault; -import static org.junit.Assert.assertEquals; - -public final class NullHandlingTest extends InitializedNullHandlingTest -{ - @Test - public void test_defaultValueForClass_float() - { - assertEquals( - replaceWithDefault() ? 0f : null, - NullHandling.defaultValueForClass(Float.class) - ); - } - - @Test - public void test_defaultValueForClass_double() - { - assertEquals( - replaceWithDefault() ? 0d : null, - NullHandling.defaultValueForClass(Double.class) - ); - } - - @Test - public void test_defaultValueForClass_integer() - { - Assert.assertNull(NullHandling.defaultValueForClass(Integer.class)); - } - - @Test - public void test_defaultValueForClass_long() - { - assertEquals( - replaceWithDefault() ? 0L : null, - NullHandling.defaultValueForClass(Long.class) - ); - } - - @Test - public void test_defaultValueForClass_number() - { - assertEquals( - replaceWithDefault() ? 0d : null, - NullHandling.defaultValueForClass(Number.class) - ); - } - - @Test - public void test_defaultValueForClass_string() - { - assertEquals( - replaceWithDefault() ? "" : null, - NullHandling.defaultValueForClass(String.class) - ); - } - - @Test - public void test_defaultValueForClass_object() - { - Assert.assertNull(NullHandling.defaultValueForClass(Object.class)); - } - - @Test - public void test_defaultValueForType() - { - assertEquals(defaultValueForClass(Float.class), defaultValueForType(ValueType.FLOAT)); - assertEquals(defaultValueForClass(Double.class), defaultValueForType(ValueType.DOUBLE)); - assertEquals(defaultValueForClass(Long.class), defaultValueForType(ValueType.LONG)); - assertEquals(defaultValueForClass(String.class), defaultValueForType(ValueType.STRING)); - assertEquals(defaultValueForClass(Object.class), defaultValueForType(ValueType.COMPLEX)); - assertEquals(defaultValueForClass(Object.class), defaultValueForType(ValueType.ARRAY)); - } - - @Test - public void test_ignoreNullsStrings() - { - try { - NullHandling.initializeForTestsWithValues(false, true); - Assert.assertFalse(NullHandling.ignoreNullsForStringCardinality()); - - NullHandling.initializeForTestsWithValues(true, false); - Assert.assertFalse(NullHandling.ignoreNullsForStringCardinality()); - } - finally { - NullHandling.initializeForTests(); - } - } - - @Test - public void test_mustCombineNullAndEmptyInDictionary() - { - Assert.assertFalse( - NullHandling.mustCombineNullAndEmptyInDictionary( - new ListIndexed<>(Collections.singletonList(null)) - ) - ); - - Assert.assertFalse( - NullHandling.mustCombineNullAndEmptyInDictionary( - new ListIndexed<>(StringUtils.toUtf8ByteBuffer("foo")) - ) - ); - - Assert.assertFalse( - NullHandling.mustCombineNullAndEmptyInDictionary( - new ListIndexed<>(StringUtils.toUtf8ByteBuffer("")) - ) - ); - - Assert.assertFalse( - NullHandling.mustCombineNullAndEmptyInDictionary( - new ListIndexed<>(StringUtils.toUtf8ByteBuffer(""), StringUtils.toUtf8ByteBuffer("foo")) - ) - ); - - Assert.assertEquals( - NullHandling.replaceWithDefault(), - NullHandling.mustCombineNullAndEmptyInDictionary( - new ListIndexed<>(null, StringUtils.toUtf8ByteBuffer("")) - ) - ); - - Assert.assertEquals( - NullHandling.replaceWithDefault(), - NullHandling.mustCombineNullAndEmptyInDictionary( - new ListIndexed<>(null, StringUtils.toUtf8ByteBuffer(""), StringUtils.toUtf8ByteBuffer("foo"))) - ); - } - - @Test - public void test_mustReplaceFirstValueWithNullInDictionary() - { - Assert.assertFalse( - NullHandling.mustReplaceFirstValueWithNullInDictionary( - new ListIndexed<>(Collections.singletonList(null)) - ) - ); - - Assert.assertFalse( - NullHandling.mustReplaceFirstValueWithNullInDictionary( - new ListIndexed<>(StringUtils.toUtf8ByteBuffer("foo")) - ) - ); - - Assert.assertEquals( - NullHandling.replaceWithDefault(), - NullHandling.mustReplaceFirstValueWithNullInDictionary( - new ListIndexed<>(StringUtils.toUtf8ByteBuffer("")) - ) - ); - - Assert.assertEquals( - NullHandling.replaceWithDefault(), - NullHandling.mustReplaceFirstValueWithNullInDictionary( - new ListIndexed<>(StringUtils.toUtf8ByteBuffer(""), StringUtils.toUtf8ByteBuffer("foo")) - ) - ); - - Assert.assertFalse( - NullHandling.mustReplaceFirstValueWithNullInDictionary( - new ListIndexed<>(null, StringUtils.toUtf8ByteBuffer("")) - ) - ); - - Assert.assertFalse( - NullHandling.mustReplaceFirstValueWithNullInDictionary( - new ListIndexed<>(null, StringUtils.toUtf8ByteBuffer(""), StringUtils.toUtf8ByteBuffer("foo"))) - ); - } -} diff --git a/processing/src/test/java/org/apache/druid/data/input/impl/CsvReaderTest.java b/processing/src/test/java/org/apache/druid/data/input/impl/CsvReaderTest.java index 70d6c7b705d9..6d186df9adf8 100644 --- a/processing/src/test/java/org/apache/druid/data/input/impl/CsvReaderTest.java +++ b/processing/src/test/java/org/apache/druid/data/input/impl/CsvReaderTest.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.ColumnsFilter; import org.apache.druid.data.input.InputEntityReader; import org.apache.druid.data.input.InputRow; @@ -32,7 +31,6 @@ import org.apache.druid.java.util.common.parsers.CloseableIterator; import org.apache.druid.segment.column.RowSignature; import org.junit.Assert; -import org.junit.BeforeClass; import org.junit.Test; import java.io.ByteArrayOutputStream; @@ -50,12 +48,6 @@ public class CsvReaderTest ColumnsFilter.all() ); - @BeforeClass - public static void setup() - { - NullHandling.initializeForTests(); - } - @Test public void testWithoutHeaders() throws IOException { diff --git a/processing/src/test/java/org/apache/druid/data/input/impl/DelimitedBytesTest.java b/processing/src/test/java/org/apache/druid/data/input/impl/DelimitedBytesTest.java index 10982d632788..5486c5710101 100644 --- a/processing/src/test/java/org/apache/druid/data/input/impl/DelimitedBytesTest.java +++ b/processing/src/test/java/org/apache/druid/data/input/impl/DelimitedBytesTest.java @@ -19,7 +19,6 @@ package org.apache.druid.data.input.impl; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.testing.InitializedNullHandlingTest; import org.junit.Assert; @@ -36,7 +35,7 @@ public class DelimitedBytesTest extends InitializedNullHandlingTest public void testEmpty() { Assert.assertEquals( - Collections.singletonList(NullHandling.sqlCompatible() ? null : ""), + Collections.singletonList(null), DelimitedBytes.split(new byte[0], TSV, DelimitedBytes.UNKNOWN_FIELD_COUNT) ); } @@ -63,7 +62,7 @@ public void testOneDelimiter() public void testDelimiterAtStart() { Assert.assertEquals( - Arrays.asList(NullHandling.sqlCompatible() ? null : "", "abc"), + Arrays.asList(null, "abc"), DelimitedBytes.split(StringUtils.toUtf8("\tabc"), TSV, DelimitedBytes.UNKNOWN_FIELD_COUNT) ); } @@ -72,7 +71,7 @@ public void testDelimiterAtStart() public void testDelimiterAtEnd() { Assert.assertEquals( - Arrays.asList("a", "bc", NullHandling.sqlCompatible() ? null : ""), + Arrays.asList("a", "bc", null), DelimitedBytes.split(StringUtils.toUtf8("a\tbc\t"), TSV, DelimitedBytes.UNKNOWN_FIELD_COUNT) ); } diff --git a/processing/src/test/java/org/apache/druid/data/input/impl/DelimitedReaderTest.java b/processing/src/test/java/org/apache/druid/data/input/impl/DelimitedReaderTest.java index aaa6490b2985..c04f3a8f3f23 100644 --- a/processing/src/test/java/org/apache/druid/data/input/impl/DelimitedReaderTest.java +++ b/processing/src/test/java/org/apache/druid/data/input/impl/DelimitedReaderTest.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.ColumnsFilter; import org.apache.druid.data.input.InputEntityReader; import org.apache.druid.data.input.InputRow; @@ -32,7 +31,6 @@ import org.apache.druid.java.util.common.parsers.CloseableIterator; import org.apache.druid.segment.column.RowSignature; import org.junit.Assert; -import org.junit.BeforeClass; import org.junit.Test; import java.io.ByteArrayOutputStream; @@ -50,12 +48,6 @@ public class DelimitedReaderTest ColumnsFilter.all() ); - @BeforeClass - public static void setup() - { - NullHandling.initializeForTests(); - } - @Test public void testWithoutHeaders() throws IOException { diff --git a/processing/src/test/java/org/apache/druid/data/input/impl/FastLineIteratorTest.java b/processing/src/test/java/org/apache/druid/data/input/impl/FastLineIteratorTest.java index 227ab2039fde..87031aaebdc4 100644 --- a/processing/src/test/java/org/apache/druid/data/input/impl/FastLineIteratorTest.java +++ b/processing/src/test/java/org/apache/druid/data/input/impl/FastLineIteratorTest.java @@ -20,9 +20,7 @@ package org.apache.druid.data.input.impl; import org.apache.commons.lang3.RandomStringUtils; -import org.apache.druid.common.config.NullHandling; import org.junit.Assert; -import org.junit.BeforeClass; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; @@ -36,12 +34,6 @@ public class FastLineIteratorTest @Rule public final ExpectedException expectedException = ExpectedException.none(); - @BeforeClass - public static void setup() - { - NullHandling.initializeForTests(); - } - @Test public void testNullInputThrows() { diff --git a/processing/src/test/java/org/apache/druid/data/input/impl/RowsTest.java b/processing/src/test/java/org/apache/druid/data/input/impl/RowsTest.java index 14ff18cf0233..f1b9aa9e0a0e 100644 --- a/processing/src/test/java/org/apache/druid/data/input/impl/RowsTest.java +++ b/processing/src/test/java/org/apache/druid/data/input/impl/RowsTest.java @@ -20,7 +20,6 @@ package org.apache.druid.data.input.impl; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.Rows; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.java.util.common.parsers.ParseException; @@ -49,14 +48,10 @@ public class RowsTest extends InitializedNullHandlingTest public void setUp() { // Null - validCases.put(null, NullHandling.sqlCompatible() ? null : 0L); + validCases.put(null, null); // Empty string - if (NullHandling.sqlCompatible()) { - invalidCases.add(""); - } else { - validCases.put("", 0L); - } + invalidCases.add(""); // Strings that are valid longs validCases.put("0", 0L); @@ -116,11 +111,7 @@ public void test_objectToNumber_typeUnknown_noThrow() } for (final Object o : invalidCases) { - Assert.assertEquals( - o + " (nothrow)", - NullHandling.defaultLongValue(), - Rows.objectToNumber(FIELD_NAME, o, null, false) - ); + Assert.assertNull(o + " (nothrow)", Rows.objectToNumber(FIELD_NAME, o, null, false)); final ParseException e = Assert.assertThrows( o + " (throw)", @@ -151,11 +142,7 @@ public void test_objectToNumber_typeLong_noThrow() } for (final Object o : invalidCases) { - Assert.assertEquals( - o + " (nothrow)", - NullHandling.defaultLongValue(), - Rows.objectToNumber(FIELD_NAME, o, ValueType.LONG, false) - ); + Assert.assertNull(o + " (nothrow)", Rows.objectToNumber(FIELD_NAME, o, ValueType.LONG, false)); final ParseException e = Assert.assertThrows( o + " (throw)", @@ -186,11 +173,7 @@ public void test_objectToNumber_typeFloat_noThrow() } for (final Object o : invalidCases) { - Assert.assertEquals( - o + " (nothrow)", - NullHandling.defaultFloatValue(), - Rows.objectToNumber(FIELD_NAME, o, ValueType.FLOAT, false) - ); + Assert.assertNull(o + " (nothrow)", Rows.objectToNumber(FIELD_NAME, o, ValueType.FLOAT, false)); final ParseException e = Assert.assertThrows( o + " (throw)", @@ -221,11 +204,7 @@ public void test_objectToNumber_typeDouble_noThrow() } for (final Object o : invalidCases) { - Assert.assertEquals( - o + " (nothrow)", - NullHandling.defaultDoubleValue(), - Rows.objectToNumber(FIELD_NAME, o, ValueType.DOUBLE, false) - ); + Assert.assertNull(o + " (nothrow)", Rows.objectToNumber(FIELD_NAME, o, ValueType.DOUBLE, false)); final ParseException e = Assert.assertThrows( o + " (throw)", diff --git a/processing/src/test/java/org/apache/druid/frame/field/DoubleFieldReaderTest.java b/processing/src/test/java/org/apache/druid/frame/field/DoubleFieldReaderTest.java index 175e9de2a56e..dd6c8aa24b23 100644 --- a/processing/src/test/java/org/apache/druid/frame/field/DoubleFieldReaderTest.java +++ b/processing/src/test/java/org/apache/druid/frame/field/DoubleFieldReaderTest.java @@ -20,7 +20,6 @@ package org.apache.druid.frame.field; import org.apache.datasketches.memory.WritableMemory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.frame.key.KeyOrder; import org.apache.druid.frame.write.FrameWriterTestData; import org.apache.druid.java.util.common.ISE; @@ -80,8 +79,8 @@ public void tearDown() @Test public void test_isNull_defaultOrNull() { - writeToMemory(NullHandling.defaultDoubleValue()); - Assert.assertEquals(NullHandling.sqlCompatible(), DoubleFieldReader.forPrimitive().isNull(memory, MEMORY_POSITION)); + writeToMemory(null); + Assert.assertTrue(DoubleFieldReader.forPrimitive().isNull(memory, MEMORY_POSITION)); } @Test @@ -94,16 +93,12 @@ public void test_isNull_aValue() @Test public void test_makeColumnValueSelector_defaultOrNull() { - writeToMemory(NullHandling.defaultDoubleValue()); + writeToMemory(null); final ColumnValueSelector readSelector = DoubleFieldReader.forPrimitive().makeColumnValueSelector(memory, new ConstantFieldPointer(MEMORY_POSITION, -1)); - Assert.assertEquals(!NullHandling.replaceWithDefault(), readSelector.isNull()); - - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(NullHandling.defaultDoubleValue(), readSelector.getDouble(), 0); - } + Assert.assertTrue(readSelector.isNull()); } @Test @@ -120,7 +115,7 @@ public void test_makeColumnValueSelector_aValue() @Test public void test_makeDimensionSelector_defaultOrNull() { - writeToMemory(NullHandling.defaultDoubleValue()); + writeToMemory(null); final DimensionSelector readSelector = DoubleFieldReader.forPrimitive() @@ -129,7 +124,7 @@ public void test_makeDimensionSelector_defaultOrNull() // Data retrieval tests. final IndexedInts row = readSelector.getRow(); Assert.assertEquals(1, row.size()); - Assert.assertEquals(NullHandling.replaceWithDefault() ? "0.0" : null, readSelector.lookupName(0)); + Assert.assertNull(readSelector.lookupName(0)); // Informational method tests. Assert.assertFalse(readSelector.supportsLookupNameUtf8()); @@ -139,17 +134,10 @@ public void test_makeDimensionSelector_defaultOrNull() Assert.assertNull(readSelector.idLookup()); // Value matcher tests. - if (NullHandling.replaceWithDefault()) { - Assert.assertTrue(readSelector.makeValueMatcher("0.0").matches(false)); - Assert.assertFalse(readSelector.makeValueMatcher((String) null).matches(false)); - Assert.assertTrue(readSelector.makeValueMatcher(StringPredicateDruidPredicateFactory.equalTo("0.0")).matches(false)); - Assert.assertFalse(readSelector.makeValueMatcher(StringPredicateDruidPredicateFactory.of(DruidObjectPredicate.isNull())).matches(false)); - } else { - Assert.assertFalse(readSelector.makeValueMatcher("0.0").matches(false)); - Assert.assertTrue(readSelector.makeValueMatcher((String) null).matches(false)); - Assert.assertFalse(readSelector.makeValueMatcher(StringPredicateDruidPredicateFactory.equalTo("0.0")).matches(false)); - Assert.assertTrue(readSelector.makeValueMatcher(StringPredicateDruidPredicateFactory.of(DruidObjectPredicate.isNull())).matches(false)); - } + Assert.assertFalse(readSelector.makeValueMatcher("0.0").matches(false)); + Assert.assertTrue(readSelector.makeValueMatcher((String) null).matches(false)); + Assert.assertFalse(readSelector.makeValueMatcher(StringPredicateDruidPredicateFactory.equalTo("0.0")).matches(false)); + Assert.assertTrue(readSelector.makeValueMatcher(StringPredicateDruidPredicateFactory.of(DruidObjectPredicate.isNull())).matches(false)); } @Test diff --git a/processing/src/test/java/org/apache/druid/frame/field/FloatFieldReaderTest.java b/processing/src/test/java/org/apache/druid/frame/field/FloatFieldReaderTest.java index 3669c89232d6..2fb5723de3df 100644 --- a/processing/src/test/java/org/apache/druid/frame/field/FloatFieldReaderTest.java +++ b/processing/src/test/java/org/apache/druid/frame/field/FloatFieldReaderTest.java @@ -20,7 +20,6 @@ package org.apache.druid.frame.field; import org.apache.datasketches.memory.WritableMemory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.frame.key.KeyOrder; import org.apache.druid.frame.write.FrameWriterTestData; import org.apache.druid.java.util.common.ISE; @@ -80,8 +79,8 @@ public void tearDown() @Test public void test_isNull_defaultOrNull() { - writeToMemory(NullHandling.defaultFloatValue()); - Assert.assertEquals(NullHandling.sqlCompatible(), FloatFieldReader.forPrimitive().isNull(memory, MEMORY_POSITION)); + writeToMemory(null); + Assert.assertTrue(FloatFieldReader.forPrimitive().isNull(memory, MEMORY_POSITION)); } @Test @@ -115,16 +114,12 @@ public void test_isNull_aValue() @Test public void test_makeColumnValueSelector_defaultOrNull() { - writeToMemory(NullHandling.defaultFloatValue()); + writeToMemory(null); final ColumnValueSelector readSelector = FloatFieldReader.forPrimitive().makeColumnValueSelector(memory, new ConstantFieldPointer(MEMORY_POSITION, -1)); - Assert.assertEquals(!NullHandling.replaceWithDefault(), readSelector.isNull()); - - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(NullHandling.defaultFloatValue(), readSelector.getFloat(), 0); - } + Assert.assertTrue(readSelector.isNull()); } @Test @@ -141,7 +136,7 @@ public void test_makeColumnValueSelector_aValue() @Test public void test_makeDimensionSelector_defaultOrNull() { - writeToMemory(NullHandling.defaultFloatValue()); + writeToMemory(null); final DimensionSelector readSelector = FloatFieldReader.forPrimitive() @@ -150,7 +145,7 @@ public void test_makeDimensionSelector_defaultOrNull() // Data retrieval tests. final IndexedInts row = readSelector.getRow(); Assert.assertEquals(1, row.size()); - Assert.assertEquals(NullHandling.replaceWithDefault() ? "0.0" : null, readSelector.lookupName(0)); + Assert.assertEquals(null, readSelector.lookupName(0)); // Informational method tests. Assert.assertFalse(readSelector.supportsLookupNameUtf8()); @@ -160,17 +155,10 @@ public void test_makeDimensionSelector_defaultOrNull() Assert.assertNull(readSelector.idLookup()); // Value matcher tests. - if (NullHandling.replaceWithDefault()) { - Assert.assertTrue(readSelector.makeValueMatcher("0.0").matches(false)); - Assert.assertFalse(readSelector.makeValueMatcher((String) null).matches(false)); - Assert.assertTrue(readSelector.makeValueMatcher(StringPredicateDruidPredicateFactory.equalTo("0.0")).matches(false)); - Assert.assertFalse(readSelector.makeValueMatcher(StringPredicateDruidPredicateFactory.of(DruidObjectPredicate.isNull())).matches(false)); - } else { - Assert.assertFalse(readSelector.makeValueMatcher("0.0").matches(false)); - Assert.assertTrue(readSelector.makeValueMatcher((String) null).matches(false)); - Assert.assertFalse(readSelector.makeValueMatcher(StringPredicateDruidPredicateFactory.equalTo("0.0")).matches(false)); - Assert.assertTrue(readSelector.makeValueMatcher(StringPredicateDruidPredicateFactory.of(DruidObjectPredicate.isNull())).matches(false)); - } + Assert.assertFalse(readSelector.makeValueMatcher("0.0").matches(false)); + Assert.assertTrue(readSelector.makeValueMatcher((String) null).matches(false)); + Assert.assertFalse(readSelector.makeValueMatcher(StringPredicateDruidPredicateFactory.equalTo("0.0")).matches(false)); + Assert.assertTrue(readSelector.makeValueMatcher(StringPredicateDruidPredicateFactory.of(DruidObjectPredicate.isNull())).matches(false)); } @Test diff --git a/processing/src/test/java/org/apache/druid/frame/field/LongFieldReaderTest.java b/processing/src/test/java/org/apache/druid/frame/field/LongFieldReaderTest.java index 266d86e12833..4b50602058f8 100644 --- a/processing/src/test/java/org/apache/druid/frame/field/LongFieldReaderTest.java +++ b/processing/src/test/java/org/apache/druid/frame/field/LongFieldReaderTest.java @@ -20,7 +20,6 @@ package org.apache.druid.frame.field; import org.apache.datasketches.memory.WritableMemory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.frame.key.KeyOrder; import org.apache.druid.frame.write.FrameWriterTestData; import org.apache.druid.java.util.common.ISE; @@ -80,8 +79,8 @@ public void tearDown() @Test public void test_isNull_defaultOrNull() { - writeToMemory(NullHandling.defaultLongValue()); - Assert.assertEquals(NullHandling.sqlCompatible(), LongFieldReader.forPrimitive().isNull(memory, MEMORY_POSITION)); + writeToMemory(null); + Assert.assertTrue(LongFieldReader.forPrimitive().isNull(memory, MEMORY_POSITION)); } @Test @@ -94,16 +93,12 @@ public void test_isNull_aValue() @Test public void test_makeColumnValueSelector_defaultOrNull() { - writeToMemory(NullHandling.defaultLongValue()); + writeToMemory(null); final ColumnValueSelector readSelector = LongFieldReader.forPrimitive().makeColumnValueSelector(memory, new ConstantFieldPointer(MEMORY_POSITION, -1)); - Assert.assertEquals(!NullHandling.replaceWithDefault(), readSelector.isNull()); - - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals((long) NullHandling.defaultLongValue(), readSelector.getLong()); - } + Assert.assertTrue(readSelector.isNull()); } @Test @@ -120,7 +115,7 @@ public void test_makeColumnValueSelector_aValue() @Test public void test_makeDimensionSelector_defaultOrNull() { - writeToMemory(NullHandling.defaultLongValue()); + writeToMemory(null); final DimensionSelector readSelector = LongFieldReader.forPrimitive() @@ -129,7 +124,7 @@ public void test_makeDimensionSelector_defaultOrNull() // Data retrieval tests. final IndexedInts row = readSelector.getRow(); Assert.assertEquals(1, row.size()); - Assert.assertEquals(NullHandling.replaceWithDefault() ? "0" : null, readSelector.lookupName(0)); + Assert.assertNull(readSelector.lookupName(0)); // Informational method tests. Assert.assertFalse(readSelector.supportsLookupNameUtf8()); @@ -139,17 +134,10 @@ public void test_makeDimensionSelector_defaultOrNull() Assert.assertNull(readSelector.idLookup()); // Value matcher tests. - if (NullHandling.replaceWithDefault()) { - Assert.assertTrue(readSelector.makeValueMatcher("0").matches(false)); - Assert.assertFalse(readSelector.makeValueMatcher((String) null).matches(false)); - Assert.assertTrue(readSelector.makeValueMatcher(StringPredicateDruidPredicateFactory.equalTo("0")).matches(false)); - Assert.assertFalse(readSelector.makeValueMatcher(StringPredicateDruidPredicateFactory.of(DruidObjectPredicate.isNull())).matches(false)); - } else { - Assert.assertFalse(readSelector.makeValueMatcher("0").matches(false)); - Assert.assertTrue(readSelector.makeValueMatcher((String) null).matches(false)); - Assert.assertFalse(readSelector.makeValueMatcher(StringPredicateDruidPredicateFactory.equalTo("0")).matches(false)); - Assert.assertTrue(readSelector.makeValueMatcher(StringPredicateDruidPredicateFactory.of(DruidObjectPredicate.isNull())).matches(false)); - } + Assert.assertFalse(readSelector.makeValueMatcher("0").matches(false)); + Assert.assertTrue(readSelector.makeValueMatcher((String) null).matches(false)); + Assert.assertFalse(readSelector.makeValueMatcher(StringPredicateDruidPredicateFactory.equalTo("0")).matches(false)); + Assert.assertTrue(readSelector.makeValueMatcher(StringPredicateDruidPredicateFactory.of(DruidObjectPredicate.isNull())).matches(false)); } @Test diff --git a/processing/src/test/java/org/apache/druid/frame/field/StringArrayFieldWriterTest.java b/processing/src/test/java/org/apache/druid/frame/field/StringArrayFieldWriterTest.java index 44d8ed5a26d4..918c42ec7101 100644 --- a/processing/src/test/java/org/apache/druid/frame/field/StringArrayFieldWriterTest.java +++ b/processing/src/test/java/org/apache/druid/frame/field/StringArrayFieldWriterTest.java @@ -20,7 +20,6 @@ package org.apache.druid.frame.field; import org.apache.datasketches.memory.WritableMemory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.ISE; import org.apache.druid.segment.BaseObjectColumnValueSelector; import org.apache.druid.segment.ColumnValueSelector; @@ -101,7 +100,7 @@ public void testMultiValueString() @Test public void testMultiValueStringContainingNulls() { - doTest(Arrays.asList("foo", NullHandling.emptyToNullIfNeeded(""), "bar", null)); + doTest(Arrays.asList("foo", "", "bar", null)); } private void doTest(@Nullable final List values) diff --git a/processing/src/test/java/org/apache/druid/frame/field/StringFieldReaderTest.java b/processing/src/test/java/org/apache/druid/frame/field/StringFieldReaderTest.java index 200c469269ff..090f8eb39024 100644 --- a/processing/src/test/java/org/apache/druid/frame/field/StringFieldReaderTest.java +++ b/processing/src/test/java/org/apache/druid/frame/field/StringFieldReaderTest.java @@ -23,7 +23,6 @@ import it.unimi.dsi.fastutil.objects.ObjectArrays; import junitparams.converters.Nullable; import org.apache.datasketches.memory.WritableMemory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.ISE; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.query.extraction.SubstringDimExtractionFn; @@ -106,8 +105,7 @@ public void test_isNull_nullRow() public void test_isNull_emptyString() { writeToMemory(Collections.singletonList("")); - Assert.assertEquals( - NullHandling.replaceWithDefault(), + Assert.assertFalse( new StringFieldReader().isNull(memory, MEMORY_POSITION) ); Assert.assertFalse(new StringArrayFieldReader().isNull(memory, MEMORY_POSITION)); diff --git a/processing/src/test/java/org/apache/druid/frame/field/StringFieldWriterTest.java b/processing/src/test/java/org/apache/druid/frame/field/StringFieldWriterTest.java index adde9f89cbd4..81d115d44a4e 100644 --- a/processing/src/test/java/org/apache/druid/frame/field/StringFieldWriterTest.java +++ b/processing/src/test/java/org/apache/druid/frame/field/StringFieldWriterTest.java @@ -20,7 +20,6 @@ package org.apache.druid.frame.field; import org.apache.datasketches.memory.WritableMemory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.frame.write.InvalidNullByteException; import org.apache.druid.java.util.common.ISE; import org.apache.druid.java.util.common.StringUtils; @@ -129,14 +128,14 @@ public void testMultiValueString() @Test public void testMultiValueStringContainingNulls() { - doTest(Arrays.asList("foo", NullHandling.emptyToNullIfNeeded(""), "bar", null)); + doTest(Arrays.asList("foo", "", "bar", null)); } @Test public void testNullByteReplacement() { doTest( - Arrays.asList("abc\u0000", "foo" + NullHandling.emptyToNullIfNeeded("") + "bar", "def"), + Arrays.asList("abc\u0000", "foobar", "def"), FieldWritersType.NULL_REPLACING ); } @@ -144,7 +143,7 @@ public void testNullByteReplacement() @Test public void testNullByteNotReplaced() { - mockSelectors(Arrays.asList("abc\u0000", "foo" + NullHandling.emptyToNullIfNeeded("") + "bar", "def")); + mockSelectors(Arrays.asList("abc\u0000", "foobar", "def")); Assert.assertThrows(InvalidNullByteException.class, () -> { doTestWithSpecificFieldWriter(fieldWriter); }); diff --git a/processing/src/test/java/org/apache/druid/frame/key/RowKeyReaderTest.java b/processing/src/test/java/org/apache/druid/frame/key/RowKeyReaderTest.java index 5aedecd3594c..e529598e1d98 100644 --- a/processing/src/test/java/org/apache/druid/frame/key/RowKeyReaderTest.java +++ b/processing/src/test/java/org/apache/druid/frame/key/RowKeyReaderTest.java @@ -19,7 +19,6 @@ package org.apache.druid.frame.key; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.frame.testutil.FrameTestUtil; import org.apache.druid.segment.column.ColumnType; import org.apache.druid.segment.column.RowSignature; @@ -53,14 +52,14 @@ public class RowKeyReaderTest extends InitializedNullHandlingTest private final List objects = Arrays.asList( 5L, - NullHandling.defaultLongValue(), + null, 6f, - NullHandling.defaultFloatValue(), + null, "foo", null, Arrays.asList("bar", "qux"), 7d, - NullHandling.defaultDoubleValue(), + null, new Object[]{"abc", "xyz"} ); diff --git a/processing/src/test/java/org/apache/druid/frame/write/FrameWriterTest.java b/processing/src/test/java/org/apache/druid/frame/write/FrameWriterTest.java index 073b83dbe22b..c5790d3a5041 100644 --- a/processing/src/test/java/org/apache/druid/frame/write/FrameWriterTest.java +++ b/processing/src/test/java/org/apache/druid/frame/write/FrameWriterTest.java @@ -19,9 +19,7 @@ package org.apache.druid.frame.write; -import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.frame.Frame; import org.apache.druid.frame.FrameType; import org.apache.druid.frame.allocation.ArenaMemoryAllocator; @@ -56,9 +54,7 @@ import org.apache.druid.segment.Segment; import org.apache.druid.segment.column.ColumnCapabilities; import org.apache.druid.segment.column.ColumnCapabilitiesImpl; -import org.apache.druid.segment.column.ColumnType; import org.apache.druid.segment.column.RowSignature; -import org.apache.druid.segment.column.ValueType; import org.apache.druid.segment.serde.ComplexMetrics; import org.apache.druid.testing.InitializedNullHandlingTest; import org.apache.druid.timeline.SegmentId; @@ -290,53 +286,6 @@ public void test_complex_nested() testWithDataset(FrameWriterTestData.TEST_COMPLEX_NESTED); } - @Test - public void test_readNullsInDefaultValueMode() - { - // Test that nulls written in SQL-compatible mode are read as nulls in default-value mode. - - final RowSignature signature = - RowSignature.builder() - .add("l1", ColumnType.LONG) - .add("f1", ColumnType.FLOAT) - .add("d1", ColumnType.DOUBLE) - .add("s1", ColumnType.STRING) - .add("l2", ColumnType.LONG) - .add("f2", ColumnType.FLOAT) - .add("d2", ColumnType.DOUBLE) - .add("s2", ColumnType.STRING) - .build(); - - final Pair writeResult; - - try { - // Write frame in SQL-compatible mode. - NullHandling.initializeForTestsWithValues(false, null); - final Sequence> rowSequence = - Sequences.simple(ImmutableList.of(Arrays.asList(null, null, null, null, 0L, 0f, 0d, ""))); - writeResult = writeFrame(rowSequence, signature, signature.getColumnNames()); - } - finally { - NullHandling.initializeForTests(); - } - - Assert.assertEquals(1, (int) writeResult.rhs); - - try { - // Read frame in default-value mode. - NullHandling.initializeForTestsWithValues(true, null); - verifyFrame( - // Empty string is read back as null. - Sequences.simple(ImmutableList.of(Arrays.asList(null, null, null, null, 0L, 0f, 0d, null))), - writeResult.lhs, - signature - ); - } - finally { - NullHandling.initializeForTests(); - } - } - @Test public void test_typePairs() { @@ -612,24 +561,6 @@ private static Pair writeFrame( } } - /** - * Returns a filler value for "type" if "o" is null. Used to pad value lists to the correct length. - */ - @Nullable - private static Object fillerValueForType(final ValueType type) - { - switch (type) { - case LONG: - return NullHandling.defaultLongValue(); - case FLOAT: - return NullHandling.defaultFloatValue(); - case DOUBLE: - return NullHandling.defaultDoubleValue(); - default: - return null; - } - } - /** * Create a row signature out of columnar lists of values. */ @@ -668,7 +599,7 @@ private static Sequence> unsortAndMakeRows( if (iterators.get(i).hasNext()) { row.add(iterators.get(i).next()); } else { - row.add(fillerValueForType(datasets.get(i).getType().getType())); + row.add(null); } } diff --git a/processing/src/test/java/org/apache/druid/frame/write/FrameWriterTestData.java b/processing/src/test/java/org/apache/druid/frame/write/FrameWriterTestData.java index d3720cd607c1..e2f0935bf8a1 100644 --- a/processing/src/test/java/org/apache/druid/frame/write/FrameWriterTestData.java +++ b/processing/src/test/java/org/apache/druid/frame/write/FrameWriterTestData.java @@ -23,7 +23,6 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import it.unimi.dsi.fastutil.objects.ObjectArrays; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.frame.key.ByteRowKeyComparatorTest; import org.apache.druid.frame.key.KeyOrder; import org.apache.druid.hll.HyperLogLogCollector; @@ -50,7 +49,7 @@ public class FrameWriterTestData ColumnType.STRING, Arrays.asList( null, - NullHandling.emptyToNullIfNeeded(""), // Empty string in SQL-compatible mode, null otherwise + "", "brown", "dog", "fox", @@ -74,7 +73,7 @@ public class FrameWriterTestData ColumnType.STRING, Arrays.asList( Collections.emptyList(), - NullHandling.emptyToNullIfNeeded(""), // Empty string in SQL-compatible mode, null otherwise + "", "brown", "dog", "fox", @@ -100,13 +99,13 @@ public class FrameWriterTestData Arrays.asList( Collections.emptyList(), null, - NullHandling.emptyToNullIfNeeded(""), + "", "foo", Arrays.asList("lazy", "dog"), "qux", Arrays.asList("the", "quick", "brown"), Arrays.asList("the", "quick", "brown", null), - Arrays.asList("the", "quick", "brown", NullHandling.emptyToNullIfNeeded("")), + Arrays.asList("the", "quick", "brown", ""), Arrays.asList("the", "quick", "brown", "fox"), Arrays.asList("the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"), Arrays.asList("the", "quick", "brown", "null"), @@ -126,12 +125,12 @@ public class FrameWriterTestData null, ObjectArrays.EMPTY_ARRAY, new Object[]{null}, - new Object[]{NullHandling.emptyToNullIfNeeded("")}, + new Object[]{""}, new Object[]{"dog"}, new Object[]{"lazy"}, new Object[]{"the", "quick", "brown"}, new Object[]{"the", "quick", "brown", null}, - new Object[]{"the", "quick", "brown", NullHandling.emptyToNullIfNeeded("")}, + new Object[]{"the", "quick", "brown", ""}, new Object[]{"the", "quick", "brown", "fox"}, new Object[]{"the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"}, new Object[]{"the", "quick", "brown", "null"}, @@ -143,7 +142,7 @@ public class FrameWriterTestData public static final Dataset TEST_LONGS = new Dataset<>( ColumnType.LONG, Stream.of( - NullHandling.defaultLongValue(), + null, 0L, -1L, 1L, @@ -167,7 +166,7 @@ public class FrameWriterTestData ObjectArrays.EMPTY_ARRAY, new Object[]{null}, new Object[]{null, 6L, null, 5L, null}, - new Object[]{null, 6L, null, 5L, NullHandling.defaultLongValue()}, + new Object[]{null, 6L, null, 5L, null}, new Object[]{null, 6L, null, 5L, 0L, -1L}, new Object[]{null, 6L, null, 5L, 0L, -1L, Long.MIN_VALUE}, new Object[]{null, 6L, null, 5L, 0L, -1L, Long.MAX_VALUE}, @@ -183,7 +182,7 @@ public class FrameWriterTestData Stream.of( 0f, -0f, - NullHandling.defaultFloatValue(), + null, -1f, 1f, //CHECKSTYLE.OFF: Regexp @@ -208,7 +207,7 @@ public class FrameWriterTestData ObjectArrays.EMPTY_ARRAY, new Object[]{null}, new Object[]{null, 6.2f, null, 5.1f, null}, - new Object[]{null, 6.2f, null, 5.1f, NullHandling.defaultFloatValue()}, + new Object[]{null, 6.2f, null, 5.1f, null}, new Object[]{null, 6.2f, null, 5.7f, 0.0f, -1.0f}, new Object[]{null, 6.2f, null, 5.7f, 0.0f, -1.0f, Float.MIN_VALUE}, new Object[]{null, 6.2f, null, 5.7f, 0.0f, -1.0f, Float.MAX_VALUE}, @@ -227,7 +226,7 @@ public class FrameWriterTestData Stream.of( 0d, -0d, - NullHandling.defaultDoubleValue(), + null, -1e-122d, 1e122d, //CHECKSTYLE.OFF: Regexp @@ -252,7 +251,7 @@ public class FrameWriterTestData ObjectArrays.EMPTY_ARRAY, new Object[]{null}, new Object[]{null, 6.2d, null, 5.1d, null}, - new Object[]{null, 6.2d, null, 5.1d, NullHandling.defaultDoubleValue()}, + new Object[]{null, 6.2d, null, 5.1d, null}, new Object[]{null, 6.2d, null, 5.7d, 0.0d, -1.0d}, new Object[]{null, 6.2d, null, 5.7d, 0.0d, -1.0d, Double.MIN_VALUE}, new Object[]{null, 6.2d, null, 5.7d, 0.0d, -1.0d, Double.MAX_VALUE}, diff --git a/processing/src/test/java/org/apache/druid/java/util/common/parsers/ParserUtilsTest.java b/processing/src/test/java/org/apache/druid/java/util/common/parsers/ParserUtilsTest.java index caf4fc030dac..05ea684a18a3 100644 --- a/processing/src/test/java/org/apache/druid/java/util/common/parsers/ParserUtilsTest.java +++ b/processing/src/test/java/org/apache/druid/java/util/common/parsers/ParserUtilsTest.java @@ -22,7 +22,6 @@ import com.google.common.base.Splitter; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; -import org.apache.druid.common.config.NullHandling; import org.junit.Test; import java.util.Collections; @@ -35,10 +34,6 @@ public class ParserUtilsTest { - static { - NullHandling.initializeForTests(); - } - @Test public void testFindDuplicatesMixedCases() { @@ -60,7 +55,7 @@ public void testInputWithDelimiterAndParserDisabled() getTransformationFunction("|", Splitter.on("|"), true).apply(null) ); assertEquals( - NullHandling.emptyToNullIfNeeded(""), + "", getTransformationFunction("|", Splitter.on("|"), true).apply("") ); assertEquals( @@ -122,7 +117,7 @@ public void testInputWithDelimiterAndParserEnabled() getTransformationFunction("|", Splitter.on("|"), true).apply(null) ); assertEquals( - NullHandling.emptyToNullIfNeeded(""), + "", getTransformationFunction("|", Splitter.on("|"), true).apply("") ); assertEquals( @@ -184,7 +179,7 @@ public void testInputWithoutDelimiterAndNumberParsingDisabled() getTransformationFunction("|", Splitter.on("$"), false).apply(null) ); assertEquals( - NullHandling.emptyToNullIfNeeded(""), + "", getTransformationFunction("|", Splitter.on("$"), false).apply("") ); assertEquals( @@ -238,7 +233,7 @@ public void testInputWithoutDelimiterAndNumberParsingEnabled() getTransformationFunction("$", Splitter.on("$"), true).apply(null) ); assertEquals( - NullHandling.emptyToNullIfNeeded(""), + "", getTransformationFunction("$", Splitter.on("$"), true).apply("") ); assertEquals( diff --git a/processing/src/test/java/org/apache/druid/math/expr/ApplyFunctionTest.java b/processing/src/test/java/org/apache/druid/math/expr/ApplyFunctionTest.java index 2eb0aadf0bd8..f07d7fc9475d 100644 --- a/processing/src/test/java/org/apache/druid/math/expr/ApplyFunctionTest.java +++ b/processing/src/test/java/org/apache/druid/math/expr/ApplyFunctionTest.java @@ -20,7 +20,6 @@ package org.apache.druid.math.expr; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.testing.InitializedNullHandlingTest; import org.junit.Assert; import org.junit.Before; @@ -76,13 +75,8 @@ public void testCartesianMap() assertExpr("cartesian_map((x, y) -> 1, [1, 2], [1, 2, 3])", new Long[] {1L, 1L, 1L, 1L, 1L, 1L}); assertExpr("cartesian_map((x, y) -> concat(x, y), d, d)", new String[] {null}); assertExpr("cartesian_map((x, y) -> concat(x, y), d, f)", new String[0]); - if (NullHandling.replaceWithDefault()) { - assertExpr("cartesian_map((x, y) -> concat(x, y), d, e)", new String[]{null, "foo", "bar"}); - assertExpr("cartesian_map((x, y) -> concat(x, y), e, e)", new String[] {null, "foo", "bar", "foo", "foofoo", "foobar", "bar", "barfoo", "barbar"}); - } else { - assertExpr("cartesian_map((x, y) -> concat(x, y), d, e)", new String[]{null, null, null}); - assertExpr("cartesian_map((x, y) -> concat(x, y), e, e)", new String[] {null, null, null, null, "foofoo", "foobar", null, "barfoo", "barbar"}); - } + assertExpr("cartesian_map((x, y) -> concat(x, y), d, e)", new String[]{null, null, null}); + assertExpr("cartesian_map((x, y) -> concat(x, y), e, e)", new String[] {null, null, null, null, "foofoo", "foobar", null, "barfoo", "barbar"}); } @Test diff --git a/processing/src/test/java/org/apache/druid/math/expr/EvalTest.java b/processing/src/test/java/org/apache/druid/math/expr/EvalTest.java index ae515d13abfc..f03956022226 100644 --- a/processing/src/test/java/org/apache/druid/math/expr/EvalTest.java +++ b/processing/src/test/java/org/apache/druid/math/expr/EvalTest.java @@ -23,7 +23,6 @@ import com.google.common.collect.ImmutableMap; import junitparams.converters.Nullable; import org.apache.druid.collections.SerializablePair; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.IAE; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.segment.column.TypeStrategies; @@ -41,6 +40,7 @@ import java.util.Map; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; /** */ @@ -183,7 +183,7 @@ public void testLongEval() assertEquals(1271023381L, evalLong("unix_timestamp('2010-04-12T07:03:01+09:00')", bindings)); assertEquals(1271023381L, evalLong("unix_timestamp('2010-04-12T07:03:01.419+09:00')", bindings)); assertEquals( - NullHandling.replaceWithDefault() ? "NULL" : "", + "", eval("nvl(if(x == 9223372036854775807, '', 'x'), 'NULL')", bindings).asString() ); assertEquals("x", eval("nvl(if(x == 9223372036854775806, '', 'x'), 'NULL')", bindings).asString()); @@ -832,55 +832,28 @@ public void testNonNestedComplexCastThrows() @Test public void testIsNumericNull() { - if (NullHandling.sqlCompatible()) { - Assert.assertFalse(ExprEval.ofLong(1L).isNumericNull()); - Assert.assertTrue(ExprEval.ofLong(null).isNumericNull()); + Assert.assertFalse(ExprEval.ofLong(1L).isNumericNull()); + Assert.assertTrue(ExprEval.ofLong(null).isNumericNull()); - Assert.assertFalse(ExprEval.ofDouble(1.0).isNumericNull()); - Assert.assertTrue(ExprEval.ofDouble(null).isNumericNull()); + Assert.assertFalse(ExprEval.ofDouble(1.0).isNumericNull()); + Assert.assertTrue(ExprEval.ofDouble(null).isNumericNull()); - Assert.assertTrue(ExprEval.of(null).isNumericNull()); - Assert.assertTrue(ExprEval.of("one").isNumericNull()); - Assert.assertFalse(ExprEval.of("1").isNumericNull()); + Assert.assertTrue(ExprEval.of(null).isNumericNull()); + Assert.assertTrue(ExprEval.of("one").isNumericNull()); + Assert.assertFalse(ExprEval.of("1").isNumericNull()); - Assert.assertFalse(ExprEval.ofLongArray(new Long[]{1L}).isNumericNull()); - Assert.assertTrue(ExprEval.ofLongArray(new Long[]{null, 2L, 3L}).isNumericNull()); - Assert.assertTrue(ExprEval.ofLongArray(new Long[]{null}).isNumericNull()); + Assert.assertFalse(ExprEval.ofLongArray(new Long[]{1L}).isNumericNull()); + Assert.assertTrue(ExprEval.ofLongArray(new Long[]{null, 2L, 3L}).isNumericNull()); + Assert.assertTrue(ExprEval.ofLongArray(new Long[]{null}).isNumericNull()); - Assert.assertFalse(ExprEval.ofDoubleArray(new Double[]{1.1}).isNumericNull()); - Assert.assertTrue(ExprEval.ofDoubleArray(new Double[]{null, 1.1, 2.2}).isNumericNull()); - Assert.assertTrue(ExprEval.ofDoubleArray(new Double[]{null}).isNumericNull()); + Assert.assertFalse(ExprEval.ofDoubleArray(new Double[]{1.1}).isNumericNull()); + Assert.assertTrue(ExprEval.ofDoubleArray(new Double[]{null, 1.1, 2.2}).isNumericNull()); + Assert.assertTrue(ExprEval.ofDoubleArray(new Double[]{null}).isNumericNull()); - Assert.assertFalse(ExprEval.ofStringArray(new String[]{"1"}).isNumericNull()); - Assert.assertTrue(ExprEval.ofStringArray(new String[]{null, "1", "2"}).isNumericNull()); - Assert.assertTrue(ExprEval.ofStringArray(new String[]{"one"}).isNumericNull()); - Assert.assertTrue(ExprEval.ofStringArray(new String[]{null}).isNumericNull()); - } else { - Assert.assertFalse(ExprEval.ofLong(1L).isNumericNull()); - Assert.assertFalse(ExprEval.ofLong(null).isNumericNull()); - - Assert.assertFalse(ExprEval.ofDouble(1.0).isNumericNull()); - Assert.assertFalse(ExprEval.ofDouble(null).isNumericNull()); - - // strings are still null - Assert.assertTrue(ExprEval.of(null).isNumericNull()); - Assert.assertTrue(ExprEval.of("one").isNumericNull()); - Assert.assertFalse(ExprEval.of("1").isNumericNull()); - - // arrays can still have nulls - Assert.assertFalse(ExprEval.ofLongArray(new Long[]{1L}).isNumericNull()); - Assert.assertTrue(ExprEval.ofLongArray(new Long[]{null, 2L, 3L}).isNumericNull()); - Assert.assertTrue(ExprEval.ofLongArray(new Long[]{null}).isNumericNull()); - - Assert.assertFalse(ExprEval.ofDoubleArray(new Double[]{1.1}).isNumericNull()); - Assert.assertTrue(ExprEval.ofDoubleArray(new Double[]{null, 1.1, 2.2}).isNumericNull()); - Assert.assertTrue(ExprEval.ofDoubleArray(new Double[]{null}).isNumericNull()); - - Assert.assertFalse(ExprEval.ofStringArray(new String[]{"1"}).isNumericNull()); - Assert.assertTrue(ExprEval.ofStringArray(new String[]{null, "1", "2"}).isNumericNull()); - Assert.assertTrue(ExprEval.ofStringArray(new String[]{"one"}).isNumericNull()); - Assert.assertTrue(ExprEval.ofStringArray(new String[]{null}).isNumericNull()); - } + Assert.assertFalse(ExprEval.ofStringArray(new String[]{"1"}).isNumericNull()); + Assert.assertTrue(ExprEval.ofStringArray(new String[]{null, "1", "2"}).isNumericNull()); + Assert.assertTrue(ExprEval.ofStringArray(new String[]{"one"}).isNumericNull()); + Assert.assertTrue(ExprEval.ofStringArray(new String[]{null}).isNumericNull()); } @Test @@ -962,15 +935,13 @@ public void testLogicalOperators() assertEquals(1L, eval("null || 1", bindings).value()); assertEquals(1L, eval("1 || null", bindings).value()); - // in sql incompatible mode, null is false, so we return 0 - assertEquals(NullHandling.defaultLongValue(), eval("null || 0", bindings).valueOrDefault()); - assertEquals(NullHandling.defaultLongValue(), eval("0 || null", bindings).valueOrDefault()); - assertEquals(NullHandling.defaultLongValue(), eval("null || null", bindings).valueOrDefault()); - - // in sql incompatible mode, null is false, so we return 0 - assertEquals(NullHandling.defaultLongValue(), eval("null && 1", bindings).valueOrDefault()); - assertEquals(NullHandling.defaultLongValue(), eval("1 && null", bindings).valueOrDefault()); - assertEquals(NullHandling.defaultLongValue(), eval("null && null", bindings).valueOrDefault()); + assertNull(eval("null || 0", bindings).valueOrDefault()); + assertNull(eval("0 || null", bindings).valueOrDefault()); + assertNull(eval("null || null", bindings).valueOrDefault()); + + assertNull(eval("null && 1", bindings).valueOrDefault()); + assertNull(eval("1 && null", bindings).valueOrDefault()); + assertNull(eval("null && null", bindings).valueOrDefault()); // if either side is false, output is false in both modes assertEquals(0L, eval("null && 0", bindings).value()); assertEquals(0L, eval("0 && null", bindings).value()); @@ -1079,19 +1050,10 @@ public void testValueOrDefault() { ExprEval longNull = ExprEval.ofLong(null); ExprEval doubleNull = ExprEval.ofDouble(null); - Assert.assertEquals(NullHandling.sqlCompatible(), longNull.isNumericNull()); - Assert.assertEquals(NullHandling.sqlCompatible(), doubleNull.isNumericNull()); - Assert.assertEquals(NullHandling.defaultLongValue(), longNull.valueOrDefault()); - Assert.assertEquals(NullHandling.defaultDoubleValue(), doubleNull.valueOrDefault()); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(0L, longNull.asLong()); - Assert.assertEquals(0, longNull.asInt()); - Assert.assertEquals(0.0, longNull.asDouble(), 0.0); - - Assert.assertEquals(0L, doubleNull.asLong()); - Assert.assertEquals(0, doubleNull.asInt()); - Assert.assertEquals(0.0, doubleNull.asDouble(), 0.0); - } + Assert.assertTrue(longNull.isNumericNull()); + Assert.assertTrue(doubleNull.isNumericNull()); + Assert.assertNull(null, longNull.valueOrDefault()); + Assert.assertNull(null, doubleNull.valueOrDefault()); } @Test diff --git a/processing/src/test/java/org/apache/druid/math/expr/FunctionTest.java b/processing/src/test/java/org/apache/druid/math/expr/FunctionTest.java index 40aa6a30ac41..91d4fbdf0c75 100644 --- a/processing/src/test/java/org/apache/druid/math/expr/FunctionTest.java +++ b/processing/src/test/java/org/apache/druid/math/expr/FunctionTest.java @@ -22,7 +22,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; import org.apache.druid.guice.BuiltInTypesModule; import org.apache.druid.java.util.common.IAE; @@ -183,11 +182,7 @@ public void testCaseSearched() public void testConcat() { assertExpr("concat(x,' ',y)", "foo 2"); - if (NullHandling.replaceWithDefault()) { - assertExpr("concat(x,' ',nonexistent,' ',y)", "foo 2"); - } else { - assertArrayExpr("concat(x,' ',nonexistent,' ',y)", null); - } + assertArrayExpr("concat(x,' ',nonexistent,' ',y)", null); assertExpr("concat(z)", "3.1"); assertArrayExpr("concat()", null); @@ -262,17 +257,17 @@ public void testLpad() assertExpr("lpad(x, 5, 'ab')", "abfoo"); assertExpr("lpad(x, 4, 'ab')", "afoo"); assertExpr("lpad(x, 2, 'ab')", "fo"); - assertExpr("lpad(x, -1, 'ab')", NullHandling.replaceWithDefault() ? null : ""); + assertExpr("lpad(x, -1, 'ab')", ""); assertExpr("lpad(null, 5, 'ab')", null); - assertExpr("lpad(x, 2, '')", NullHandling.replaceWithDefault() ? null : "fo"); - assertExpr("lpad(x, 6, '')", NullHandling.replaceWithDefault() ? null : "foo"); - assertExpr("lpad('', 3, '*')", NullHandling.replaceWithDefault() ? null : "***"); + assertExpr("lpad(x, 2, '')", "fo"); + assertExpr("lpad(x, 6, '')", "foo"); + assertExpr("lpad('', 3, '*')", "***"); assertExpr("lpad(x, 2, null)", null); assertExpr("lpad(a, 4, '*')", "[foo"); assertExpr("lpad(a, 2, '*')", "[f"); - assertExpr("lpad(a, 2, '')", NullHandling.replaceWithDefault() ? null : "[f"); + assertExpr("lpad(a, 2, '')", "[f"); assertExpr("lpad(b, 4, '*')", "[1, "); - assertExpr("lpad(b, 2, '')", NullHandling.replaceWithDefault() ? null : "[1"); + assertExpr("lpad(b, 2, '')", "[1"); assertExpr("lpad(b, 2, null)", null); assertExpr("lpad(x, 5, x)", "fofoo"); assertExpr("lpad(x, 5, y)", "22foo"); @@ -287,16 +282,16 @@ public void testRpad() assertExpr("rpad(x, 5, 'ab')", "fooab"); assertExpr("rpad(x, 4, 'ab')", "fooa"); assertExpr("rpad(x, 2, 'ab')", "fo"); - assertExpr("rpad(x, -1, 'ab')", NullHandling.replaceWithDefault() ? null : ""); + assertExpr("rpad(x, -1, 'ab')", ""); assertExpr("rpad(null, 5, 'ab')", null); - assertExpr("rpad(x, 2, '')", NullHandling.replaceWithDefault() ? null : "fo"); - assertExpr("rpad(x, 6, '')", NullHandling.replaceWithDefault() ? null : "foo"); - assertExpr("rpad('', 3, '*')", NullHandling.replaceWithDefault() ? null : "***"); + assertExpr("rpad(x, 2, '')", "fo"); + assertExpr("rpad(x, 6, '')", "foo"); + assertExpr("rpad('', 3, '*')", "***"); assertExpr("rpad(x, 2, null)", null); assertExpr("rpad(a, 2, '*')", "[f"); - assertExpr("rpad(a, 2, '')", NullHandling.replaceWithDefault() ? null : "[f"); + assertExpr("rpad(a, 2, '')", "[f"); assertExpr("rpad(b, 4, '*')", "[1, "); - assertExpr("rpad(b, 2, '')", NullHandling.replaceWithDefault() ? null : "[1"); + assertExpr("rpad(b, 2, '')", "[1"); assertExpr("rpad(b, 2, null)", null); assertExpr("rpad(x, 5, x)", "foofo"); assertExpr("rpad(x, 5, y)", "foo22"); @@ -356,7 +351,7 @@ public void testArrayOrdinal() public void testArrayOffsetOf() { assertExpr("array_offset_of([1, 2, 3], 3)", 2L); - assertExpr("array_offset_of([1, 2, 3], 4)", NullHandling.replaceWithDefault() ? -1L : null); + assertExpr("array_offset_of([1, 2, 3], 4)", null); assertExpr("array_offset_of(a, 'baz')", 2L); } @@ -364,7 +359,7 @@ public void testArrayOffsetOf() public void testArrayOrdinalOf() { assertExpr("array_ordinal_of([1, 2, 3], 3)", 3L); - assertExpr("array_ordinal_of([1, 2, 3], 4)", NullHandling.replaceWithDefault() ? -1L : null); + assertExpr("array_ordinal_of([1, 2, 3], 4)", null); assertExpr("array_ordinal_of(a, 'baz')", 3L); } @@ -609,21 +604,7 @@ public void testRoundWithNullValueOrInvalid() Pair.of("a", "ARRAY") ); for (Pair argAndType : invalidArguments) { - if (NullHandling.sqlCompatible()) { - assertExpr(StringUtils.format("round(%s)", argAndType.lhs), null); - } else { - Throwable t = Assert.assertThrows( - DruidException.class, - () -> assertExpr(StringUtils.format("round(%s)", argAndType.lhs), null) - ); - Assert.assertEquals( - StringUtils.format( - "Function[round] first argument should be a LONG or DOUBLE but got %s instead", - argAndType.rhs - ), - t.getMessage() - ); - } + assertExpr(StringUtils.format("round(%s)", argAndType.lhs), null); } } @@ -752,7 +733,7 @@ public void testSizeFormatWithDifferentPrecision() public void testSizeFormatWithEdgeCases() { //a nonexist value is null which is treated as 0 - assertExpr("human_readable_binary_byte_format(nonexist)", NullHandling.sqlCompatible() ? null : "0 B"); + assertExpr("human_readable_binary_byte_format(nonexist)", null); //f = 12.34 assertExpr("human_readable_binary_byte_format(f)", "12 B"); @@ -779,19 +760,6 @@ public void testSizeFormatWithEdgeCases() @Test public void testSizeForatInvalidArgumentType() { - if (NullHandling.replaceWithDefault()) { - //x = "foo" - Throwable t = Assert.assertThrows( - DruidException.class, - () -> Parser.parse("human_readable_binary_byte_format(x)", ExprMacroTable.nil()) - .eval(bestEffortBindings) - ); - Assert.assertEquals( - "Function[human_readable_binary_byte_format] needs a number as its first argument but got STRING instead", - t.getMessage() - ); - } - // x = "foo" Throwable t = Assert.assertThrows( DruidException.class, @@ -917,7 +885,7 @@ public void testBitwise() assertExpr("bitwiseAnd('2', '1')", null); // but one is ok, druid forgives you assertExpr("bitwiseAnd(3, '1')", 1L); - assertExpr("bitwiseAnd(2, null)", NullHandling.replaceWithDefault() ? 0L : null); + assertExpr("bitwiseAnd(2, null)", null); // unary doesn't accept any slop assertExpr("bitwiseComplement('1')", null); @@ -964,7 +932,7 @@ public void testBitwise() @Test public void testLeft() { - assertExpr("left('hello', 0)", NullHandling.sqlCompatible() ? "" : null); + assertExpr("left('hello', 0)", ""); assertExpr("left('hello', 2)", "he"); assertExpr("left('hello', '2')", "he"); assertExpr("left('hello', 'hello')", null); @@ -984,7 +952,7 @@ public void testLeft() @Test public void testRight() { - assertExpr("right('hello', 0)", NullHandling.sqlCompatible() ? "" : null); + assertExpr("right('hello', 0)", ""); assertExpr("right('hello', 2)", "lo"); assertExpr("right('hello', '2')", "lo"); assertExpr("right('hello', 'hello')", null); @@ -1031,7 +999,7 @@ public void testDecodeBase64UTF() "When an onion is cut, certain (lachrymator) compounds are released causing the nerves around the eyes (lacrimal glands) to become irritated." ); assertExpr("decode_base64_utf8('eyJ0ZXN0IjogMX0=')", "{\"test\": 1}"); - assertExpr("decode_base64_utf8('')", NullHandling.sqlCompatible() ? "" : null); + assertExpr("decode_base64_utf8('')", ""); } @Test diff --git a/processing/src/test/java/org/apache/druid/math/expr/VectorExprSanityTest.java b/processing/src/test/java/org/apache/druid/math/expr/VectorExprSanityTest.java index ef7ab7fa4f85..5b53bf525efa 100644 --- a/processing/src/test/java/org/apache/druid/math/expr/VectorExprSanityTest.java +++ b/processing/src/test/java/org/apache/druid/math/expr/VectorExprSanityTest.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.NonnullPair; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.java.util.common.logger.Logger; @@ -186,12 +185,7 @@ public void testUnivariateMathFunctions() "bitwiseConvertLongBitsToDouble" }; final String[] templates; - if (NullHandling.sqlCompatible()) { - templates = new String[]{"%s(l1)", "%s(d1)", "%s(pi())", "%s(null)", "%s(missing)"}; - } else { - // missing columns are not vectorizable in default value mode - templates = new String[]{"%s(l1)", "%s(d1)", "%s(pi())", "%s(null)"}; - } + templates = new String[]{"%s(l1)", "%s(d1)", "%s(pi())", "%s(null)", "%s(missing)"}; testFunctions(types, templates, functions); } @@ -503,7 +497,6 @@ static NonnullPair makeBindings( SettableVectorInputBinding vectorBinding = new SettableVectorInputBinding(vectorSize); SettableObjectBinding[] objectBindings = new SettableObjectBinding[vectorSize]; - final boolean hasNulls = NullHandling.sqlCompatible(); for (Map.Entry entry : types.entrySet()) { boolean[] nulls = new boolean[vectorSize]; @@ -511,39 +504,31 @@ static NonnullPair makeBindings( case LONG: long[] longs = new long[vectorSize]; for (int i = 0; i < vectorSize; i++) { - nulls[i] = hasNulls && nullsFn.getAsBoolean(); + nulls[i] = nullsFn.getAsBoolean(); longs[i] = nulls[i] ? 0L : longsFn.getAsLong(); if (objectBindings[i] == null) { objectBindings[i] = new SettableObjectBinding(); } objectBindings[i].withBinding(entry.getKey(), nulls[i] ? null : longs[i]); } - if (hasNulls) { - vectorBinding.addLong(entry.getKey(), longs, nulls); - } else { - vectorBinding.addLong(entry.getKey(), longs); - } + vectorBinding.addLong(entry.getKey(), longs, nulls); break; case DOUBLE: double[] doubles = new double[vectorSize]; for (int i = 0; i < vectorSize; i++) { - nulls[i] = hasNulls && nullsFn.getAsBoolean(); + nulls[i] = nullsFn.getAsBoolean(); doubles[i] = nulls[i] ? 0.0 : doublesFn.getAsDouble(); if (objectBindings[i] == null) { objectBindings[i] = new SettableObjectBinding(); } objectBindings[i].withBinding(entry.getKey(), nulls[i] ? null : doubles[i]); } - if (hasNulls) { - vectorBinding.addDouble(entry.getKey(), doubles, nulls); - } else { - vectorBinding.addDouble(entry.getKey(), doubles); - } + vectorBinding.addDouble(entry.getKey(), doubles, nulls); break; case STRING: String[] strings = new String[vectorSize]; for (int i = 0; i < vectorSize; i++) { - nulls[i] = hasNulls && nullsFn.getAsBoolean(); + nulls[i] = nullsFn.getAsBoolean(); if (!nulls[i] && entry.getKey().startsWith("boolString")) { strings[i] = String.valueOf(nullsFn.getAsBoolean()); } else { @@ -667,7 +652,7 @@ public double[] getDoubleVector(String name) public boolean[] getNullVector(String name) { final boolean[] defaultVector = new boolean[getCurrentVectorSize()]; - Arrays.fill(defaultVector, NullHandling.sqlCompatible()); + Arrays.fill(defaultVector, true); return nulls.getOrDefault(name, defaultVector); } diff --git a/processing/src/test/java/org/apache/druid/math/expr/vector/FallbackVectorProcessorTest.java b/processing/src/test/java/org/apache/druid/math/expr/vector/FallbackVectorProcessorTest.java index 14a0f054c524..f921984ff9c2 100644 --- a/processing/src/test/java/org/apache/druid/math/expr/vector/FallbackVectorProcessorTest.java +++ b/processing/src/test/java/org/apache/druid/math/expr/vector/FallbackVectorProcessorTest.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.ISE; import org.apache.druid.math.expr.Expr; import org.apache.druid.math.expr.ExprMacroTable; @@ -184,7 +183,7 @@ public void test_case_long_double() Assert.assertEquals(ExpressionType.DOUBLE, eval.getType()); Assert.assertArrayEquals( - new Object[]{101.0, NullHandling.defaultDoubleValue(), 1.3}, + new Object[]{101.0, null, 1.3}, eval.getObjectVector() ); Assert.assertArrayEquals( @@ -193,7 +192,7 @@ public void test_case_long_double() 0 ); Assert.assertArrayEquals( - NullHandling.sqlCompatible() ? new boolean[]{false, true, false} : null, + new boolean[]{false, true, false}, eval.getNullVector() ); } @@ -234,7 +233,7 @@ public void test_concat_string_doubleNoNulls() Assert.assertEquals(ExpressionType.STRING, eval.getType()); Assert.assertArrayEquals( - new Object[]{"foo3.1", NullHandling.sqlCompatible() ? null : "3.2", "baz3.3"}, + new Object[]{"foo3.1", null, "baz3.3"}, eval.getObjectVector() ); } diff --git a/processing/src/test/java/org/apache/druid/query/FrameBasedInlineDataSourceSerializerTest.java b/processing/src/test/java/org/apache/druid/query/FrameBasedInlineDataSourceSerializerTest.java index 238997c2e53a..6b60f8263221 100644 --- a/processing/src/test/java/org/apache/druid/query/FrameBasedInlineDataSourceSerializerTest.java +++ b/processing/src/test/java/org/apache/druid/query/FrameBasedInlineDataSourceSerializerTest.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.frame.Frame; import org.apache.druid.frame.allocation.HeapMemoryAllocator; import org.apache.druid.frame.allocation.SingleMemoryAllocatorFactory; @@ -45,11 +44,6 @@ public class FrameBasedInlineDataSourceSerializerTest { - - static { - NullHandling.initializeForTests(); - } - private static final Interval INTERVAL = Intervals.of("2000/P1Y"); private static final RowSignature FOO_INLINE_SIGNATURE = RowSignature.builder() diff --git a/processing/src/test/java/org/apache/druid/query/JoinDataSourceTest.java b/processing/src/test/java/org/apache/druid/query/JoinDataSourceTest.java index ac3786282cf5..8b2dd464479e 100644 --- a/processing/src/test/java/org/apache/druid/query/JoinDataSourceTest.java +++ b/processing/src/test/java/org/apache/druid/query/JoinDataSourceTest.java @@ -24,7 +24,6 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterators; import nl.jqno.equalsverifier.EqualsVerifier; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.math.expr.ExprMacroTable; import org.apache.druid.query.filter.InDimFilter; @@ -506,7 +505,6 @@ public void testGetAnalysisWithFilteredDS() public void test_computeJoinDataSourceCacheKey_keyChangesWithBaseFilter() { JoinableFactoryWrapper joinableFactoryWrapper = new JoinableFactoryWrapper(new JoinableFactoryWithCacheKey()); - NullHandling.initializeForTests(); final InDimFilter expectedInDimFilter = new InDimFilter("dimTest", Arrays.asList("good", "bad"), null); JoinDataSource joinDataSource = JoinDataSource.create( diff --git a/processing/src/test/java/org/apache/druid/query/MultiValuedDimensionTest.java b/processing/src/test/java/org/apache/druid/query/MultiValuedDimensionTest.java index 09a16932bcf9..37de8dca8dae 100644 --- a/processing/src/test/java/org/apache/druid/query/MultiValuedDimensionTest.java +++ b/processing/src/test/java/org/apache/druid/query/MultiValuedDimensionTest.java @@ -23,7 +23,6 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import org.apache.druid.collections.CloseableStupidPool; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.impl.CSVParseSpec; import org.apache.druid.data.input.impl.DimensionsSpec; import org.apache.druid.data.input.impl.JSONParseSpec; @@ -240,7 +239,7 @@ public void testGroupByNoFilter() query, "1970", "tags", - NullHandling.replaceWithDefault() ? null : "", + "", "count", 2L ), @@ -342,22 +341,10 @@ public void testGroupByWithDimFilterNullishResults() query ); - List expectedResults; - // an empty row e.g. [], or group by 'missing' value, is grouped with the default string value, "" or null - // grouping input is filtered to [], null, [""] - if (NullHandling.replaceWithDefault()) { - // when sql compatible null handling is disabled, the inputs are effectively [], null, [null] and - // are all grouped as null - expectedResults = Collections.singletonList( - GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970-01-01T00:00:00.000Z", "tags", null, "count", 6L) - ); - } else { - // with sql compatible null handling, null and [] = null, but [""] = "" - expectedResults = ImmutableList.of( - GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970-01-01T00:00:00.000Z", "tags", null, "count", 4L), - GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970-01-01T00:00:00.000Z", "tags", "", "count", 2L) - ); - } + List expectedResults = ImmutableList.of( + GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970-01-01T00:00:00.000Z", "tags", null, "count", 4L), + GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970-01-01T00:00:00.000Z", "tags", "", "count", 2L) + ); TestHelper.assertExpectedObjects(expectedResults, result.toList(), "filter-nullish"); } @@ -425,7 +412,7 @@ public void testGroupByExpression() query, "1970", "texpr", - NullHandling.sqlCompatible() ? "foo" : null, + "foo", "count", 2L ), @@ -473,20 +460,12 @@ public void testGroupByExpressionMultiMulti() List expectedResults = - NullHandling.sqlCompatible() ? Arrays.asList( GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970", "texpr", "t1u1", "count", 2L), GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970", "texpr", "t1u2", "count", 2L), GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970", "texpr", "t2u1", "count", 2L), GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970", "texpr", "t2u2", "count", 2L), GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970", "texpr", "t3u1", "count", 2L) - ) : - Arrays.asList( - GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970", "texpr", null, "count", 2L), - GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970", "texpr", "t1u1", "count", 2L), - GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970", "texpr", "t1u2", "count", 2L), - GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970", "texpr", "t2u1", "count", 2L), - GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970", "texpr", "t2u2", "count", 2L) ); TestHelper.assertExpectedObjects(expectedResults, result.toList(), "expr-multi-multi"); @@ -658,7 +637,7 @@ public void testGroupByExpressionMultiMultiAutoAutoDupeIdentifier() query, "1970", "texpr", - NullHandling.emptyToNullIfNeeded(""), + "", "count", 2L ), @@ -785,19 +764,10 @@ public void testGroupByExpressionArrayExpressionFilter() query ); - List expectedResults; - if (NullHandling.replaceWithDefault()) { - expectedResults = Arrays.asList( - GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970", "tt", -1L, "count", 4L), - GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970", "tt", 0L, "count", 2L), - GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970", "tt", 1L, "count", 2L) - ); - } else { - expectedResults = Arrays.asList( - GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970", "tt", null, "count", 6L), - GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970", "tt", 1L, "count", 2L) - ); - } + List expectedResults = Arrays.asList( + GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970", "tt", null, "count", 6L), + GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970", "tt", 1L, "count", 2L) + ); TestHelper.assertExpectedObjects(expectedResults, result.toList(), "expr-auto"); } @@ -832,7 +802,7 @@ public void testGroupByExpressionArrayFnArg() ); List expectedResults = Arrays.asList( - GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970", "tt", NullHandling.replaceWithDefault() ? null : "foo", "count", 2L), + GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970", "tt", "foo", "count", 2L), GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970", "tt", "foot1, foot2, foot3", "count", 2L), GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970", "tt", "foot3, foot4, foot5", "count", 2L), GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970", "tt", "foot5, foot6, foot7", "count", 2L) @@ -915,7 +885,7 @@ public void testGroupByExpressionFoldArrayToString() query, "1970-01-01T00:00:00.000Z", "tt", - NullHandling.replaceWithDefault() ? null : "", + "", "count", 2L ), @@ -957,7 +927,7 @@ public void testGroupByExpressionFoldArrayToStringWithConcats() ); List expectedResults = Arrays.asList( - GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970", "tt", NullHandling.replaceWithDefault() ? null : "foo", "count", 2L), + GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970", "tt", "foo", "count", 2L), GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970", "tt", "foot1, foot2, foot3", "count", 2L), GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970", "tt", "foot3, foot4, foot5", "count", 2L), GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970", "tt", "foot5, foot6, foot7", "count", 2L) @@ -1119,7 +1089,7 @@ public void testTopNExpression() Sequence> result = runner.run(QueryPlus.wrap(query)); final Map thirdMap = new HashMap<>(); - thirdMap.put("texpr", NullHandling.sqlCompatible() ? "foo" : null); + thirdMap.put("texpr", "foo"); thirdMap.put("count", 1L); List> expected = diff --git a/processing/src/test/java/org/apache/druid/query/SchemaEvolutionTest.java b/processing/src/test/java/org/apache/druid/query/SchemaEvolutionTest.java index 70ede4c6513a..165adbcb0b41 100644 --- a/processing/src/test/java/org/apache/druid/query/SchemaEvolutionTest.java +++ b/processing/src/test/java/org/apache/druid/query/SchemaEvolutionTest.java @@ -25,7 +25,6 @@ import com.google.common.io.Closeables; import junitparams.JUnitParamsRunner; import junitparams.Parameters; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.data.input.impl.DimensionsSpec; import org.apache.druid.data.input.impl.MapInputRowParser; @@ -148,8 +147,6 @@ public static > List runQuery( @Before public void setUp() throws IOException { - NullHandling.initializeForTests(); - // Index1: c1 is a string, c2 nonexistent, "uniques" nonexistent index1 = IndexBuilder.create() .tmpDir(temporaryFolder.newFolder()) @@ -297,10 +294,10 @@ public void testNumericEvolutionTimeseriesAggregation(boolean doVectorize) // Only nonexistent(4) Map result = new HashMap<>(); - result.put("a", NullHandling.defaultLongValue()); - result.put("b", NullHandling.defaultDoubleValue()); - result.put("c", NullHandling.defaultLongValue()); - result.put("d", NullHandling.defaultDoubleValue()); + result.put("a", null); + result.put("b", null); + result.put("c", null); + result.put("d", null); Assert.assertEquals( timeseriesResult(result), runQuery(query, factory, ImmutableList.of(index4)) @@ -377,15 +374,15 @@ public void testNumericEvolutionFiltering(boolean doVectorize) Assert.assertEquals( timeseriesResult(TestHelper.makeMap( "a", - NullHandling.defaultLongValue(), + null, "b", - NullHandling.defaultDoubleValue(), + null, "c", 0L, "d", - NullHandling.defaultFloatValue(), + null, "e", - NullHandling.sqlCompatible() ? null : Long.MAX_VALUE + null )), runQuery(query, factory, ImmutableList.of(index4)) ); diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/DoubleMaxAggregationTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/DoubleMaxAggregationTest.java index 21c8aeacc254..3c67586667bc 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/DoubleMaxAggregationTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/DoubleMaxAggregationTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.segment.ColumnSelectorFactory; import org.apache.druid.segment.TestHelper; import org.apache.druid.segment.column.ColumnCapabilitiesImpl; @@ -59,7 +58,6 @@ public DoubleMaxAggregationTest() throws Exception @Before public void setup() { - NullHandling.initializeForTests(); selector = new TestDoubleColumnSelectorImpl(values); colSelectorFactory = EasyMock.createMock(ColumnSelectorFactory.class); EasyMock.expect(colSelectorFactory.makeColumnValueSelector("nilly")).andReturn(selector); diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/DoubleMinAggregationTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/DoubleMinAggregationTest.java index 40f72719f7ff..d3aa317b2fef 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/DoubleMinAggregationTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/DoubleMinAggregationTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.segment.ColumnSelectorFactory; import org.apache.druid.segment.TestHelper; import org.apache.druid.segment.column.ColumnCapabilitiesImpl; @@ -59,7 +58,6 @@ public DoubleMinAggregationTest() throws Exception @Before public void setup() { - NullHandling.initializeForTests(); selector = new TestDoubleColumnSelectorImpl(values); colSelectorFactory = EasyMock.createMock(ColumnSelectorFactory.class); EasyMock.expect(colSelectorFactory.makeColumnValueSelector("nilly")).andReturn(selector); diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/FilteredAggregatorTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/FilteredAggregatorTest.java index ba86bef8bdad..8495e3d67df5 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/FilteredAggregatorTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/FilteredAggregatorTest.java @@ -20,7 +20,6 @@ package org.apache.druid.query.aggregation; import com.google.common.collect.Lists; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.js.JavaScriptConfig; import org.apache.druid.query.dimension.DimensionSpec; import org.apache.druid.query.extraction.ExtractionFn; @@ -99,7 +98,7 @@ public void testAggregateOnlyWithNulls() new SelectorDimFilter("dim", "a", null) ); - final Float[] expectedValues = {NullHandling.defaultFloatValue(), NullHandling.defaultFloatValue()}; + final Float[] expectedValues = {null, null}; validateFilteredAggs(factory, selector, expectedValues); } @@ -407,13 +406,8 @@ private void validateFilteredAggs( ); // Validate state before any aggregation - if (NullHandling.sqlCompatible()) { - Assert.assertTrue(agg.isNull()); - Assert.assertNull(agg.get()); - } else { - Assert.assertFalse(agg.isNull()); - Assert.assertEquals(0.0f, agg.getFloat(), 0.001); - } + Assert.assertTrue(agg.isNull()); + Assert.assertNull(agg.get()); for (Float expectedValue : expectedValues) { aggregate(selector, agg); diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/FloatMaxAggregationTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/FloatMaxAggregationTest.java index 4b23e96b1b29..7fdcc0c54735 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/FloatMaxAggregationTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/FloatMaxAggregationTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.segment.TestHelper; import org.apache.druid.segment.column.ColumnCapabilitiesImpl; import org.apache.druid.segment.column.ColumnType; @@ -50,8 +49,6 @@ public FloatMaxAggregationTest() throws Exception @Before public void setup() { - NullHandling.initializeForTests(); - VectorValueSelector vectorValueSelector = EasyMock.createMock(VectorValueSelector.class); EasyMock.expect(vectorValueSelector.getFloatVector()).andReturn(floatValues1).anyTimes(); EasyMock.expect(vectorValueSelector.getNullVector()).andReturn(null).anyTimes(); diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/FloatMinAggregationTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/FloatMinAggregationTest.java index 472892aa0e36..728fbb53ae88 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/FloatMinAggregationTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/FloatMinAggregationTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.segment.TestHelper; import org.apache.druid.segment.column.ColumnCapabilitiesImpl; import org.apache.druid.segment.column.ColumnType; @@ -50,8 +49,6 @@ public FloatMinAggregationTest() throws Exception @Before public void setup() { - NullHandling.initializeForTests(); - VectorValueSelector vectorValueSelector = EasyMock.createMock(VectorValueSelector.class); EasyMock.expect(vectorValueSelector.getFloatVector()).andReturn(floatValues1).anyTimes(); EasyMock.expect(vectorValueSelector.getNullVector()).andReturn(null).anyTimes(); diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/LongMaxAggregationTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/LongMaxAggregationTest.java index 535efb02faf7..a33e372b9d56 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/LongMaxAggregationTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/LongMaxAggregationTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.segment.ColumnSelectorFactory; import org.apache.druid.segment.TestHelper; import org.apache.druid.segment.column.ColumnCapabilitiesImpl; @@ -58,7 +57,6 @@ public LongMaxAggregationTest() throws Exception @Before public void setup() { - NullHandling.initializeForTests(); selector = new TestLongColumnSelector(values); colSelectorFactory = EasyMock.createMock(ColumnSelectorFactory.class); EasyMock.expect(colSelectorFactory.makeColumnValueSelector("nilly")).andReturn(selector); diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/LongMinAggregationTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/LongMinAggregationTest.java index 129f81d245a5..2115200c775f 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/LongMinAggregationTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/LongMinAggregationTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.segment.ColumnSelectorFactory; import org.apache.druid.segment.TestHelper; import org.apache.druid.segment.column.ColumnCapabilitiesImpl; @@ -58,7 +57,6 @@ public LongMinAggregationTest() throws Exception @Before public void setup() { - NullHandling.initializeForTests(); selector = new TestLongColumnSelector(values); colSelectorFactory = EasyMock.createMock(ColumnSelectorFactory.class); EasyMock.expect(colSelectorFactory.makeColumnValueSelector("nilly")).andReturn(selector); diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/SerializablePairLongDoubleComplexMetricSerdeTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/SerializablePairLongDoubleComplexMetricSerdeTest.java index f225b83b8553..e2ce60dd2752 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/SerializablePairLongDoubleComplexMetricSerdeTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/SerializablePairLongDoubleComplexMetricSerdeTest.java @@ -20,7 +20,6 @@ package org.apache.druid.query.aggregation; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.segment.ColumnValueSelector; import org.apache.druid.segment.GenericColumnSerializer; import org.apache.druid.segment.IndexSpec; @@ -47,10 +46,6 @@ public class SerializablePairLongDoubleComplexMetricSerdeTest { - static { - NullHandling.initializeForTests(); - } - private static final SerializablePairLongDoubleComplexMetricSerde COMPRESSED_SERDE = new SerializablePairLongDoubleComplexMetricSerde(); diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/SerializablePairLongFloatComplexMetricSerdeTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/SerializablePairLongFloatComplexMetricSerdeTest.java index 7fd74be211e8..6872b531e342 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/SerializablePairLongFloatComplexMetricSerdeTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/SerializablePairLongFloatComplexMetricSerdeTest.java @@ -20,7 +20,6 @@ package org.apache.druid.query.aggregation; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.segment.ColumnValueSelector; import org.apache.druid.segment.GenericColumnSerializer; import org.apache.druid.segment.IndexSpec; @@ -47,10 +46,6 @@ public class SerializablePairLongFloatComplexMetricSerdeTest { - static { - NullHandling.initializeForTests(); - } - private static final SerializablePairLongFloatComplexMetricSerde COMPRESSED_SERDE = new SerializablePairLongFloatComplexMetricSerde(); diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/SerializablePairLongLongComplexMetricSerdeTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/SerializablePairLongLongComplexMetricSerdeTest.java index e54dd5e1d3f5..9df47dff3647 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/SerializablePairLongLongComplexMetricSerdeTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/SerializablePairLongLongComplexMetricSerdeTest.java @@ -20,7 +20,6 @@ package org.apache.druid.query.aggregation; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.segment.ColumnValueSelector; import org.apache.druid.segment.GenericColumnSerializer; import org.apache.druid.segment.IndexSpec; @@ -47,10 +46,6 @@ public class SerializablePairLongLongComplexMetricSerdeTest { - static { - NullHandling.initializeForTests(); - } - private static final SerializablePairLongLongComplexMetricSerde COMPRESSED_SERDE = new SerializablePairLongLongComplexMetricSerde(); diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/SerializablePairLongStringComplexMetricSerdeTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/SerializablePairLongStringComplexMetricSerdeTest.java index 7aeca212d62c..47ddb44b588a 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/SerializablePairLongStringComplexMetricSerdeTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/SerializablePairLongStringComplexMetricSerdeTest.java @@ -20,7 +20,6 @@ package org.apache.druid.query.aggregation; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.segment.ColumnValueSelector; import org.apache.druid.segment.GenericColumnSerializer; import org.apache.druid.segment.IndexSpec; @@ -48,10 +47,6 @@ public class SerializablePairLongStringComplexMetricSerdeTest { - static { - NullHandling.initializeForTests(); - } - private static final SerializablePairLongStringComplexMetricSerde LEGACY_SERDE = new SerializablePairLongStringComplexMetricSerde(); private static final SerializablePairLongStringComplexMetricSerde COMPRESSED_SERDE = diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/SingleValueAggregationTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/SingleValueAggregationTest.java index cd48d5a3e097..41c55bfefc14 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/SingleValueAggregationTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/SingleValueAggregationTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; import org.apache.druid.segment.ColumnSelectorFactory; import org.apache.druid.segment.TestColumnSelectorFactory; @@ -114,13 +113,8 @@ public void testLongAggregator() Assert.assertThrows(DruidException.class, () -> longAggFactory.getComparator()); Aggregator agg = longAggFactory.factorize(colSelectorFactoryLong); - if (NullHandling.replaceWithDefault()) { - Assert.assertFalse(agg.isNull()); - Assert.assertEquals(0L, agg.getLong()); - } else { - Assert.assertTrue(agg.isNull()); - Assert.assertThrows(AssertionError.class, () -> agg.getLong()); - } + Assert.assertTrue(agg.isNull()); + Assert.assertThrows(AssertionError.class, () -> agg.getLong()); aggregate(selectorLong, agg); Assert.assertEquals(longValues[0], ((Long) agg.get()).longValue()); @@ -155,11 +149,7 @@ public void testCombine() public void testDoubleAggregator() { Aggregator agg = doubleAggFactory.factorize(colSelectorFactoryDouble); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(0.0d, agg.getDouble(), 0.000001); - } else { - Assert.assertThrows(AssertionError.class, () -> agg.getDouble()); - } + Assert.assertThrows(AssertionError.class, () -> agg.getDouble()); aggregate(selectorDouble, agg); Assert.assertEquals(doubleValues[0], ((Double) agg.get()).doubleValue(), 0.000001); @@ -188,11 +178,7 @@ public void testDoubleBufferAggregator() public void testFloatAggregator() { Aggregator agg = floatAggFactory.factorize(colSelectorFactoryFloat); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(0.0f, agg.getFloat(), 0.000001); - } else { - Assert.assertThrows(AssertionError.class, () -> agg.getFloat()); - } + Assert.assertThrows(AssertionError.class, () -> agg.getFloat()); aggregate(selectorFloat, agg); Assert.assertEquals(floatValues[0], ((Float) agg.get()).floatValue(), 0.000001); diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/any/DoubleAnyAggregatorFactoryTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/any/DoubleAnyAggregatorFactoryTest.java index b36d10fac63a..66d99bb3ce2d 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/any/DoubleAnyAggregatorFactoryTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/any/DoubleAnyAggregatorFactoryTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.any; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.aggregation.VectorAggregator; import org.apache.druid.segment.ColumnInspector; import org.apache.druid.segment.column.ColumnCapabilities; @@ -95,6 +94,6 @@ public void factorizeVectorForStringTypeShouldReturnDoubleVectorAggregatorWithNi Mockito.doReturn(false).when(capabilities).isNumeric(); VectorAggregator aggregator = target.factorizeVector(selectorFactory); Assert.assertNotNull(aggregator); - Assert.assertEquals(NullHandling.defaultDoubleValue(), aggregator.get(BUFFER, POSITION)); + Assert.assertNull(aggregator.get(BUFFER, POSITION)); } } diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/any/FloatAnyAggregatorFactoryTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/any/FloatAnyAggregatorFactoryTest.java index 9fa54cd8f592..92ae9a74cb97 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/any/FloatAnyAggregatorFactoryTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/any/FloatAnyAggregatorFactoryTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.any; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.aggregation.VectorAggregator; import org.apache.druid.segment.ColumnInspector; import org.apache.druid.segment.column.ColumnCapabilities; @@ -95,6 +94,6 @@ public void factorizeVectorForStringTypeShouldReturnFloatVectorAggregatorWithNil Mockito.doReturn(false).when(capabilities).isNumeric(); VectorAggregator aggregator = target.factorizeVector(selectorFactory); Assert.assertNotNull(aggregator); - Assert.assertEquals(NullHandling.defaultFloatValue(), aggregator.get(BUFFER, POSITION)); + Assert.assertNull(aggregator.get(BUFFER, POSITION)); } } diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/any/LongAnyAggregatorFactoryTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/any/LongAnyAggregatorFactoryTest.java index 9ae81f97bb11..45fe29dacde0 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/any/LongAnyAggregatorFactoryTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/any/LongAnyAggregatorFactoryTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.any; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.aggregation.VectorAggregator; import org.apache.druid.segment.ColumnInspector; import org.apache.druid.segment.column.ColumnCapabilities; @@ -95,6 +94,6 @@ public void factorizeVectorForStringTypeShouldReturnLongVectorAggregatorWithNilS Mockito.doReturn(false).when(capabilities).isNumeric(); VectorAggregator aggregator = target.factorizeVector(selectorFactory); Assert.assertNotNull(aggregator); - Assert.assertEquals(NullHandling.defaultLongValue(), aggregator.get(BUFFER, POSITION)); + Assert.assertNull(aggregator.get(BUFFER, POSITION)); } } diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/any/NumericAnyVectorAggregatorTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/any/NumericAnyVectorAggregatorTest.java index cdc716a07391..76b670aac1a0 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/any/NumericAnyVectorAggregatorTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/any/NumericAnyVectorAggregatorTest.java @@ -95,7 +95,7 @@ public void initShouldSetDoubleAfterPositionToZero() target.init(buf, POSITION); Assert.assertEquals(0, buf.get(POSITION) & BYTE_FLAG_FOUND_MASK); Assert.assertEquals( - NullHandling.sqlCompatible() ? NullHandling.IS_NULL_BYTE : NullHandling.IS_NOT_NULL_BYTE, + NullHandling.IS_NULL_BYTE, buf.get(POSITION) ); } @@ -104,11 +104,7 @@ public void initShouldSetDoubleAfterPositionToZero() public void aggregateNotFoundAndHasNullsShouldPutNull() { target.aggregate(buf, POSITION, 0, 3); - if (NullHandling.sqlCompatible()) { - Assert.assertEquals(BYTE_FLAG_FOUND_MASK | NullHandling.IS_NULL_BYTE, buf.get(POSITION)); - } else { - Assert.assertEquals(BYTE_FLAG_FOUND_MASK | NullHandling.IS_NOT_NULL_BYTE, buf.get(POSITION)); - } + Assert.assertEquals(BYTE_FLAG_FOUND_MASK | NullHandling.IS_NULL_BYTE, buf.get(POSITION)); } @Test diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/cardinality/CardinalityAggregatorTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/cardinality/CardinalityAggregatorTest.java index e5efa184c9da..5b9cdef271fd 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/cardinality/CardinalityAggregatorTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/cardinality/CardinalityAggregatorTest.java @@ -25,7 +25,6 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Iterators; import com.google.common.collect.Lists; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.js.JavaScriptConfig; import org.apache.druid.query.ColumnSelectorPlus; @@ -406,12 +405,12 @@ public void testAggregateValues() aggregate(selectorList, agg); } Assert.assertEquals( - NullHandling.replaceWithDefault() ? 7.0 : 6.0, + 6.0, (Double) valueAggregatorFactory.finalizeComputation(agg.get()), 0.05 ); Assert.assertEquals( - NullHandling.replaceWithDefault() ? 7L : 6L, + 6L, rowAggregatorFactoryRounded.finalizeComputation(agg.get()) ); @@ -458,12 +457,12 @@ public void testBufferAggregateValues() bufferAggregate(selectorList, agg, buf, pos); } Assert.assertEquals( - NullHandling.replaceWithDefault() ? 7.0 : 6.0, + 6.0, (Double) valueAggregatorFactory.finalizeComputation(agg.get(buf, pos)), 0.05 ); Assert.assertEquals( - NullHandling.replaceWithDefault() ? 7L : 6L, + 6L, rowAggregatorFactoryRounded.finalizeComputation(agg.get(buf, pos)) ); } @@ -544,17 +543,17 @@ public void testCombineValues() aggregate(selector2, agg2); } Assert.assertEquals( - NullHandling.replaceWithDefault() ? 4.0 : 3.0, + 3.0, (Double) valueAggregatorFactory.finalizeComputation(agg1.get()), 0.05 ); Assert.assertEquals( - NullHandling.replaceWithDefault() ? 7.0 : 6.0, + 6.0, (Double) valueAggregatorFactory.finalizeComputation(agg2.get()), 0.05 ); Assert.assertEquals( - NullHandling.replaceWithDefault() ? 7.0 : 6.0, + 6.0, (Double) rowAggregatorFactory.finalizeComputation( rowAggregatorFactory.combine( agg1.get(), @@ -657,112 +656,92 @@ public void testSerde() throws Exception ); } - //ignoreNullsForStringCardinality tests @Test public void testAggregateRowsIgnoreNulls() { - NullHandling.initializeForTestsWithValues(null, true); - try { - CardinalityAggregator agg = new CardinalityAggregator( - dimInfoList, - true - ); + CardinalityAggregator agg = new CardinalityAggregator( + dimInfoList, + true + ); - for (int i = 0; i < VALUES1.size(); ++i) { - aggregate(selectorList, agg); - } - Assert.assertEquals(9.0, (Double) rowAggregatorFactory.finalizeComputation(agg.get()), 0.05); - Assert.assertEquals(9L, rowAggregatorFactoryRounded.finalizeComputation(agg.get())); - } - finally { - NullHandling.initializeForTests(); + for (int i = 0; i < VALUES1.size(); ++i) { + aggregate(selectorList, agg); } + Assert.assertEquals(9.0, (Double) rowAggregatorFactory.finalizeComputation(agg.get()), 0.05); + Assert.assertEquals(9L, rowAggregatorFactoryRounded.finalizeComputation(agg.get())); } @Test public void testAggregateValuesIgnoreNulls() { - NullHandling.initializeForTestsWithValues(null, true); - try { - CardinalityAggregator agg = new CardinalityAggregator( - dimInfoList, - false - ); + CardinalityAggregator agg = new CardinalityAggregator( + dimInfoList, + false + ); - for (int i = 0; i < VALUES1.size(); ++i) { - aggregate(selectorList, agg); - } - //setting is not applied when druid.generic.useDefaultValueForNull=false - Assert.assertEquals( - NullHandling.replaceWithDefault() ? 6.0 : 6.0, - (Double) valueAggregatorFactory.finalizeComputation(agg.get()), - 0.05 - ); - Assert.assertEquals( - NullHandling.replaceWithDefault() ? 6L : 6L, - rowAggregatorFactoryRounded.finalizeComputation(agg.get()) - ); - } - finally { - NullHandling.initializeForTests(); + for (int i = 0; i < VALUES1.size(); ++i) { + aggregate(selectorList, agg); } + Assert.assertEquals( + 6.0, + (Double) valueAggregatorFactory.finalizeComputation(agg.get()), + 0.05 + ); + Assert.assertEquals( + 6L, + rowAggregatorFactoryRounded.finalizeComputation(agg.get()) + ); } @Test public void testCombineValuesIgnoreNulls() { - NullHandling.initializeForTestsWithValues(null, true); - try { - List selector1 = Collections.singletonList(dim1); - List selector2 = Collections.singletonList(dim2); - - List> dimInfo1 = Collections.singletonList( - new ColumnSelectorPlus<>( - dimSpec1.getDimension(), - dimSpec1.getOutputName(), - new StringCardinalityAggregatorColumnSelectorStrategy(), dim1 - ) - ); - List> dimInfo2 = Collections.singletonList( - new ColumnSelectorPlus<>( - dimSpec1.getDimension(), - dimSpec1.getOutputName(), - new StringCardinalityAggregatorColumnSelectorStrategy(), dim2 - ) - ); + List selector1 = Collections.singletonList(dim1); + List selector2 = Collections.singletonList(dim2); + + List> dimInfo1 = Collections.singletonList( + new ColumnSelectorPlus<>( + dimSpec1.getDimension(), + dimSpec1.getOutputName(), + new StringCardinalityAggregatorColumnSelectorStrategy(), dim1 + ) + ); + List> dimInfo2 = Collections.singletonList( + new ColumnSelectorPlus<>( + dimSpec1.getDimension(), + dimSpec1.getOutputName(), + new StringCardinalityAggregatorColumnSelectorStrategy(), dim2 + ) + ); - CardinalityAggregator agg1 = new CardinalityAggregator(dimInfo1, false); - CardinalityAggregator agg2 = new CardinalityAggregator(dimInfo2, false); + CardinalityAggregator agg1 = new CardinalityAggregator(dimInfo1, false); + CardinalityAggregator agg2 = new CardinalityAggregator(dimInfo2, false); - for (int i = 0; i < VALUES1.size(); ++i) { - aggregate(selector1, agg1); - } - for (int i = 0; i < VALUES2.size(); ++i) { - aggregate(selector2, agg2); - } - Assert.assertEquals( - NullHandling.replaceWithDefault() ? 3.0 : 3.0, - (Double) valueAggregatorFactory.finalizeComputation(agg1.get()), - 0.05 - ); - Assert.assertEquals( - NullHandling.replaceWithDefault() ? 6.0 : 6.0, - (Double) valueAggregatorFactory.finalizeComputation(agg2.get()), - 0.05 - ); - Assert.assertEquals( - NullHandling.replaceWithDefault() ? 6.0 : 6.0, - (Double) rowAggregatorFactory.finalizeComputation( - rowAggregatorFactory.combine( - agg1.get(), - agg2.get() - ) - ), - 0.05 - ); + for (int i = 0; i < VALUES1.size(); ++i) { + aggregate(selector1, agg1); } - finally { - NullHandling.initializeForTests(); + for (int i = 0; i < VALUES2.size(); ++i) { + aggregate(selector2, agg2); } + Assert.assertEquals( + 3.0, + (Double) valueAggregatorFactory.finalizeComputation(agg1.get()), + 0.05 + ); + Assert.assertEquals( + 6.0, + (Double) valueAggregatorFactory.finalizeComputation(agg2.get()), + 0.05 + ); + Assert.assertEquals( + 6.0, + (Double) rowAggregatorFactory.finalizeComputation( + rowAggregatorFactory.combine( + agg1.get(), + agg2.get() + ) + ), + 0.05 + ); } } diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/cardinality/CardinalityVectorAggregatorTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/cardinality/CardinalityVectorAggregatorTest.java index 0206d1156b5f..68fd3f8f045e 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/cardinality/CardinalityVectorAggregatorTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/cardinality/CardinalityVectorAggregatorTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.cardinality; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.hll.HyperLogLogCollector; import org.apache.druid.query.aggregation.cardinality.vector.DoubleCardinalityVectorProcessor; import org.apache.druid.query.aggregation.cardinality.vector.FloatCardinalityVectorProcessor; @@ -49,9 +48,7 @@ public class CardinalityVectorAggregatorTest extends InitializedNullHandlingTest public void testAggregateLong() { final long[] values = {1, 2, 2, 3, 3, 3, 0}; - final boolean[] nulls = NullHandling.replaceWithDefault() - ? null - : new boolean[]{false, false, false, false, false, false, true}; + final boolean[] nulls = new boolean[]{false, false, false, false, false, false, true}; final CardinalityVectorAggregator aggregator = new CardinalityVectorAggregator( Collections.singletonList( @@ -75,16 +72,14 @@ public boolean[] getNullVector() ) ); - testAggregate(aggregator, values.length, NullHandling.replaceWithDefault() ? 4 : 3); + testAggregate(aggregator, values.length, 3); } @Test public void testAggregateDouble() { final double[] values = {1, 2, 2, 3, 3, 3, 0}; - final boolean[] nulls = NullHandling.replaceWithDefault() - ? null - : new boolean[]{false, false, false, false, false, false, true}; + final boolean[] nulls = new boolean[]{false, false, false, false, false, false, true}; final CardinalityVectorAggregator aggregator = new CardinalityVectorAggregator( Collections.singletonList( @@ -108,16 +103,14 @@ public boolean[] getNullVector() ) ); - testAggregate(aggregator, values.length, NullHandling.replaceWithDefault() ? 4 : 3); + testAggregate(aggregator, values.length, 3); } @Test public void testAggregateFloat() { final float[] values = {1, 2, 2, 3, 3, 3, 0}; - final boolean[] nulls = NullHandling.replaceWithDefault() - ? null - : new boolean[]{false, false, false, false, false, false, true}; + final boolean[] nulls = new boolean[]{false, false, false, false, false, false, true}; final CardinalityVectorAggregator aggregator = new CardinalityVectorAggregator( Collections.singletonList( @@ -141,7 +134,7 @@ public boolean[] getNullVector() ) ); - testAggregate(aggregator, values.length, NullHandling.replaceWithDefault() ? 4 : 3); + testAggregate(aggregator, values.length, 3); } @Test @@ -203,7 +196,7 @@ public int getCurrentVectorSize() ) ); - testAggregate(aggregator, ids.length, NullHandling.replaceWithDefault() ? 4 : 3); + testAggregate(aggregator, ids.length, 3); } @Test @@ -271,7 +264,7 @@ public int getCurrentVectorSize() ) ); - testAggregate(aggregator, ids.length, NullHandling.replaceWithDefault() ? 4 : 3); + testAggregate(aggregator, ids.length, 3); } private static void testAggregate( diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/first/FloatFirstVectorAggregatorTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/first/FloatFirstVectorAggregatorTest.java index 660fdc91e856..9d9a02860631 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/first/FloatFirstVectorAggregatorTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/first/FloatFirstVectorAggregatorTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.firstlast.first; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.Pair; import org.apache.druid.query.aggregation.SerializablePairLongFloat; @@ -287,7 +286,7 @@ public void testAggregateNulls1() target1.aggregate(buf, 0, 0, VALUES.length); Pair result = (Pair) target1.get(buf, 0); Assert.assertEquals(pairs[0].lhs.longValue(), result.lhs.longValue()); - Assert.assertEquals(NullHandling.defaultFloatValue(), result.rhs); + Assert.assertNull(result.rhs); } @Test @@ -309,7 +308,7 @@ public void testAggregateBatchWithoutRows() for (int i = 0; i < positions.length; i++) { Pair result = (Pair) target.get(buf, positions[i] + positionOffset); Assert.assertEquals(pairs[i].getLhs().longValue(), result.lhs.longValue()); - if (!NullHandling.replaceWithDefault() && NULLS[i]) { + if (NULLS[i]) { Assert.assertNull(result.rhs); } else { Assert.assertEquals(pairs[i].rhs, result.rhs, EPSILON); @@ -328,7 +327,7 @@ public void testAggregateBatchWithRows() for (int i = 0; i < positions.length; i++) { Pair result = (Pair) target.get(buf, positions[i] + positionOffset); Assert.assertEquals(times[rows[i]], result.lhs.longValue()); - if (!NullHandling.replaceWithDefault() && NULLS[rows[i]]) { + if (NULLS[rows[i]]) { Assert.assertNull(result.rhs); } else { Assert.assertEquals(pairs[rows[i]].rhs, result.rhs, EPSILON); diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/first/LongFirstVectorAggregatorTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/first/LongFirstVectorAggregatorTest.java index 24dd37dd0c24..b15a20a52dca 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/first/LongFirstVectorAggregatorTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/first/LongFirstVectorAggregatorTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.firstlast.first; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.Pair; import org.apache.druid.query.aggregation.SerializablePairLongLong; @@ -271,7 +270,7 @@ public void testAggregateBatchWithoutRows() for (int i = 0; i < positions.length; i++) { Pair result = (Pair) target.get(buf, positions[i] + positionOffset); Assert.assertEquals(pairs[i].getLhs().longValue(), result.lhs.longValue()); - if (!NullHandling.replaceWithDefault() && NULLS[i]) { + if (NULLS[i]) { Assert.assertNull(result.rhs); } else { Assert.assertEquals(pairs[i].rhs, result.rhs, EPSILON); @@ -290,7 +289,7 @@ public void testAggregateBatchWithRows() for (int i = 0; i < positions.length; i++) { Pair result = (Pair) target.get(buf, positions[i] + positionOffset); Assert.assertEquals(times[rows[i]], result.lhs.longValue()); - if (!NullHandling.replaceWithDefault() && NULLS[rows[i]]) { + if (NULLS[rows[i]]) { Assert.assertNull(result.rhs); } else { Assert.assertEquals(pairs[rows[i]].rhs, result.rhs, EPSILON); diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/first/StringFirstAggregationTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/first/StringFirstAggregationTest.java index 6f6bd41f6bc1..b7233f47176c 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/first/StringFirstAggregationTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/first/StringFirstAggregationTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.firstlast.first; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.Pair; import org.apache.druid.query.aggregation.AggregateCombiner; import org.apache.druid.query.aggregation.Aggregator; @@ -66,7 +65,6 @@ public class StringFirstAggregationTest extends InitializedNullHandlingTest @Before public void setup() { - NullHandling.initializeForTests(); stringFirstAggFactory = new StringFirstAggregatorFactory("billy", "nilly", null, MAX_STRING_SIZE); combiningAggFactory = stringFirstAggFactory.getCombiningFactory(); timeSelector = new TestLongColumnSelector(times); diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/first/StringFirstVectorAggregatorTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/first/StringFirstVectorAggregatorTest.java index 2652431e083c..e98fc8ea0961 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/first/StringFirstVectorAggregatorTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/first/StringFirstVectorAggregatorTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.firstlast.first; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.Pair; import org.apache.druid.query.aggregation.SerializablePairLongString; @@ -335,7 +334,7 @@ public void testAggregateBatchWithoutRows() for (int i = 0; i < positions.length; i++) { Pair result = (Pair) target.get(buf, positions[i] + positionOffset); Assert.assertEquals(times[i], result.lhs.longValue()); - Assert.assertEquals(NullHandling.nullToEmptyIfNeeded(VALUES[i]), result.rhs); + Assert.assertEquals(VALUES[i], result.rhs); } } @@ -350,7 +349,7 @@ public void testAggregateBatchWithRows() for (int i = 0; i < positions.length; i++) { Pair result = (Pair) target.get(buf, positions[i] + positionOffset); Assert.assertEquals(times[rows[i]], result.lhs.longValue()); - Assert.assertEquals(NullHandling.nullToEmptyIfNeeded(VALUES[rows[i]]), result.rhs); + Assert.assertEquals(VALUES[rows[i]], result.rhs); } } diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/last/FloatLastVectorAggregatorTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/last/FloatLastVectorAggregatorTest.java index b19767a4ae9c..a4f0e4381aa9 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/last/FloatLastVectorAggregatorTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/last/FloatLastVectorAggregatorTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.firstlast.last; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.Pair; import org.apache.druid.query.aggregation.SerializablePairLongFloat; @@ -274,7 +273,7 @@ public void testAggregateBatchWithoutRows() for (int i = 0; i < positions.length; i++) { Pair result = (Pair) target.get(buf, positions[i] + positionOffset); Assert.assertEquals(pairs[i].getLhs().longValue(), result.lhs.longValue()); - if (!NullHandling.replaceWithDefault() && NULLS[i]) { + if (NULLS[i]) { Assert.assertNull(result.rhs); } else { Assert.assertEquals(pairs[i].rhs, result.rhs, EPSILON); @@ -293,7 +292,7 @@ public void testAggregateBatchWithRows() for (int i = 0; i < positions.length; i++) { Pair result = (Pair) target.get(buf, positions[i] + positionOffset); Assert.assertEquals(times[rows[i]], result.lhs.longValue()); - if (!NullHandling.replaceWithDefault() && NULLS[rows[i]]) { + if (NULLS[rows[i]]) { Assert.assertNull(result.rhs); } else { Assert.assertEquals(pairs[rows[i]].rhs, result.rhs, EPSILON); diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/last/LongLastVectorAggregatorTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/last/LongLastVectorAggregatorTest.java index 04fffcd7d94d..160c82a68075 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/last/LongLastVectorAggregatorTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/last/LongLastVectorAggregatorTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.firstlast.last; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.Pair; import org.apache.druid.query.aggregation.SerializablePairLongLong; @@ -271,7 +270,7 @@ public void testAggregateBatchWithoutRows() for (int i = 0; i < positions.length; i++) { Pair result = (Pair) target.get(buf, positions[i] + positionOffset); Assert.assertEquals(pairs[i].getLhs().longValue(), result.lhs.longValue()); - if (!NullHandling.replaceWithDefault() && NULLS[i]) { + if (NULLS[i]) { Assert.assertNull(result.rhs); } else { Assert.assertEquals(pairs[i].rhs, result.rhs, EPSILON); @@ -290,7 +289,7 @@ public void testAggregateBatchWithRows() for (int i = 0; i < positions.length; i++) { Pair result = (Pair) target.get(buf, positions[i] + positionOffset); Assert.assertEquals(times[rows[i]], result.lhs.longValue()); - if (!NullHandling.replaceWithDefault() && NULLS[rows[i]]) { + if (NULLS[rows[i]]) { Assert.assertNull(result.rhs); } else { Assert.assertEquals(pairs[rows[i]].rhs, result.rhs, EPSILON); @@ -347,9 +346,6 @@ public long[] getLongVector() @Override public boolean[] getNullVector() { - if (NullHandling.replaceWithDefault()) { - return null; - } boolean[] nulls = new boolean[times.length]; for (int i = 0; i < times.length; ++i) { nulls[i] = times[i] == null; diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/last/StringLastAggregationTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/last/StringLastAggregationTest.java index 974d668b9818..337740dc114d 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/last/StringLastAggregationTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/last/StringLastAggregationTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.firstlast.last; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.Pair; import org.apache.druid.query.aggregation.AggregateCombiner; import org.apache.druid.query.aggregation.Aggregator; @@ -65,7 +64,6 @@ public class StringLastAggregationTest @Before public void setup() { - NullHandling.initializeForTests(); stringLastAggFactory = new StringLastAggregatorFactory("billy", "nilly", null, MAX_STRING_SIZE); combiningAggFactory = stringLastAggFactory.getCombiningFactory(); timeSelector = new TestLongColumnSelector(times); diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/last/StringLastVectorAggregatorTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/last/StringLastVectorAggregatorTest.java index 68aea948d6b1..200787c85c4c 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/last/StringLastVectorAggregatorTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/firstlast/last/StringLastVectorAggregatorTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.aggregation.firstlast.last; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.Pair; import org.apache.druid.query.aggregation.SerializablePairLongString; @@ -404,7 +403,7 @@ public void testAggregateBatchWithoutRows() for (int i = 0; i < positions.length; i++) { Pair result = (Pair) target.get(buf, positions[i] + positionOffset); Assert.assertEquals(times[i], result.lhs.longValue()); - Assert.assertEquals(NullHandling.nullToEmptyIfNeeded(VALUES[i]), result.rhs); + Assert.assertEquals(VALUES[i], result.rhs); } } @@ -419,7 +418,7 @@ public void testAggregateBatchWithRows() for (int i = 0; i < positions.length; i++) { Pair result = (Pair) target.get(buf, positions[i] + positionOffset); Assert.assertEquals(times[rows[i]], result.lhs.longValue()); - Assert.assertEquals(NullHandling.nullToEmptyIfNeeded(VALUES[rows[i]]), result.rhs); + Assert.assertEquals(VALUES[rows[i]], result.rhs); } } diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/hyperloglog/HyperUniquesAggregatorFactoryTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/hyperloglog/HyperUniquesAggregatorFactoryTest.java index c4df70a88de8..64beb06d4607 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/hyperloglog/HyperUniquesAggregatorFactoryTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/hyperloglog/HyperUniquesAggregatorFactoryTest.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.hash.HashFunction; import com.google.common.hash.Hashing; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; import org.apache.druid.hll.HyperLogLogCollector; import org.apache.druid.hll.VersionZeroHyperLogLogCollector; @@ -51,10 +50,6 @@ public class HyperUniquesAggregatorFactoryTest { - static { - NullHandling.initializeForTests(); - } - static final HyperUniquesAggregatorFactory AGGREGATOR_FACTORY = new HyperUniquesAggregatorFactory( "hyperUnique", "uniques" diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/mean/DoubleMeanAggregationTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/mean/DoubleMeanAggregationTest.java index f6bcb3684b16..4c46129f78bf 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/mean/DoubleMeanAggregationTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/mean/DoubleMeanAggregationTest.java @@ -26,7 +26,6 @@ import com.google.common.collect.Lists; import junitparams.JUnitParamsRunner; import junitparams.Parameters; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.Row; import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.guava.Sequence; @@ -173,11 +172,7 @@ public void testVectorAggretatorUsingGroupByQueryOnDoubleColumnOnBiggerSegments( Sequence seq = groupByQueryTestHelper.runQueryOnSegmentsObjs(biggerSegments, query); Row result = Iterables.getOnlyElement(seq.toList()).toMapBasedRow(query); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(39.2307d, result.getMetric("meanOnDouble").doubleValue(), 0.0001d); - } else { - Assert.assertEquals(51.0d, result.getMetric("meanOnDouble").doubleValue(), 0.0001d); - } + Assert.assertEquals(51.0d, result.getMetric("meanOnDouble").doubleValue(), 0.0001d); } @Test diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/post/ArithmeticPostAggregatorTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/post/ArithmeticPostAggregatorTest.java index 211df0de8c2d..6cb04aa13359 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/post/ArithmeticPostAggregatorTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/post/ArithmeticPostAggregatorTest.java @@ -22,7 +22,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.query.Druids; import org.apache.druid.query.aggregation.CountAggregator; @@ -152,7 +151,7 @@ public void testComparatorNulls() arithmeticPostAggregator = new ArithmeticPostAggregator("add", "+", postAggregatorList); Comparator comp = arithmeticPostAggregator.getComparator(); - metricValues.put(aggName, NullHandling.replaceWithDefault() ? NullHandling.defaultDoubleValue() : null); + metricValues.put(aggName, null); Object before = arithmeticPostAggregator.compute(metricValues); metricValues.put(aggName, 1.0); diff --git a/processing/src/test/java/org/apache/druid/query/expression/ArrayQuantileExprMacroTest.java b/processing/src/test/java/org/apache/druid/query/expression/ArrayQuantileExprMacroTest.java index bb79154f7979..50a7a309cf89 100644 --- a/processing/src/test/java/org/apache/druid/query/expression/ArrayQuantileExprMacroTest.java +++ b/processing/src/test/java/org/apache/druid/query/expression/ArrayQuantileExprMacroTest.java @@ -22,7 +22,6 @@ import com.google.common.collect.ImmutableList; import it.unimi.dsi.fastutil.doubles.DoubleList; import it.unimi.dsi.fastutil.doubles.DoubleLists; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.math.expr.Expr; import org.apache.druid.math.expr.ExprEval; import org.apache.druid.math.expr.InputBindings; @@ -110,12 +109,7 @@ public void test_apply_stringArray() ) ); - if (NullHandling.sqlCompatible()) { - Assert.assertTrue(result.eval(InputBindings.nilBindings()).isNumericNull()); - } else { - Assert.assertFalse(result.eval(InputBindings.nilBindings()).isNumericNull()); - Assert.assertEquals(0, result.eval(InputBindings.nilBindings()).asDouble(), 0); - } + Assert.assertTrue(result.eval(InputBindings.nilBindings()).isNumericNull()); } @Test @@ -128,12 +122,7 @@ public void test_apply_null() ) ); - if (NullHandling.sqlCompatible()) { - Assert.assertTrue(result.eval(InputBindings.nilBindings()).isNumericNull()); - } else { - Assert.assertFalse(result.eval(InputBindings.nilBindings()).isNumericNull()); - Assert.assertEquals(0, result.eval(InputBindings.nilBindings()).asDouble(), 0); - } + Assert.assertTrue(result.eval(InputBindings.nilBindings()).isNumericNull()); } @Test diff --git a/processing/src/test/java/org/apache/druid/query/expression/CaseInsensitiveExprMacroTest.java b/processing/src/test/java/org/apache/druid/query/expression/CaseInsensitiveExprMacroTest.java index de9b878692ad..a7066b31b038 100644 --- a/processing/src/test/java/org/apache/druid/query/expression/CaseInsensitiveExprMacroTest.java +++ b/processing/src/test/java/org/apache/druid/query/expression/CaseInsensitiveExprMacroTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.expression; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.math.expr.ExprEval; import org.apache.druid.math.expr.ExpressionType; import org.apache.druid.math.expr.InputBindings; @@ -89,9 +88,7 @@ public void testNoMatch() @Test public void testNullSearch() { - if (NullHandling.sqlCompatible()) { - expectException(IllegalArgumentException.class, "Function[icontains_string] substring must be a string literal"); - } + expectException(IllegalArgumentException.class, "Function[icontains_string] substring must be a string literal"); final ExprEval result = eval( "icontains_string(a, null)", @@ -119,9 +116,7 @@ public void testEmptyStringSearch() @Test public void testNullSearchOnEmptyString() { - if (NullHandling.sqlCompatible()) { - expectException(IllegalArgumentException.class, "Function[icontains_string] substring must be a string literal"); - } + expectException(IllegalArgumentException.class, "Function[icontains_string] substring must be a string literal"); final ExprEval result = eval( "icontains_string(a, null)", @@ -149,9 +144,7 @@ public void testEmptyStringSearchOnEmptyString() @Test public void testNullSearchOnNull() { - if (NullHandling.sqlCompatible()) { - expectException(IllegalArgumentException.class, "Function[icontains_string] substring must be a string literal"); - } + expectException(IllegalArgumentException.class, "Function[icontains_string] substring must be a string literal"); final ExprEval result = eval( "icontains_string(a, null)", @@ -167,10 +160,6 @@ public void testNullSearchOnNull() public void testEmptyStringSearchOnNull() { ExprEval result = eval("icontains_string(a, '')", InputBindings.nilBindings()); - if (NullHandling.sqlCompatible()) { - Assert.assertNull(result.value()); - } else { - Assert.assertEquals(ExprEval.ofLongBoolean(true).value(), result.value()); - } + Assert.assertNull(result.value()); } } diff --git a/processing/src/test/java/org/apache/druid/query/expression/ContainsExprMacroTest.java b/processing/src/test/java/org/apache/druid/query/expression/ContainsExprMacroTest.java index 28cc22747520..9efefd870f8b 100644 --- a/processing/src/test/java/org/apache/druid/query/expression/ContainsExprMacroTest.java +++ b/processing/src/test/java/org/apache/druid/query/expression/ContainsExprMacroTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.expression; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.math.expr.ExprEval; import org.apache.druid.math.expr.ExpressionType; import org.apache.druid.math.expr.InputBindings; @@ -76,9 +75,7 @@ public void testNoMatch() @Test public void testNullSearch() { - if (NullHandling.sqlCompatible()) { - expectException(IllegalArgumentException.class, "Function[contains_string] substring must be a string literal"); - } + expectException(IllegalArgumentException.class, "Function[contains_string] substring must be a string literal"); final ExprEval result = eval( "contains_string(a, null)", @@ -106,9 +103,7 @@ public void testEmptyStringSearch() @Test public void testNullSearchOnEmptyString() { - if (NullHandling.sqlCompatible()) { - expectException(IllegalArgumentException.class, "Function[contains_string] substring must be a string literal"); - } + expectException(IllegalArgumentException.class, "Function[contains_string] substring must be a string literal"); final ExprEval result = eval( "contains_string(a, null)", @@ -136,9 +131,7 @@ public void testEmptyStringSearchOnEmptyString() @Test public void testNullSearchOnNull() { - if (NullHandling.sqlCompatible()) { - expectException(IllegalArgumentException.class, "Function[contains_string] substring must be a string literal"); - } + expectException(IllegalArgumentException.class, "Function[contains_string] substring must be a string literal"); final ExprEval result = eval("contains_string(a, null)", InputBindings.nilBindings()); Assert.assertEquals( @@ -151,10 +144,6 @@ public void testNullSearchOnNull() public void testEmptyStringSearchOnNull() { final ExprEval result = eval("contains_string(a, '')", InputBindings.nilBindings()); - if (NullHandling.sqlCompatible()) { - Assert.assertNull(result.value()); - } else { - Assert.assertEquals(ExprEval.ofLongBoolean(true).value(), result.value()); - } + Assert.assertNull(result.value()); } } diff --git a/processing/src/test/java/org/apache/druid/query/expression/ExprMacroTest.java b/processing/src/test/java/org/apache/druid/query/expression/ExprMacroTest.java index fb38e803ebaa..1395a96ae98c 100644 --- a/processing/src/test/java/org/apache/druid/query/expression/ExprMacroTest.java +++ b/processing/src/test/java/org/apache/druid/query/expression/ExprMacroTest.java @@ -20,14 +20,12 @@ package org.apache.druid.query.expression; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.math.expr.Expr; import org.apache.druid.math.expr.ExpressionType; import org.apache.druid.math.expr.InputBindings; import org.apache.druid.math.expr.Parser; import org.junit.Assert; -import org.junit.BeforeClass; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; @@ -64,12 +62,6 @@ public class ExprMacroTest .build() ); - @BeforeClass - public static void setUpClass() - { - NullHandling.initializeForTests(); - } - @Rule public ExpectedException expectedException = ExpectedException.none(); @@ -165,7 +157,7 @@ public void testTimestampFormat() @Test public void testTrim() { - String emptyString = NullHandling.replaceWithDefault() ? null : ""; + String emptyString = ""; assertExpr("trim('')", emptyString); assertExpr("trim(concat(' ',x,' '))", "foo"); assertExpr("trim(spacey)", "hey there"); @@ -178,7 +170,7 @@ public void testTrim() @Test public void testLTrim() { - String emptyString = NullHandling.replaceWithDefault() ? null : ""; + String emptyString = ""; assertExpr("ltrim('')", emptyString); assertExpr("ltrim(concat(' ',x,' '))", "foo "); assertExpr("ltrim(spacey)", "hey there "); @@ -191,7 +183,7 @@ public void testLTrim() @Test public void testRTrim() { - String emptyString = NullHandling.replaceWithDefault() ? null : ""; + String emptyString = ""; assertExpr("rtrim('')", emptyString); assertExpr("rtrim(concat(' ',x,' '))", " foo"); assertExpr("rtrim(spacey)", " hey there"); diff --git a/processing/src/test/java/org/apache/druid/query/expression/HyperUniqueExpressionsTest.java b/processing/src/test/java/org/apache/druid/query/expression/HyperUniqueExpressionsTest.java index 7109f51f44e6..00898bad5e4c 100644 --- a/processing/src/test/java/org/apache/druid/query/expression/HyperUniqueExpressionsTest.java +++ b/processing/src/test/java/org/apache/druid/query/expression/HyperUniqueExpressionsTest.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.hll.HyperLogLogCollector; import org.apache.druid.java.util.common.IAE; import org.apache.druid.math.expr.Expr; @@ -106,7 +105,7 @@ public void testString() Assert.assertEquals(HyperUniqueExpressions.TYPE, eval.type()); Assert.assertTrue(eval.value() instanceof HyperLogLogCollector); - Assert.assertEquals(NullHandling.replaceWithDefault() ? 1.0 : 0.0, ((HyperLogLogCollector) eval.value()).estimateCardinality(), 0.01); + Assert.assertEquals(0.0, ((HyperLogLogCollector) eval.value()).estimateCardinality(), 0.01); } @Test @@ -138,7 +137,7 @@ public void testLong() Assert.assertEquals(HyperUniqueExpressions.TYPE, eval.type()); Assert.assertTrue(eval.value() instanceof HyperLogLogCollector); - Assert.assertEquals(NullHandling.replaceWithDefault() ? 1.0 : 0.0, ((HyperLogLogCollector) eval.value()).estimateCardinality(), 0.01); + Assert.assertEquals(0.0, ((HyperLogLogCollector) eval.value()).estimateCardinality(), 0.01); } @Test @@ -170,7 +169,7 @@ public void testDouble() Assert.assertEquals(HyperUniqueExpressions.TYPE, eval.type()); Assert.assertTrue(eval.value() instanceof HyperLogLogCollector); - Assert.assertEquals(NullHandling.replaceWithDefault() ? 1.0 : 0.0, ((HyperLogLogCollector) eval.value()).estimateCardinality(), 0.01); + Assert.assertEquals(0.0, ((HyperLogLogCollector) eval.value()).estimateCardinality(), 0.01); } @Test diff --git a/processing/src/test/java/org/apache/druid/query/expression/IPv4AddressStringifyExprMacroTest.java b/processing/src/test/java/org/apache/druid/query/expression/IPv4AddressStringifyExprMacroTest.java index 389acf585194..aefc4f24bea1 100644 --- a/processing/src/test/java/org/apache/druid/query/expression/IPv4AddressStringifyExprMacroTest.java +++ b/processing/src/test/java/org/apache/druid/query/expression/IPv4AddressStringifyExprMacroTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.expression; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.math.expr.Expr; import org.apache.druid.math.expr.ExprEval; import org.apache.druid.math.expr.InputBindings; @@ -33,7 +32,6 @@ public class IPv4AddressStringifyExprMacroTest extends MacroTestBase { private static final Expr VALID = ExprEval.of(3232235521L).toExpr(); private static final String EXPECTED = "192.168.0.1"; - private static final String NULL = NullHandling.replaceWithDefault() ? "0.0.0.0" : null; public IPv4AddressStringifyExprMacroTest() { @@ -60,7 +58,7 @@ public void testTooManyArgs() public void testNullLongArg() { Expr nullNumeric = ExprEval.ofLong(null).toExpr(); - Assert.assertEquals(NULL, eval(nullNumeric)); + Assert.assertNull(eval(nullNumeric)); } @Test @@ -108,7 +106,7 @@ public void testInvalidLongArgTooLarge() public void testNullStringArg() { Expr nullString = ExprEval.of(null).toExpr(); - Assert.assertNull(NULL, eval(nullString)); + Assert.assertNull(eval(nullString)); } @Test diff --git a/processing/src/test/java/org/apache/druid/query/expression/RegexpExtractExprMacroTest.java b/processing/src/test/java/org/apache/druid/query/expression/RegexpExtractExprMacroTest.java index 5e7f0b185666..8a0212f33d5d 100644 --- a/processing/src/test/java/org/apache/druid/query/expression/RegexpExtractExprMacroTest.java +++ b/processing/src/test/java/org/apache/druid/query/expression/RegexpExtractExprMacroTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.expression; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.math.expr.ExprEval; import org.apache.druid.math.expr.ExpressionType; import org.apache.druid.math.expr.InputBindings; @@ -113,9 +112,7 @@ public void testMatchInMiddle() @Test public void testNullPattern() { - if (NullHandling.sqlCompatible()) { - expectException(IllegalArgumentException.class, "Function[regexp_extract] pattern must be a string literal"); - } + expectException(IllegalArgumentException.class, "Function[regexp_extract] pattern must be a string literal"); final ExprEval result = eval( "regexp_extract(a, null)", @@ -131,7 +128,7 @@ public void testEmptyStringPattern() "regexp_extract(a, '')", InputBindings.forInputSupplier("a", ExpressionType.STRING, () -> "foo") ); - Assert.assertEquals(NullHandling.emptyToNullIfNeeded(""), result.value()); + Assert.assertEquals("", result.value()); } @Test @@ -151,9 +148,7 @@ public void testNonLiteralPattern() @Test public void testNullPatternOnNull() { - if (NullHandling.sqlCompatible()) { - expectException(IllegalArgumentException.class, "Function[regexp_extract] pattern must be a string literal"); - } + expectException(IllegalArgumentException.class, "Function[regexp_extract] pattern must be a string literal"); final ExprEval result = eval("regexp_extract(a, null)", InputBindings.nilBindings()); Assert.assertNull(result.value()); diff --git a/processing/src/test/java/org/apache/druid/query/expression/RegexpLikeExprMacroTest.java b/processing/src/test/java/org/apache/druid/query/expression/RegexpLikeExprMacroTest.java index 31e6b97f290a..d6e31baad0b2 100644 --- a/processing/src/test/java/org/apache/druid/query/expression/RegexpLikeExprMacroTest.java +++ b/processing/src/test/java/org/apache/druid/query/expression/RegexpLikeExprMacroTest.java @@ -19,7 +19,6 @@ package org.apache.druid.query.expression; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.math.expr.ExprEval; import org.apache.druid.math.expr.ExpressionType; import org.apache.druid.math.expr.InputBindings; @@ -76,9 +75,7 @@ public void testNoMatch() @Test public void testNullPattern() { - if (NullHandling.sqlCompatible()) { - expectException(IllegalArgumentException.class, "Function[regexp_like] pattern must be a STRING literal"); - } + expectException(IllegalArgumentException.class, "Function[regexp_like] pattern must be a STRING literal"); final ExprEval result = eval( "regexp_like(a, null)", @@ -106,9 +103,7 @@ public void testEmptyStringPattern() @Test public void testNullPatternOnEmptyString() { - if (NullHandling.sqlCompatible()) { - expectException(IllegalArgumentException.class, "Function[regexp_like] pattern must be a STRING literal"); - } + expectException(IllegalArgumentException.class, "Function[regexp_like] pattern must be a STRING literal"); final ExprEval result = eval( "regexp_like(a, null)", @@ -136,9 +131,7 @@ public void testEmptyStringPatternOnEmptyString() @Test public void testNullPatternOnNull() { - if (NullHandling.sqlCompatible()) { - expectException(IllegalArgumentException.class, "Function[regexp_like] pattern must be a STRING literal"); - } + expectException(IllegalArgumentException.class, "Function[regexp_like] pattern must be a STRING literal"); final ExprEval result = eval("regexp_like(a, null)", InputBindings.nilBindings()); Assert.assertEquals( @@ -151,10 +144,6 @@ public void testNullPatternOnNull() public void testEmptyStringPatternOnNull() { final ExprEval result = eval("regexp_like(a, '')", InputBindings.nilBindings()); - if (NullHandling.sqlCompatible()) { - Assert.assertNull(result.value()); - } else { - Assert.assertEquals(ExprEval.ofLongBoolean(true).value(), result.value()); - } + Assert.assertNull(result.value()); } } diff --git a/processing/src/test/java/org/apache/druid/query/expression/RegexpReplaceExprMacroTest.java b/processing/src/test/java/org/apache/druid/query/expression/RegexpReplaceExprMacroTest.java index 3f3ce780c8c9..870bd5c8db8f 100644 --- a/processing/src/test/java/org/apache/druid/query/expression/RegexpReplaceExprMacroTest.java +++ b/processing/src/test/java/org/apache/druid/query/expression/RegexpReplaceExprMacroTest.java @@ -20,7 +20,6 @@ package org.apache.druid.query.expression; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.math.expr.ExprEval; import org.apache.druid.math.expr.ExpressionType; import org.apache.druid.math.expr.InputBindings; @@ -76,11 +75,7 @@ public void testNullPattern() InputBindings.forInputSupplier("a", ExpressionType.STRING, () -> "foo") ); - if (NullHandling.sqlCompatible()) { - Assert.assertNull(result.value()); - } else { - Assert.assertEquals("xfxoxox", result.value()); - } + Assert.assertNull(result.value()); } @Test @@ -131,11 +126,7 @@ public void testNullPatternOnEmptyString() InputBindings.forInputSupplier("a", ExpressionType.STRING, () -> "") ); - if (NullHandling.sqlCompatible()) { - Assert.assertNull(result.value()); - } else { - Assert.assertEquals("x", result.value()); - } + Assert.assertNull(result.value()); } @Test @@ -169,11 +160,7 @@ public void testNullPatternOnNull() { final ExprEval result = eval("regexp_replace(a, null, 'x')", InputBindings.nilBindings()); - if (NullHandling.sqlCompatible()) { - Assert.assertNull(result.value()); - } else { - Assert.assertEquals("x", result.value()); - } + Assert.assertNull(result.value()); } @Test @@ -186,11 +173,7 @@ public void testNullPatternOnNullDynamic() ) ); - if (NullHandling.sqlCompatible()) { - Assert.assertNull(result.value()); - } else { - Assert.assertEquals("x", result.value()); - } + Assert.assertNull(result.value()); } @Test @@ -198,11 +181,7 @@ public void testEmptyStringPatternOnNull() { final ExprEval result = eval("regexp_replace(a, '', 'x')", InputBindings.nilBindings()); - if (NullHandling.sqlCompatible()) { - Assert.assertNull(result.value()); - } else { - Assert.assertEquals("x", result.value()); - } + Assert.assertNull(result.value()); } @Test diff --git a/processing/src/test/java/org/apache/druid/query/expression/TimestampExtractExprMacroTest.java b/processing/src/test/java/org/apache/druid/query/expression/TimestampExtractExprMacroTest.java index b06608ae2281..94f9e74439e5 100644 --- a/processing/src/test/java/org/apache/druid/query/expression/TimestampExtractExprMacroTest.java +++ b/processing/src/test/java/org/apache/druid/query/expression/TimestampExtractExprMacroTest.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.math.expr.Expr; import org.apache.druid.math.expr.ExprEval; import org.apache.druid.math.expr.ExpressionType; @@ -37,10 +36,6 @@ */ public class TimestampExtractExprMacroTest { - static { - NullHandling.initializeForTests(); - } - private TimestampExtractExprMacro target; @Before diff --git a/processing/src/test/java/org/apache/druid/query/expression/TimestampShiftMacroTest.java b/processing/src/test/java/org/apache/druid/query/expression/TimestampShiftMacroTest.java index 532658cf990b..ef5985b440d0 100644 --- a/processing/src/test/java/org/apache/druid/query/expression/TimestampShiftMacroTest.java +++ b/processing/src/test/java/org/apache/druid/query/expression/TimestampShiftMacroTest.java @@ -20,7 +20,6 @@ package org.apache.druid.query.expression; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.IAE; import org.apache.druid.math.expr.Expr; @@ -241,10 +240,6 @@ public void testNull() ) ); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(2678400000L, expr.eval(InputBindings.nilBindings()).value()); - } else { - Assert.assertNull(expr.eval(InputBindings.nilBindings()).value()); - } + Assert.assertNull(expr.eval(InputBindings.nilBindings()).value()); } } diff --git a/processing/src/test/java/org/apache/druid/query/extraction/FunctionalExtractionTest.java b/processing/src/test/java/org/apache/druid/query/extraction/FunctionalExtractionTest.java index a4e4c9feef7a..6cda6d76edc6 100644 --- a/processing/src/test/java/org/apache/druid/query/extraction/FunctionalExtractionTest.java +++ b/processing/src/test/java/org/apache/druid/query/extraction/FunctionalExtractionTest.java @@ -22,7 +22,6 @@ import com.google.common.base.Function; import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @@ -136,7 +135,7 @@ public void testRetainMissing() false ); final String out = fn.apply(in); - Assert.assertEquals(NullHandling.isNullOrEquivalent(out) ? in : out, exFn.apply(in)); + Assert.assertEquals(out == null ? in : out, exFn.apply(in)); } @Test @@ -150,7 +149,7 @@ public void testRetainMissingButFound() false ); final String out = fn.apply(in); - Assert.assertEquals(NullHandling.isNullOrEquivalent(out) ? in : out, exFn.apply(in)); + Assert.assertEquals(out == null ? in : out, exFn.apply(in)); } @Test @@ -164,11 +163,7 @@ public void testReplaceMissing() false ); final String out = fn.apply(in); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(NullHandling.isNullOrEquivalent(out) ? MISSING : out, exFn.apply(in)); - } else { - Assert.assertEquals(out == null ? MISSING : out, exFn.apply(in)); - } + Assert.assertEquals(out == null ? MISSING : out, exFn.apply(in)); } @@ -183,11 +178,7 @@ public void testReplaceMissingBlank() false ); final String out = fn.apply(in); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(Strings.isNullOrEmpty(out) ? null : out, exFn.apply(in)); - } else { - Assert.assertEquals(out == null ? "" : out, exFn.apply(in)); - } + Assert.assertEquals(out == null ? "" : out, exFn.apply(in)); } @Test @@ -201,11 +192,7 @@ public void testOnlyOneValuePresent() false ); final String out = fn.apply(in); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(Strings.isNullOrEmpty(out) ? null : out, exFn.apply(in)); - } else { - Assert.assertEquals(Strings.isNullOrEmpty(out) ? "" : out, exFn.apply(in)); - } + Assert.assertEquals(Strings.isNullOrEmpty(out) ? "" : out, exFn.apply(in)); } @Test @@ -217,7 +204,7 @@ public void testNullInputs() null, false ); - if (NullHandling.isNullOrEquivalent(fn.apply(null))) { + if (fn.apply(null) == null) { Assert.assertEquals(null, exFn.apply(null)); } } diff --git a/processing/src/test/java/org/apache/druid/query/extraction/JavaScriptExtractionFnTest.java b/processing/src/test/java/org/apache/druid/query/extraction/JavaScriptExtractionFnTest.java index 818c1fe9c85a..917a672ead8d 100644 --- a/processing/src/test/java/org/apache/druid/query/extraction/JavaScriptExtractionFnTest.java +++ b/processing/src/test/java/org/apache/druid/query/extraction/JavaScriptExtractionFnTest.java @@ -23,7 +23,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.Iterators; import com.google.common.collect.Lists; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.js.JavaScriptConfig; @@ -132,11 +131,7 @@ public void testJavascriptIsNull() Assert.assertEquals("yes", extractionFn.apply((String) null)); Assert.assertEquals("yes", extractionFn.apply((Object) null)); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals("yes", extractionFn.apply("")); - } else { - Assert.assertEquals("no", extractionFn.apply("")); - } + Assert.assertEquals("no", extractionFn.apply("")); Assert.assertEquals("no", extractionFn.apply("abc")); Assert.assertEquals("no", extractionFn.apply(new Object())); Assert.assertEquals("no", extractionFn.apply(1)); diff --git a/processing/src/test/java/org/apache/druid/query/extraction/LowerExtractionFnTest.java b/processing/src/test/java/org/apache/druid/query/extraction/LowerExtractionFnTest.java index 31cc33834964..71369802d393 100644 --- a/processing/src/test/java/org/apache/druid/query/extraction/LowerExtractionFnTest.java +++ b/processing/src/test/java/org/apache/druid/query/extraction/LowerExtractionFnTest.java @@ -20,7 +20,6 @@ package org.apache.druid.query.extraction; import nl.jqno.equalsverifier.EqualsVerifier; -import org.apache.druid.common.config.NullHandling; import org.junit.Assert; import org.junit.Test; @@ -34,9 +33,9 @@ public class LowerExtractionFnTest public void testApply() { Assert.assertEquals("lower 1 string", extractionFn.apply("lOwER 1 String")); - Assert.assertEquals(NullHandling.replaceWithDefault() ? null : "", extractionFn.apply("")); - Assert.assertEquals(null, extractionFn.apply(null)); - Assert.assertEquals(null, extractionFn.apply((Object) null)); + Assert.assertEquals("", extractionFn.apply("")); + Assert.assertNull(extractionFn.apply(null)); + Assert.assertNull(extractionFn.apply((Object) null)); Assert.assertEquals("1", extractionFn.apply(1)); } diff --git a/processing/src/test/java/org/apache/druid/query/extraction/MapBasedLookupExtractorTest.java b/processing/src/test/java/org/apache/druid/query/extraction/MapBasedLookupExtractorTest.java index 578feae41c71..0726e733b343 100644 --- a/processing/src/test/java/org/apache/druid/query/extraction/MapBasedLookupExtractorTest.java +++ b/processing/src/test/java/org/apache/druid/query/extraction/MapBasedLookupExtractorTest.java @@ -22,11 +22,9 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import org.apache.commons.compress.utils.Lists; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.lookup.ImmutableLookupMap; import org.apache.druid.query.lookup.LookupExtractor; import org.junit.Assert; -import org.junit.BeforeClass; import org.junit.Test; import javax.annotation.Nullable; @@ -48,12 +46,6 @@ public abstract class MapBasedLookupExtractorTest "", "empty_string" ); - @BeforeClass - public static void setUpClass() - { - NullHandling.initializeForTests(); - } - /** * Subclasses implement this method to test the proper {@link LookupExtractor} implementation. */ @@ -64,15 +56,8 @@ public void test_unapplyAll_simple() { final LookupExtractor lookup = makeLookupExtractor(simpleLookupMap); Assert.assertEquals(Collections.singletonList("foo"), unapply(lookup, "bar")); - if (NullHandling.sqlCompatible()) { - Assert.assertEquals(Collections.emptySet(), Sets.newHashSet(unapply(lookup, null))); - Assert.assertEquals(Sets.newHashSet("null", "empty String"), Sets.newHashSet(unapply(lookup, ""))); - } else { - // Don't test unapply(lookup, "") under replace-with-default mode, because it isn't allowed in that mode, and - // implementation behavior is undefined. unapply is specced such that it requires its inputs to go - // through nullToEmptyIfNeeded. - Assert.assertEquals(Sets.newHashSet("null", "empty String"), Sets.newHashSet(unapply(lookup, null))); - } + Assert.assertEquals(Collections.emptySet(), Sets.newHashSet(unapply(lookup, null))); + Assert.assertEquals(Sets.newHashSet("null", "empty String"), Sets.newHashSet(unapply(lookup, ""))); Assert.assertEquals(Sets.newHashSet(""), Sets.newHashSet(unapply(lookup, "empty_string"))); Assert.assertEquals("not existing value returns empty list", Collections.emptyList(), unapply(lookup, "not There")); } @@ -90,10 +75,10 @@ public void test_apply_simple() { final LookupExtractor lookup = makeLookupExtractor(simpleLookupMap); Assert.assertEquals("bar", lookup.apply("foo")); - Assert.assertEquals(NullHandling.sqlCompatible() ? "" : null, lookup.apply("null")); - Assert.assertEquals(NullHandling.sqlCompatible() ? "" : null, lookup.apply("empty String")); + Assert.assertEquals("", lookup.apply("null")); + Assert.assertEquals("", lookup.apply("empty String")); Assert.assertEquals("empty_string", lookup.apply("")); - Assert.assertEquals(NullHandling.sqlCompatible() ? null : "empty_string", lookup.apply(null)); + Assert.assertNull(lookup.apply(null)); } @Test @@ -116,7 +101,7 @@ public void test_unapply_nullKey() final LookupExtractor lookup = makeLookupExtractor(mapWithNullKey); Assert.assertEquals( - NullHandling.sqlCompatible() ? Collections.emptyList() : Collections.singletonList(null), + Collections.emptyList(), unapply(lookup, "nv") ); @@ -157,7 +142,7 @@ public void test_apply_emptyStringValue() final LookupExtractor lookup = makeLookupExtractor(mapWithNullKey); Assert.assertEquals( - NullHandling.sqlCompatible() ? "" : null, + "", lookup.apply("nk") ); } @@ -170,19 +155,14 @@ public void test_unapply_emptyStringValue() final LookupExtractor lookup = makeLookupExtractor(mapWithNullKey); Assert.assertEquals( - NullHandling.sqlCompatible() ? Collections.emptyList() : Collections.singletonList("nk"), + Collections.emptyList(), unapply(lookup, null) ); - if (NullHandling.sqlCompatible()) { - // Don't test unapply(lookup, "") under replace-with-default mode, because it isn't allowed in that mode, and - // implementation behavior is undefined. unapply is specced such that it requires its inputs to go - // through nullToEmptyIfNeeded. - Assert.assertEquals( - Collections.singletonList("nk"), - unapply(lookup, "") - ); - } + Assert.assertEquals( + Collections.singletonList("nk"), + unapply(lookup, "") + ); } @Test @@ -195,10 +175,7 @@ public void test_apply_nullAndEmptyStringKey() Assert.assertNull(lookup.apply("missing")); Assert.assertEquals("empty", lookup.apply("")); - Assert.assertEquals( - NullHandling.sqlCompatible() ? null : "empty", - lookup.apply(null) - ); + Assert.assertNull(lookup.apply(null)); } @Test @@ -215,7 +192,7 @@ public void test_unapply_nullAndEmptyStringKey() ); Assert.assertEquals( - NullHandling.sqlCompatible() ? Collections.emptyList() : Collections.singletonList(null), + Collections.emptyList(), unapply(lookup, "nv") ); } diff --git a/processing/src/test/java/org/apache/druid/query/extraction/MapLookupExtractionFnSerDeTest.java b/processing/src/test/java/org/apache/druid/query/extraction/MapLookupExtractionFnSerDeTest.java index 39144ff066bd..c6d84cb33215 100644 --- a/processing/src/test/java/org/apache/druid/query/extraction/MapLookupExtractionFnSerDeTest.java +++ b/processing/src/test/java/org/apache/druid/query/extraction/MapLookupExtractionFnSerDeTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.segment.TestHelper; import org.junit.Assert; @@ -53,7 +52,6 @@ public static void setup() @Test public void testDeserialization() throws IOException { - NullHandling.initializeForTests(); final DimExtractionFn fn = mapper.readerFor(DimExtractionFn.class).readValue( StringUtils.format( "{\"type\":\"lookup\",\"lookup\":{\"type\":\"map\", \"map\":%s}}", diff --git a/processing/src/test/java/org/apache/druid/query/extraction/MatchingDimExtractionFnTest.java b/processing/src/test/java/org/apache/druid/query/extraction/MatchingDimExtractionFnTest.java index 0db848bc95c2..f91901ba3bf1 100644 --- a/processing/src/test/java/org/apache/druid/query/extraction/MatchingDimExtractionFnTest.java +++ b/processing/src/test/java/org/apache/druid/query/extraction/MatchingDimExtractionFnTest.java @@ -20,7 +20,6 @@ package org.apache.druid.query.extraction; import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.jackson.DefaultObjectMapper; import org.junit.Assert; import org.junit.Test; @@ -76,7 +75,7 @@ public void testNullExtraction() Assert.assertNull(extractionFn.apply((Object) null)); Assert.assertNull(extractionFn.apply((String) null)); - Assert.assertEquals(NullHandling.replaceWithDefault() ? null : "", extractionFn.apply((String) "")); + Assert.assertEquals("", extractionFn.apply((String) "")); } @Test diff --git a/processing/src/test/java/org/apache/druid/query/extraction/RegexDimExtractionFnTest.java b/processing/src/test/java/org/apache/druid/query/extraction/RegexDimExtractionFnTest.java index 7b2dcc001be4..861108910e91 100644 --- a/processing/src/test/java/org/apache/druid/query/extraction/RegexDimExtractionFnTest.java +++ b/processing/src/test/java/org/apache/druid/query/extraction/RegexDimExtractionFnTest.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableList; import com.google.common.collect.Sets; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.jackson.DefaultObjectMapper; import org.junit.Assert; import org.junit.Test; @@ -147,11 +146,11 @@ public void testNullAndEmpty() String regex = "(.*)/.*/.*"; ExtractionFn extractionFn = new RegexDimExtractionFn(regex, false, null); // no match, map empty input value to null - Assert.assertEquals(NullHandling.replaceWithDefault() ? null : "", extractionFn.apply("")); + Assert.assertEquals("", extractionFn.apply("")); // null value, returns null - Assert.assertEquals(null, extractionFn.apply(null)); + Assert.assertNull(extractionFn.apply(null)); // empty match, map empty result to null - Assert.assertEquals(NullHandling.replaceWithDefault() ? null : "", extractionFn.apply("/a/b")); + Assert.assertEquals("", extractionFn.apply("/a/b")); } @Test @@ -170,8 +169,8 @@ public void testMissingValueReplacementWhenPatternMatchesNull() { String regex = "^()$"; ExtractionFn extractionFn = new RegexDimExtractionFn(regex, true, "NO MATCH"); - Assert.assertEquals(NullHandling.replaceWithDefault() ? null : "", extractionFn.apply("")); - Assert.assertEquals(NullHandling.replaceWithDefault() ? null : "NO MATCH", extractionFn.apply(null)); + Assert.assertEquals("", extractionFn.apply("")); + Assert.assertEquals("NO MATCH", extractionFn.apply(null)); Assert.assertEquals("NO MATCH", extractionFn.apply("abc")); } @@ -180,10 +179,10 @@ public void testMissingValueReplacementToEmpty() { String regex = "(bob)"; ExtractionFn extractionFn = new RegexDimExtractionFn(regex, true, ""); - Assert.assertEquals(NullHandling.replaceWithDefault() ? null : "", extractionFn.apply(null)); - Assert.assertEquals(NullHandling.replaceWithDefault() ? null : "", extractionFn.apply("")); - Assert.assertEquals(NullHandling.replaceWithDefault() ? null : "", extractionFn.apply("abc")); - Assert.assertEquals(NullHandling.replaceWithDefault() ? null : "", extractionFn.apply("123")); + Assert.assertEquals("", extractionFn.apply(null)); + Assert.assertEquals("", extractionFn.apply("")); + Assert.assertEquals("", extractionFn.apply("abc")); + Assert.assertEquals("", extractionFn.apply("123")); Assert.assertEquals("bob", extractionFn.apply("bobby")); } diff --git a/processing/src/test/java/org/apache/druid/query/extraction/StringFormatExtractionFnTest.java b/processing/src/test/java/org/apache/druid/query/extraction/StringFormatExtractionFnTest.java index e98ee05da024..5b9f62f42cc8 100644 --- a/processing/src/test/java/org/apache/druid/query/extraction/StringFormatExtractionFnTest.java +++ b/processing/src/test/java/org/apache/druid/query/extraction/StringFormatExtractionFnTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.jackson.DefaultObjectMapper; import org.junit.Assert; import org.junit.Test; @@ -57,7 +56,7 @@ public void testApplyNull2() String test = null; Assert.assertEquals("null", format("%s", "nullString").apply(test)); Assert.assertEquals( - NullHandling.emptyToNullIfNeeded(""), + "", format("%s", "emptyString").apply(test) ); Assert.assertNull(format("%s", "returnNull").apply(test)); diff --git a/processing/src/test/java/org/apache/druid/query/extraction/StrlenExtractionFnTest.java b/processing/src/test/java/org/apache/druid/query/extraction/StrlenExtractionFnTest.java index 1997a0f9bb2d..7128c301cabe 100644 --- a/processing/src/test/java/org/apache/druid/query/extraction/StrlenExtractionFnTest.java +++ b/processing/src/test/java/org/apache/druid/query/extraction/StrlenExtractionFnTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import nl.jqno.equalsverifier.EqualsVerifier; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.jackson.DefaultObjectMapper; import org.junit.Assert; import org.junit.Test; @@ -31,7 +30,7 @@ public class StrlenExtractionFnTest @Test public void testApply() { - Assert.assertEquals(NullHandling.replaceWithDefault() ? "0" : null, StrlenExtractionFn.instance().apply(null)); + Assert.assertNull(StrlenExtractionFn.instance().apply(null)); Assert.assertEquals("0", StrlenExtractionFn.instance().apply("")); Assert.assertEquals("1", StrlenExtractionFn.instance().apply("x")); Assert.assertEquals("3", StrlenExtractionFn.instance().apply("foo")); diff --git a/processing/src/test/java/org/apache/druid/query/extraction/TimeDimExtractionFnTest.java b/processing/src/test/java/org/apache/druid/query/extraction/TimeDimExtractionFnTest.java index c77727f1fabd..8d2f69aec8c9 100644 --- a/processing/src/test/java/org/apache/druid/query/extraction/TimeDimExtractionFnTest.java +++ b/processing/src/test/java/org/apache/druid/query/extraction/TimeDimExtractionFnTest.java @@ -20,7 +20,6 @@ package org.apache.druid.query.extraction; import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.jackson.DefaultObjectMapper; import org.junit.Assert; import org.junit.Test; @@ -49,11 +48,7 @@ public void testEmptyNullAndUnparseableExtraction() ExtractionFn extractionFn = new TimeDimExtractionFn("MM/dd/yyyy", "MM/yyyy", joda); Assert.assertNull(extractionFn.apply(null)); - if (NullHandling.replaceWithDefault()) { - Assert.assertNull(extractionFn.apply("")); - } else { - Assert.assertEquals("", extractionFn.apply("")); - } + Assert.assertEquals("", extractionFn.apply("")); Assert.assertEquals("foo", extractionFn.apply("foo")); } } diff --git a/processing/src/test/java/org/apache/druid/query/extraction/UpperExtractionFnTest.java b/processing/src/test/java/org/apache/druid/query/extraction/UpperExtractionFnTest.java index 12c0bdc41035..a4787b985d8f 100644 --- a/processing/src/test/java/org/apache/druid/query/extraction/UpperExtractionFnTest.java +++ b/processing/src/test/java/org/apache/druid/query/extraction/UpperExtractionFnTest.java @@ -20,7 +20,6 @@ package org.apache.druid.query.extraction; import nl.jqno.equalsverifier.EqualsVerifier; -import org.apache.druid.common.config.NullHandling; import org.junit.Assert; import org.junit.Test; @@ -34,9 +33,9 @@ public class UpperExtractionFnTest public void testApply() { Assert.assertEquals("UPPER", extractionFn.apply("uPpeR")); - Assert.assertEquals(NullHandling.replaceWithDefault() ? null : "", extractionFn.apply("")); - Assert.assertEquals(null, extractionFn.apply(null)); - Assert.assertEquals(null, extractionFn.apply((Object) null)); + Assert.assertEquals("", extractionFn.apply("")); + Assert.assertNull(extractionFn.apply(null)); + Assert.assertNull(extractionFn.apply((Object) null)); Assert.assertEquals("1", extractionFn.apply(1)); } diff --git a/processing/src/test/java/org/apache/druid/query/filter/GetDimensionRangeSetTest.java b/processing/src/test/java/org/apache/druid/query/filter/GetDimensionRangeSetTest.java index 6057f96bb0aa..f124f7c1e674 100644 --- a/processing/src/test/java/org/apache/druid/query/filter/GetDimensionRangeSetTest.java +++ b/processing/src/test/java/org/apache/druid/query/filter/GetDimensionRangeSetTest.java @@ -23,7 +23,6 @@ import com.google.common.collect.ImmutableRangeSet; import com.google.common.collect.Range; import com.google.common.collect.RangeSet; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.Intervals; import org.apache.druid.js.JavaScriptConfig; import org.apache.druid.query.extraction.IdentityExtractionFn; @@ -181,21 +180,11 @@ public void testNotFilter() Assert.assertNull(not1.getDimensionRangeSet("dim2")); DimFilter not2 = new NotDimFilter(in3); - if (NullHandling.sqlCompatible()) { - // Empty string is included when != null for SQL Compatible case - RangeSet expected2 = rangeSet(ImmutableList.of( - Range.closedOpen("", "null"), - Range.greaterThan("null") - )); - Assert.assertEquals(expected2, not2.getDimensionRangeSet("dim1")); - } else { - RangeSet expected2 = rangeSet(ImmutableList.of( - Range.lessThan(""), - Range.open("", "null"), - Range.greaterThan("null") - )); - Assert.assertEquals(expected2, not2.getDimensionRangeSet("dim1")); - } + RangeSet expected2 = rangeSet(ImmutableList.of( + Range.closedOpen("", "null"), + Range.greaterThan("null") + )); + Assert.assertEquals(expected2, not2.getDimensionRangeSet("dim1")); DimFilter not3 = new NotDimFilter(bound1); RangeSet expected3 = rangeSet(ImmutableList.of(Range.lessThan("from"), Range.greaterThan("to"))); @@ -236,13 +225,8 @@ public void testNotFilter() private static Range point(String s) { if (s == null) { - if (NullHandling.sqlCompatible()) { - // Range.singleton(null) is invalid - return Range.lessThan(""); - } else { - // For non-sql compatible case, null and "" are equivalent - return Range.singleton(""); - } + // Range.singleton(null) is invalid + return Range.lessThan(""); } return Range.singleton(s); } diff --git a/processing/src/test/java/org/apache/druid/query/filter/InDimFilterTest.java b/processing/src/test/java/org/apache/druid/query/filter/InDimFilterTest.java index 2154b79d10e8..65428b3cb9fe 100644 --- a/processing/src/test/java/org/apache/druid/query/filter/InDimFilterTest.java +++ b/processing/src/test/java/org/apache/druid/query/filter/InDimFilterTest.java @@ -25,7 +25,6 @@ import com.google.common.collect.ImmutableSortedSet; import com.google.common.collect.Ordering; import com.google.common.collect.Sets; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.MapBasedRow; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.query.extraction.RegexDimExtractionFn; @@ -97,13 +96,8 @@ public void testGetValuesWithValuesSetIncludingEmptyString() { final InDimFilter.ValuesSet values = InDimFilter.ValuesSet.copyOf(ImmutableSet.of("v1", "", "v3")); final InDimFilter filter = new InDimFilter("dim", values); - if (NullHandling.replaceWithDefault()) { - Assert.assertSame(values, filter.getValues()); - Assert.assertEquals(Sets.newHashSet("v1", null, "v3"), filter.getValues()); - } else { - Assert.assertSame(values, filter.getValues()); - Assert.assertEquals(Sets.newHashSet("v1", "", "v3"), filter.getValues()); - } + Assert.assertSame(values, filter.getValues()); + Assert.assertEquals(Sets.newHashSet("v1", "", "v3"), filter.getValues()); } @Test @@ -120,11 +114,7 @@ public void testGetCacheKeyForNullVsEmptyString() final InDimFilter inDimFilter1 = new InDimFilter("dimTest", Arrays.asList(null, "abc"), null); final InDimFilter inDimFilter2 = new InDimFilter("dimTest", Arrays.asList("", "abc"), null); - if (NullHandling.sqlCompatible()) { - Assert.assertFalse(Arrays.equals(inDimFilter1.getCacheKey(), inDimFilter2.getCacheKey())); - } else { - Assert.assertArrayEquals(inDimFilter1.getCacheKey(), inDimFilter2.getCacheKey()); - } + Assert.assertFalse(Arrays.equals(inDimFilter1.getCacheKey(), inDimFilter2.getCacheKey())); } @Test @@ -270,7 +260,7 @@ public void testOptimizeLookup_simple() Assert.assertEquals( "reverse lookup empty string", - NullHandling.sqlCompatible() ? Collections.emptySet() : null, + Collections.emptySet(), InDimFilter.optimizeLookup(new InDimFilter("dim", Collections.singleton(""), extractionFn), false) ); @@ -401,13 +391,12 @@ public void testOptimizeLookup_replaceMissingValue_containingNull() Assert.assertEquals( "reverse lookup empty string", - NullHandling.sqlCompatible() ? Collections.emptySet() : Collections.singleton("nv"), + Collections.emptySet(), InDimFilter.optimizeLookup(new InDimFilter("dim", Collections.singleton(""), extractionFn), false) ); - Assert.assertEquals( + Assert.assertNull( "reverse lookup empty string (includeUnknown)", - NullHandling.sqlCompatible() ? null : Collections.singleton("nv"), InDimFilter.optimizeLookup(new InDimFilter("dim", Collections.singleton(""), extractionFn), true) ); } @@ -440,7 +429,7 @@ public void testOptimizeLookup_replaceMissingValue_containingEmptyString() Assert.assertEquals( "reverse lookup baz (includeUnknown)", - NullHandling.sqlCompatible() ? Collections.emptySet() : null, + Collections.emptySet(), InDimFilter.optimizeLookup(new InDimFilter("dim", Collections.singleton("baz"), extractionFn), true) ); @@ -456,13 +445,13 @@ public void testOptimizeLookup_replaceMissingValue_containingEmptyString() Assert.assertEquals( "reverse lookup null", - NullHandling.sqlCompatible() ? Collections.emptySet() : Collections.singleton("emptystring"), + Collections.emptySet(), InDimFilter.optimizeLookup(new InDimFilter("dim", Collections.singleton(null), extractionFn), false) ); Assert.assertEquals( "reverse lookup null (includeUnknown)", - NullHandling.sqlCompatible() ? Collections.emptySet() : Collections.singleton("emptystring"), + Collections.emptySet(), InDimFilter.optimizeLookup(new InDimFilter("dim", Collections.singleton(null), extractionFn), true) ); @@ -489,7 +478,7 @@ public void testOptimizeLookup_containingEmptyString() Assert.assertEquals( "reverse lookup empty string", - NullHandling.sqlCompatible() ? Collections.singleton("emptystring") : null, + Collections.singleton("emptystring"), InDimFilter.optimizeLookup(new InDimFilter("dim", Collections.singleton(""), extractionFn), false) ); @@ -519,7 +508,7 @@ public void testOptimizeLookup_emptyStringKey() Assert.assertEquals( "reverse lookup bar", - NullHandling.sqlCompatible() ? Collections.singleton("") : Collections.singleton(null), + Collections.singleton(""), InDimFilter.optimizeLookup(new InDimFilter("dim", Collections.singleton("bar"), extractionFn), false) ); @@ -595,13 +584,13 @@ public void testOptimizeLookup_retainMissingValue() Assert.assertEquals( "reverse lookup empty string", - NullHandling.sqlCompatible() ? Collections.singleton("") : Collections.singleton(null), + Collections.singleton(""), InDimFilter.optimizeLookup(new InDimFilter("dim", Collections.singleton(""), extractionFn), false) ); Assert.assertEquals( "reverse lookup empty string (includeUnknown)", - NullHandling.sqlCompatible() ? null : Collections.singleton(null), + null, InDimFilter.optimizeLookup(new InDimFilter("dim", Collections.singleton(""), extractionFn), true) ); } @@ -653,13 +642,13 @@ public void testOptimizeLookup_injective() Assert.assertEquals( "reverse lookup null", - NullHandling.sqlCompatible() ? Collections.singleton(null) : Collections.emptySet(), + Collections.singleton(null), InDimFilter.optimizeLookup(new InDimFilter("dim", Collections.singleton(null), extractionFn), false) ); Assert.assertEquals( "reverse lookup null (includeUnknown)", - NullHandling.sqlCompatible() ? Collections.singleton(null) : Collections.emptySet(), + Collections.singleton(null), InDimFilter.optimizeLookup(new InDimFilter("dim", Collections.singleton(null), extractionFn), true) ); @@ -686,8 +675,7 @@ public void testOptimizeLookup_nullKey() Assert.assertEquals( "reverse lookup nv", - // null keys are always mapped to null in SQL-compatible mode - NullHandling.sqlCompatible() ? Collections.emptySet() : Collections.singleton(null), + Collections.emptySet(), InDimFilter.optimizeLookup(new InDimFilter("dim", Collections.singleton("nv"), extractionFn), false) ); @@ -708,7 +696,7 @@ public void testOptimizeLookup_nullKey() Assert.assertEquals( "reverse lookup empty string", - NullHandling.sqlCompatible() ? Collections.emptySet() : null, + Collections.emptySet(), InDimFilter.optimizeLookup(new InDimFilter("dim", Collections.singleton(""), extractionFn), false) ); diff --git a/processing/src/test/java/org/apache/druid/query/filter/LikeDimFilterTest.java b/processing/src/test/java/org/apache/druid/query/filter/LikeDimFilterTest.java index c9ac0b77af3c..afa450bc471c 100644 --- a/processing/src/test/java/org/apache/druid/query/filter/LikeDimFilterTest.java +++ b/processing/src/test/java/org/apache/druid/query/filter/LikeDimFilterTest.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.Sets; import nl.jqno.equalsverifier.EqualsVerifier; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.query.extraction.SubstringDimExtractionFn; import org.apache.druid.segment.column.ColumnIndexSupplier; @@ -175,7 +174,7 @@ public void testPatternCompilation() @Test public void testPatternEmpty() { - assertMatch("", null, NullHandling.replaceWithDefault() ? DruidPredicateMatch.TRUE : DruidPredicateMatch.UNKNOWN); + assertMatch("", null, DruidPredicateMatch.UNKNOWN); assertMatch("", "", DruidPredicateMatch.TRUE); assertMatch("", "a", DruidPredicateMatch.FALSE); assertMatch("", "This is a test!", DruidPredicateMatch.FALSE); @@ -204,10 +203,10 @@ public void testPatternTrickySuffixes() @Test public void testPatternOnlySpecial() { - assertMatch("%", null, NullHandling.replaceWithDefault() ? DruidPredicateMatch.TRUE : DruidPredicateMatch.UNKNOWN); + assertMatch("%", null, DruidPredicateMatch.UNKNOWN); assertMatch("%", "", DruidPredicateMatch.TRUE); assertMatch("%", "abcxyzxyz", DruidPredicateMatch.TRUE); - assertMatch("_", null, NullHandling.replaceWithDefault() ? DruidPredicateMatch.FALSE : DruidPredicateMatch.UNKNOWN); + assertMatch("_", null, DruidPredicateMatch.UNKNOWN); assertMatch("_", "", DruidPredicateMatch.FALSE); assertMatch("_", "a", DruidPredicateMatch.TRUE); assertMatch("_", "ab", DruidPredicateMatch.FALSE); diff --git a/processing/src/test/java/org/apache/druid/query/groupby/GroupByQueryQueryToolChestTest.java b/processing/src/test/java/org/apache/druid/query/groupby/GroupByQueryQueryToolChestTest.java index 90928ecb042a..80731a244c9a 100644 --- a/processing/src/test/java/org/apache/druid/query/groupby/GroupByQueryQueryToolChestTest.java +++ b/processing/src/test/java/org/apache/druid/query/groupby/GroupByQueryQueryToolChestTest.java @@ -29,7 +29,6 @@ import org.apache.druid.collections.BlockingPool; import org.apache.druid.collections.DefaultBlockingPool; import org.apache.druid.collections.SerializablePair; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.Row; import org.apache.druid.jackson.AggregatorsModule; import org.apache.druid.java.util.common.DateTimes; @@ -95,7 +94,6 @@ public class GroupByQueryQueryToolChestTest extends InitializedNullHandlingTest @BeforeClass public static void setUpClass() { - NullHandling.initializeForTests(); AggregatorsModule.registerComplexMetricsAndSerde(); } diff --git a/processing/src/test/java/org/apache/druid/query/groupby/GroupByQueryRunnerTest.java b/processing/src/test/java/org/apache/druid/query/groupby/GroupByQueryRunnerTest.java index 13e0702f3ef8..300a74c8d2d3 100644 --- a/processing/src/test/java/org/apache/druid/query/groupby/GroupByQueryRunnerTest.java +++ b/processing/src/test/java/org/apache/druid/query/groupby/GroupByQueryRunnerTest.java @@ -30,7 +30,6 @@ import com.google.common.collect.Lists; import com.google.common.collect.Ordering; import com.google.common.collect.Sets; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.Row; import org.apache.druid.data.input.Rows; import org.apache.druid.error.DruidException; @@ -425,7 +424,6 @@ protected void before() @Parameterized.Parameters(name = "{0}") public static Collection constructorFeeder() { - NullHandling.initializeForTests(); setUpClass(); final List constructors = new ArrayList<>(); @@ -6201,11 +6199,7 @@ public void testDoubleMeanQuery() Iterable results = GroupByQueryRunnerTestHelper.runQuery(factory, runner, query); Row result = Iterables.getOnlyElement(results).toMapBasedRow(query); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(39.2307d, result.getMetric("meanOnDouble").doubleValue(), 0.0001d); - } else { - Assert.assertEquals(51.0d, result.getMetric("meanOnDouble").doubleValue(), 0.0001d); - } + Assert.assertEquals(51.0d, result.getMetric("meanOnDouble").doubleValue(), 0.0001d); } @Test @@ -9413,22 +9407,10 @@ public void testGroupByWithExtractionDimFilterCaseMappingValueIsNullOrEmpty() .setDimFilter(new ExtractionDimFilter("quality", "", lookupExtractionFn, null)) .build(); - List expectedResults; - - if (NullHandling.replaceWithDefault()) { - expectedResults = Arrays.asList( - makeRow(query, "2011-04-01", "alias", "mezzanine", "rows", 3L, "idx", 2870L), - makeRow(query, "2011-04-01", "alias", "news", "rows", 1L, "idx", 121L), - makeRow(query, "2011-04-02", "alias", "mezzanine", "rows", 3L, "idx", 2447L), - makeRow(query, "2011-04-02", "alias", "news", "rows", 1L, "idx", 114L) - ); - } else { - // Only empty string should match, nulls will not match - expectedResults = Arrays.asList( - makeRow(query, "2011-04-01", "alias", "news", "rows", 1L, "idx", 121L), - makeRow(query, "2011-04-02", "alias", "news", "rows", 1L, "idx", 114L) - ); - } + List expectedResults = Arrays.asList( + makeRow(query, "2011-04-01", "alias", "news", "rows", 1L, "idx", 121L), + makeRow(query, "2011-04-02", "alias", "news", "rows", 1L, "idx", 114L) + ); Iterable results = GroupByQueryRunnerTestHelper.runQuery(factory, runner, query); TestHelper.assertExpectedObjects(expectedResults, results, "dim-extraction"); @@ -9474,14 +9456,14 @@ public void testGroupByWithExtractionDimFilterKeyisNull() MapLookupExtractor mapLookupExtractor = new MapLookupExtractor(extractionMap, false); - LookupExtractionFn lookupExtractionFn; - if (NullHandling.replaceWithDefault()) { - lookupExtractionFn = new LookupExtractionFn(mapLookupExtractor, false, null, true, false); - extractionMap.put("", "REPLACED_VALUE"); - } else { - lookupExtractionFn = new LookupExtractionFn(mapLookupExtractor, false, "REPLACED_VALUE", true, false); - extractionMap.put("", "NOT_USED"); - } + LookupExtractionFn lookupExtractionFn = new LookupExtractionFn( + mapLookupExtractor, + false, + "REPLACED_VALUE", + true, + false + ); + extractionMap.put("", "NOT_USED"); GroupByQuery query = makeQueryBuilder() .setDataSource(QueryRunnerTestHelper.DATA_SOURCE) @@ -9553,7 +9535,7 @@ public void testGroupByWithAggregatorFilterAndExtractionFunction() "rows", 0L, "idx", - NullHandling.defaultLongValue() + null ), makeRow( query, @@ -9563,7 +9545,7 @@ public void testGroupByWithAggregatorFilterAndExtractionFunction() "rows", 0L, "idx", - NullHandling.defaultLongValue() + null ), makeRow( query, @@ -9573,7 +9555,7 @@ public void testGroupByWithAggregatorFilterAndExtractionFunction() "rows", 0L, "idx", - NullHandling.defaultLongValue() + null ), makeRow( query, @@ -9583,7 +9565,7 @@ public void testGroupByWithAggregatorFilterAndExtractionFunction() "rows", 0L, "idx", - NullHandling.defaultLongValue() + null ), makeRow(query, "2011-04-01", "alias", "mezzanine", "rows", 3L, "idx", 2870L), makeRow(query, "2011-04-01", "alias", "news", "rows", 1L, "idx", 121L), @@ -9595,7 +9577,7 @@ public void testGroupByWithAggregatorFilterAndExtractionFunction() "rows", 0L, "idx", - NullHandling.defaultLongValue() + null ), makeRow( query, @@ -9605,7 +9587,7 @@ public void testGroupByWithAggregatorFilterAndExtractionFunction() "rows", 0L, "idx", - NullHandling.defaultLongValue() + null ), makeRow( query, @@ -9615,7 +9597,7 @@ public void testGroupByWithAggregatorFilterAndExtractionFunction() "rows", 0L, "idx", - NullHandling.defaultLongValue() + null ), makeRow( @@ -9626,7 +9608,7 @@ public void testGroupByWithAggregatorFilterAndExtractionFunction() "rows", 0L, "idx", - NullHandling.defaultLongValue() + null ), makeRow( query, @@ -9636,7 +9618,7 @@ public void testGroupByWithAggregatorFilterAndExtractionFunction() "rows", 0L, "idx", - NullHandling.defaultLongValue() + null ), makeRow( query, @@ -9646,7 +9628,7 @@ public void testGroupByWithAggregatorFilterAndExtractionFunction() "rows", 0L, "idx", - NullHandling.defaultLongValue() + null ), makeRow( query, @@ -9656,7 +9638,7 @@ public void testGroupByWithAggregatorFilterAndExtractionFunction() "rows", 0L, "idx", - NullHandling.defaultLongValue() + null ), makeRow(query, "2011-04-02", "alias", "mezzanine", "rows", 3L, "idx", 2447L), makeRow(query, "2011-04-02", "alias", "news", "rows", 1L, "idx", 114L), @@ -9668,7 +9650,7 @@ public void testGroupByWithAggregatorFilterAndExtractionFunction() "rows", 0L, "idx", - NullHandling.defaultLongValue() + null ), makeRow( query, @@ -9678,7 +9660,7 @@ public void testGroupByWithAggregatorFilterAndExtractionFunction() "rows", 0L, "idx", - NullHandling.defaultLongValue() + null ), makeRow( query, @@ -9688,7 +9670,7 @@ public void testGroupByWithAggregatorFilterAndExtractionFunction() "rows", 0L, "idx", - NullHandling.defaultLongValue() + null ) ); @@ -9749,14 +9731,8 @@ public void testGroupByWithInjectiveLookupDimFilterNullDimsOptimized() extractionMap.put("", "EMPTY"); MapLookupExtractor mapLookupExtractor = new MapLookupExtractor(extractionMap, false); - LookupExtractionFn lookupExtractionFn; - if (NullHandling.replaceWithDefault()) { - extractionMap.put("", "EMPTY"); - lookupExtractionFn = new LookupExtractionFn(mapLookupExtractor, false, null, true, true); - } else { - extractionMap.put("", "SHOULD_NOT_BE_USED"); - lookupExtractionFn = new LookupExtractionFn(mapLookupExtractor, false, "EMPTY", true, true); - } + extractionMap.put("", "SHOULD_NOT_BE_USED"); + LookupExtractionFn lookupExtractionFn = new LookupExtractionFn(mapLookupExtractor, false, "EMPTY", true, true); GroupByQuery query = makeQueryBuilder() .setDataSource(QueryRunnerTestHelper.DATA_SOURCE) @@ -9786,14 +9762,8 @@ public void testGroupByWithInjectiveLookupDimFilterNullDimsNotOptimized() extractionMap.put("", "EMPTY"); MapLookupExtractor mapLookupExtractor = new MapLookupExtractor(extractionMap, false); - LookupExtractionFn lookupExtractionFn; - if (NullHandling.replaceWithDefault()) { - extractionMap.put("", "EMPTY"); - lookupExtractionFn = new LookupExtractionFn(mapLookupExtractor, false, null, true, false); - } else { - extractionMap.put("", "SHOULD_NOT_BE_USED"); - lookupExtractionFn = new LookupExtractionFn(mapLookupExtractor, false, "EMPTY", true, false); - } + extractionMap.put("", "SHOULD_NOT_BE_USED"); + LookupExtractionFn lookupExtractionFn = new LookupExtractionFn(mapLookupExtractor, false, "EMPTY", true, false); GroupByQuery query = makeQueryBuilder() .setDataSource(QueryRunnerTestHelper.DATA_SOURCE) @@ -10238,7 +10208,7 @@ public void testGroupByCardinalityAggOnHyperUnique() "rows", 26L, "cardinality", - NullHandling.replaceWithDefault() ? 1.0002442201269182 : 0.0d, + 0.0d, "hyperUnique", 9.019833517963864d ) @@ -10876,8 +10846,8 @@ public void testGroupByNumericStringsAsNumericWithDecoration() makeRow( query, "2011-04-01", - "ql", NullHandling.defaultLongValue(), - "qf", NullHandling.defaultDoubleValue(), + "ql", null, + "qf", null, "count", 2L ), makeRow( @@ -10918,42 +10888,22 @@ public void testGroupByDecorationOnNumerics() .setAggregatorSpecs(new CountAggregatorFactory("count")) .setGranularity(QueryRunnerTestHelper.ALL_GRAN) .build(); - List expectedResults; - if (NullHandling.replaceWithDefault()) { - expectedResults = Arrays.asList( - makeRow( - query, - "2011-04-01", - "ql", 0L, - "qf", 0.0, - "count", 2L - ), - makeRow( - query, - "2011-04-01", - "ql", 1700L, - "qf", 17000.0, - "count", 2L - ) - ); - } else { - expectedResults = Arrays.asList( - makeRow( - query, - "2011-04-01", - "ql", null, - "qf", null, - "count", 2L - ), - makeRow( - query, - "2011-04-01", - "ql", 1700L, - "qf", 17000.0, - "count", 2L - ) - ); - } + List expectedResults = Arrays.asList( + makeRow( + query, + "2011-04-01", + "ql", null, + "qf", null, + "count", 2L + ), + makeRow( + query, + "2011-04-01", + "ql", 1700L, + "qf", 17000.0, + "count", 2L + ) + ); Iterable results = GroupByQueryRunnerTestHelper.runQuery(factory, runner, query); TestHelper.assertExpectedObjects(expectedResults, results, "numeric"); @@ -11083,17 +11033,17 @@ public void testGroupByNestedWithInnerQueryOutputNullNumerics() outerQuery, "2011-04-01", "quallong", - NullHandling.defaultLongValue(), + null, "qualfloat", - NullHandling.defaultFloatValue(), + null, "qualdouble", - NullHandling.defaultDoubleValue(), + null, "ql_alias_sum", - NullHandling.defaultLongValue(), + null, "qf_alias_sum", - NullHandling.defaultFloatValue(), + null, "qd_alias_sum", - NullHandling.defaultDoubleValue() + null ), makeRow( outerQuery, @@ -12341,24 +12291,13 @@ public void testGroupByOnNullableLong() .setLimit(5) .build(); - List expectedResults; - if (NullHandling.sqlCompatible()) { - expectedResults = Arrays.asList( - makeRow(query, "2011-04-01", "nullable", null, "rows", 6L), - makeRow(query, "2011-04-01", "nullable", 10L, "rows", 2L), - makeRow(query, "2011-04-01", "nullable", 20L, "rows", 2L), - makeRow(query, "2011-04-01", "nullable", 40L, "rows", 2L), - makeRow(query, "2011-04-01", "nullable", 50L, "rows", 6L) - ); - } else { - expectedResults = Arrays.asList( - makeRow(query, "2011-04-01", "nullable", 0L, "rows", 6L), - makeRow(query, "2011-04-01", "nullable", 10L, "rows", 2L), - makeRow(query, "2011-04-01", "nullable", 20L, "rows", 2L), - makeRow(query, "2011-04-01", "nullable", 40L, "rows", 2L), - makeRow(query, "2011-04-01", "nullable", 50L, "rows", 6L) - ); - } + List expectedResults = Arrays.asList( + makeRow(query, "2011-04-01", "nullable", null, "rows", 6L), + makeRow(query, "2011-04-01", "nullable", 10L, "rows", 2L), + makeRow(query, "2011-04-01", "nullable", 20L, "rows", 2L), + makeRow(query, "2011-04-01", "nullable", 40L, "rows", 2L), + makeRow(query, "2011-04-01", "nullable", 50L, "rows", 6L) + ); Iterable results = GroupByQueryRunnerTestHelper.runQuery(factory, runner, query); TestHelper.assertExpectedObjects(expectedResults, results, "groupBy"); @@ -12378,24 +12317,13 @@ public void testGroupByOnNullableDouble() .setLimit(5) .build(); - List expectedResults; - if (NullHandling.sqlCompatible()) { - expectedResults = Arrays.asList( - makeRow(query, "2011-04-01", "nullable", null, "rows", 6L), - makeRow(query, "2011-04-01", "nullable", 10.0, "rows", 2L), - makeRow(query, "2011-04-01", "nullable", 20.0, "rows", 2L), - makeRow(query, "2011-04-01", "nullable", 40.0, "rows", 2L), - makeRow(query, "2011-04-01", "nullable", 50.0, "rows", 6L) - ); - } else { - expectedResults = Arrays.asList( - makeRow(query, "2011-04-01", "nullable", 0.0, "rows", 6L), - makeRow(query, "2011-04-01", "nullable", 10.0, "rows", 2L), - makeRow(query, "2011-04-01", "nullable", 20.0, "rows", 2L), - makeRow(query, "2011-04-01", "nullable", 40.0, "rows", 2L), - makeRow(query, "2011-04-01", "nullable", 50.0, "rows", 6L) - ); - } + List expectedResults = Arrays.asList( + makeRow(query, "2011-04-01", "nullable", null, "rows", 6L), + makeRow(query, "2011-04-01", "nullable", 10.0, "rows", 2L), + makeRow(query, "2011-04-01", "nullable", 20.0, "rows", 2L), + makeRow(query, "2011-04-01", "nullable", 40.0, "rows", 2L), + makeRow(query, "2011-04-01", "nullable", 50.0, "rows", 6L) + ); Iterable results = GroupByQueryRunnerTestHelper.runQuery(factory, runner, query); TestHelper.assertExpectedObjects(expectedResults, results, "groupBy"); @@ -12419,24 +12347,13 @@ public void testGroupByOnNullableDoubleNoLimitPushdown() )), 5)) .build(); - List expectedResults; - if (NullHandling.sqlCompatible()) { - expectedResults = Arrays.asList( - makeRow(query, "2011-04-01", "nullable", null, "rows", 6L), - makeRow(query, "2011-04-01", "nullable", 10.0, "rows", 2L), - makeRow(query, "2011-04-01", "nullable", 20.0, "rows", 2L), - makeRow(query, "2011-04-01", "nullable", 40.0, "rows", 2L), - makeRow(query, "2011-04-01", "nullable", 50.0, "rows", 6L) - ); - } else { - expectedResults = Arrays.asList( - makeRow(query, "2011-04-01", "nullable", 0.0, "rows", 6L), - makeRow(query, "2011-04-01", "nullable", 10.0, "rows", 2L), - makeRow(query, "2011-04-01", "nullable", 20.0, "rows", 2L), - makeRow(query, "2011-04-01", "nullable", 40.0, "rows", 2L), - makeRow(query, "2011-04-01", "nullable", 50.0, "rows", 6L) - ); - } + List expectedResults = Arrays.asList( + makeRow(query, "2011-04-01", "nullable", null, "rows", 6L), + makeRow(query, "2011-04-01", "nullable", 10.0, "rows", 2L), + makeRow(query, "2011-04-01", "nullable", 20.0, "rows", 2L), + makeRow(query, "2011-04-01", "nullable", 40.0, "rows", 2L), + makeRow(query, "2011-04-01", "nullable", 50.0, "rows", 6L) + ); Iterable results = GroupByQueryRunnerTestHelper.runQuery(factory, runner, query); TestHelper.assertExpectedObjects(expectedResults, results, "groupBy"); @@ -12458,24 +12375,13 @@ public void testGroupByOnNullableFloat() .setLimit(5) .build(); - List expectedResults; - if (NullHandling.sqlCompatible()) { - expectedResults = Arrays.asList( - makeRow(query, "2011-04-01", "nullable", null, "rows", 6L), - makeRow(query, "2011-04-01", "nullable", 10.0f, "rows", 2L), - makeRow(query, "2011-04-01", "nullable", 20.0f, "rows", 2L), - makeRow(query, "2011-04-01", "nullable", 40.0f, "rows", 2L), - makeRow(query, "2011-04-01", "nullable", 50.0f, "rows", 6L) - ); - } else { - expectedResults = Arrays.asList( - makeRow(query, "2011-04-01", "nullable", 0.0f, "rows", 6L), - makeRow(query, "2011-04-01", "nullable", 10.0f, "rows", 2L), - makeRow(query, "2011-04-01", "nullable", 20.0f, "rows", 2L), - makeRow(query, "2011-04-01", "nullable", 40.0f, "rows", 2L), - makeRow(query, "2011-04-01", "nullable", 50.0f, "rows", 6L) - ); - } + List expectedResults = Arrays.asList( + makeRow(query, "2011-04-01", "nullable", null, "rows", 6L), + makeRow(query, "2011-04-01", "nullable", 10.0f, "rows", 2L), + makeRow(query, "2011-04-01", "nullable", 20.0f, "rows", 2L), + makeRow(query, "2011-04-01", "nullable", 40.0f, "rows", 2L), + makeRow(query, "2011-04-01", "nullable", 50.0f, "rows", 6L) + ); Iterable results = GroupByQueryRunnerTestHelper.runQuery(factory, runner, query); TestHelper.assertExpectedObjects(expectedResults, results, "groupBy"); @@ -13402,11 +13308,11 @@ public void testGroupByFloatMaxExpressionVsVirtualColumn() "nil", null, "min", - NullHandling.replaceWithDefault() ? 0.0 : 10.0, + 10.0, "minExpression", - NullHandling.replaceWithDefault() ? 0.0 : 10.0, + 10.0, "minVc", - NullHandling.replaceWithDefault() ? 0.0 : 10.0 + 10.0 ) ); @@ -13454,9 +13360,9 @@ public void testGroupByFloatMinExpressionVsVirtualColumnWithNonFloatInputButMatc "nil", null, "minExpression", - NullHandling.replaceWithDefault() ? Float.POSITIVE_INFINITY : null, + null, "minVc", - NullHandling.defaultFloatValue() + null ) ); @@ -13510,7 +13416,7 @@ public void testGroupByFloatMinExpressionVsVirtualColumnWithExplicitStringVirtua "min", Float.POSITIVE_INFINITY, "minExpression", - NullHandling.replaceWithDefault() ? Float.POSITIVE_INFINITY : null, + null, "minVc", Float.POSITIVE_INFINITY ) @@ -13546,13 +13452,13 @@ public void testSummaryrowForEmptyInput() "rows", 0L, "idx", - NullHandling.replaceWithDefault() ? 0L : null, + null, "idxFloat", - NullHandling.replaceWithDefault() ? 0.0 : null, + null, "idxDouble", - NullHandling.replaceWithDefault() ? 0.0 : null, + null, "post", - NullHandling.replaceWithDefault() ? 0L : null + null ) ); @@ -13630,11 +13536,11 @@ public void testSummaryrowForEmptySubqueryInput() "rows", 0L, "idx", - NullHandling.replaceWithDefault() ? 0L : null, + null, "idxFloat", - NullHandling.replaceWithDefault() ? 0.0 : null, + null, "idxDouble", - NullHandling.replaceWithDefault() ? 0.0 : null + null ) ); diff --git a/processing/src/test/java/org/apache/druid/query/groupby/GroupByTimeseriesQueryRunnerTest.java b/processing/src/test/java/org/apache/druid/query/groupby/GroupByTimeseriesQueryRunnerTest.java index 1309334a939a..b3d140d0479c 100644 --- a/processing/src/test/java/org/apache/druid/query/groupby/GroupByTimeseriesQueryRunnerTest.java +++ b/processing/src/test/java/org/apache/druid/query/groupby/GroupByTimeseriesQueryRunnerTest.java @@ -24,7 +24,6 @@ import com.google.common.base.Function; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.MapBasedRow; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.HumanReadableBytes; @@ -373,10 +372,6 @@ public void testTimeseriesWithExpressionAggregatorTooBig() @Test public void testTimeseriesWithInvertedFilterOnNonExistentDimension() { - if (NullHandling.replaceWithDefault()) { - super.testTimeseriesWithInvertedFilterOnNonExistentDimension(); - return; - } TimeseriesQuery query = Druids.newTimeseriesQueryBuilder() .dataSource(QueryRunnerTestHelper.DATA_SOURCE) .granularity(QueryRunnerTestHelper.DAY_GRAN) diff --git a/processing/src/test/java/org/apache/druid/query/groupby/NestedDataGroupByQueryTest.java b/processing/src/test/java/org/apache/druid/query/groupby/NestedDataGroupByQueryTest.java index a0aef93381ff..1cda0eb016b9 100644 --- a/processing/src/test/java/org/apache/druid/query/groupby/NestedDataGroupByQueryTest.java +++ b/processing/src/test/java/org/apache/druid/query/groupby/NestedDataGroupByQueryTest.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.guice.BuiltInTypesModule; import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.granularity.Granularities; @@ -185,13 +184,7 @@ public void testGroupByRegularColumns() runResults( groupQuery, - NullHandling.replaceWithDefault() - ? ImmutableList.of( - new Object[]{"100", null, 100L, 1L, "1", 0L, 2L}, - new Object[]{"hello", null, 0L, 1L, "1", 0L, 12L}, - new Object[]{"world", null, 0L, 1L, "1", 0L, 2L} - ) - : ImmutableList.of( + ImmutableList.of( new Object[]{"100", null, 100L, 1L, "1", null, 2L}, new Object[]{"hello", null, null, 1L, "1", null, 12L}, new Object[]{"world", null, null, 1L, "1", null, 2L} @@ -203,7 +196,7 @@ public void testGroupByRegularColumns() public void testGroupBySomeFieldWithFilter() { List vals = new ArrayList<>(); - vals.add(NullHandling.defaultStringValue()); + vals.add(null); vals.add("100"); vals.add("200"); vals.add("300"); @@ -234,7 +227,7 @@ public void testGroupBySomeFieldWithFilter() public void testGroupByNoFieldWithFilter() { List vals = new ArrayList<>(); - vals.add(NullHandling.defaultStringValue()); + vals.add(null); vals.add("100"); vals.add("200"); vals.add("300"); @@ -257,7 +250,7 @@ public void testGroupByNoFieldWithFilter() public void testGroupBySomeFieldWithNonExistentAgg() { List vals = new ArrayList<>(); - vals.add(NullHandling.defaultStringValue()); + vals.add(null); vals.add("100"); vals.add("200"); vals.add("300"); @@ -277,7 +270,7 @@ public void testGroupBySomeFieldWithNonExistentAgg() .build(); - runResults(groupQuery, ImmutableList.of(new Object[]{null, NullHandling.defaultLongValue()})); + runResults(groupQuery, ImmutableList.of(new Object[]{null, null})); } @Test @@ -303,9 +296,7 @@ public void testGroupByNonExistentVirtualColumn() runResults( groupQuery, - NullHandling.sqlCompatible() - ? ImmutableList.of(new Object[]{null, 16L}) - : ImmutableList.of(new Object[]{"foo", 16L}) + ImmutableList.of(new Object[]{null, 16L}) ); } @@ -548,8 +539,8 @@ public void testGroupBySomeFieldOnLongColumn() runResults( groupQuery, ImmutableList.of( - new Object[]{1672531200000L, NullHandling.defaultLongValue(), 8L}, - new Object[]{1672617600000L, NullHandling.defaultLongValue(), 8L} + new Object[]{1672531200000L, null, 8L}, + new Object[]{1672617600000L, null, 8L} ) ); } diff --git a/processing/src/test/java/org/apache/druid/query/groupby/NestedGroupByArrayQueryTest.java b/processing/src/test/java/org/apache/druid/query/groupby/NestedGroupByArrayQueryTest.java index dd93978b6fdb..c9685eb5b7c5 100644 --- a/processing/src/test/java/org/apache/druid/query/groupby/NestedGroupByArrayQueryTest.java +++ b/processing/src/test/java/org/apache/druid/query/groupby/NestedGroupByArrayQueryTest.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.guice.BuiltInTypesModule; import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.granularity.Granularities; @@ -291,7 +290,7 @@ public void testGroupByRootArrayStringElementDouble() runResults( groupQuery, ImmutableList.of( - new Object[]{NullHandling.defaultDoubleValue(), 28L} + new Object[]{null, 28L} ) ); } @@ -320,7 +319,7 @@ public void testGroupByRootArrayStringElementLong() runResults( groupQuery, ImmutableList.of( - new Object[]{NullHandling.defaultLongValue(), 28L} + new Object[]{null, 28L} ) ); } @@ -349,7 +348,7 @@ public void testGroupByRootArrayStringElementFloat() runResults( groupQuery, ImmutableList.of( - new Object[]{NullHandling.defaultFloatValue(), 28L} + new Object[]{null, 28L} ) ); } @@ -378,7 +377,7 @@ public void testGroupByRootArrayLongElement() runResults( groupQuery, ImmutableList.of( - new Object[]{NullHandling.defaultLongValue(), 16L}, + new Object[]{null, 16L}, new Object[]{3L, 12L} ) ); @@ -408,7 +407,7 @@ public void testGroupByRootArrayLongElementDouble() runResults( groupQuery, ImmutableList.of( - new Object[]{NullHandling.defaultDoubleValue(), 16L}, + new Object[]{null, 16L}, new Object[]{3.0, 12L} ) ); @@ -438,7 +437,7 @@ public void testGroupByRootArrayLongElementFloat() runResults( groupQuery, ImmutableList.of( - new Object[]{NullHandling.defaultFloatValue(), 16L}, + new Object[]{null, 16L}, new Object[]{3.0f, 12L} ) ); diff --git a/processing/src/test/java/org/apache/druid/query/groupby/UnnestGroupByQueryRunnerTest.java b/processing/src/test/java/org/apache/druid/query/groupby/UnnestGroupByQueryRunnerTest.java index 1df4675f7e6b..c4ef1477e017 100644 --- a/processing/src/test/java/org/apache/druid/query/groupby/UnnestGroupByQueryRunnerTest.java +++ b/processing/src/test/java/org/apache/druid/query/groupby/UnnestGroupByQueryRunnerTest.java @@ -24,7 +24,6 @@ import com.google.common.base.Suppliers; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.ListBasedInputRow; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.ISE; @@ -193,7 +192,6 @@ public static GroupByQueryRunnerFactory makeQueryRunnerFactory( @Parameterized.Parameters(name = "{0}") public static Collection constructorFeeder() { - NullHandling.initializeForTests(); setUpClass(); final List constructors = new ArrayList<>(); @@ -762,17 +760,12 @@ public void testGroupByOnUnnestedStringColumnWithNullStuff() throws IOException .setGranularity(QueryRunnerTestHelper.ALL_GRAN) .build(); - List expectedResults = NullHandling.sqlCompatible() ? Arrays.asList( + List expectedResults = Arrays.asList( makeRow(query, timestamp, "v0", null, "rows", 2L), makeRow(query, timestamp, "v0", "", "rows", 1L), makeRow(query, timestamp, "v0", "a", "rows", 1L), makeRow(query, timestamp, "v0", "b", "rows", 1L), makeRow(query, timestamp, "v0", "c", "rows", 1L) - ) : Arrays.asList( - makeRow(query, timestamp, "v0", null, "rows", 3L), - makeRow(query, timestamp, "v0", "a", "rows", 1L), - makeRow(query, timestamp, "v0", "b", "rows", 1L), - makeRow(query, timestamp, "v0", "c", "rows", 1L) ); Iterable results = runQuery(query, bob.buildIncrementalIndex()); @@ -840,17 +833,12 @@ public void testGroupByOnUnnestedStringColumnWithMoreNullStuff() throws IOExcept .setGranularity(QueryRunnerTestHelper.ALL_GRAN) .build(); - List expectedResults = NullHandling.sqlCompatible() ? Arrays.asList( + List expectedResults = Arrays.asList( makeRow(query, timestamp, "v0", null, "rows", 6L), makeRow(query, timestamp, "v0", "", "rows", 1L), makeRow(query, timestamp, "v0", "a", "rows", 1L), makeRow(query, timestamp, "v0", "b", "rows", 1L), makeRow(query, timestamp, "v0", "c", "rows", 1L) - ) : Arrays.asList( - makeRow(query, timestamp, "v0", null, "rows", 7L), - makeRow(query, timestamp, "v0", "a", "rows", 1L), - makeRow(query, timestamp, "v0", "b", "rows", 1L), - makeRow(query, timestamp, "v0", "c", "rows", 1L) ); Iterable results = runQuery(query, bob.buildIncrementalIndex()); @@ -1022,17 +1010,12 @@ public void testGroupByOnUnnestedStringColumnDoubleUnnest() throws IOException .setGranularity(QueryRunnerTestHelper.ALL_GRAN) .build(); - List expectedResults = NullHandling.sqlCompatible() ? Arrays.asList( + List expectedResults = Arrays.asList( makeRow(query, timestamp, "v1", null, "rows", 2L), makeRow(query, timestamp, "v1", "", "rows", 1L), makeRow(query, timestamp, "v1", "a", "rows", 1L), makeRow(query, timestamp, "v1", "b", "rows", 1L), makeRow(query, timestamp, "v1", "c", "rows", 1L) - ) : Arrays.asList( - makeRow(query, timestamp, "v1", null, "rows", 3L), - makeRow(query, timestamp, "v1", "a", "rows", 1L), - makeRow(query, timestamp, "v1", "b", "rows", 1L), - makeRow(query, timestamp, "v1", "c", "rows", 1L) ); Iterable results = runQuery(query, bob.buildIncrementalIndex()); diff --git a/processing/src/test/java/org/apache/druid/query/groupby/epinephelinae/BufferArrayGrouperTest.java b/processing/src/test/java/org/apache/druid/query/groupby/epinephelinae/BufferArrayGrouperTest.java index 8ea3466134df..a3e6d4210ed5 100644 --- a/processing/src/test/java/org/apache/druid/query/groupby/epinephelinae/BufferArrayGrouperTest.java +++ b/processing/src/test/java/org/apache/druid/query/groupby/epinephelinae/BufferArrayGrouperTest.java @@ -22,7 +22,6 @@ import com.google.common.base.Suppliers; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.MapBasedRow; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.query.aggregation.AggregatorAdapters; @@ -31,7 +30,6 @@ import org.apache.druid.query.aggregation.LongSumAggregatorFactory; import org.apache.druid.query.groupby.epinephelinae.Grouper.Entry; import org.junit.Assert; -import org.junit.BeforeClass; import org.junit.Test; import java.nio.ByteBuffer; @@ -39,12 +37,6 @@ public class BufferArrayGrouperTest { - @BeforeClass - public static void setUpStatic() - { - NullHandling.initializeForTests(); - } - @Test public void testAggregate() { @@ -103,12 +95,7 @@ public void testRequiredBufferCapacity() final long[] requiredSizes; - if (NullHandling.sqlCompatible()) { - // We need additional space to store nulls. - requiredSizes = new long[]{19, 101, 19595788279L, -1}; - } else { - requiredSizes = new long[]{17, 90, 17448304632L, -1}; - } + requiredSizes = new long[]{19, 101, 19595788279L, -1}; for (int i = 0; i < cardinalityArray.length; i++) { Assert.assertEquals( diff --git a/processing/src/test/java/org/apache/druid/query/groupby/epinephelinae/BufferHashGrouperTest.java b/processing/src/test/java/org/apache/druid/query/groupby/epinephelinae/BufferHashGrouperTest.java index a67479f7c222..c96bc50dd78d 100644 --- a/processing/src/test/java/org/apache/druid/query/groupby/epinephelinae/BufferHashGrouperTest.java +++ b/processing/src/test/java/org/apache/druid/query/groupby/epinephelinae/BufferHashGrouperTest.java @@ -23,7 +23,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import org.apache.druid.collections.ResourceHolder; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.MapBasedRow; import org.apache.druid.java.util.common.ByteBufferUtils; import org.apache.druid.query.aggregation.AggregatorAdapters; @@ -102,7 +101,7 @@ public void testGrowing() final GroupByTestColumnSelectorFactory columnSelectorFactory = GrouperTestUtil.newColumnSelectorFactory(); try (final ResourceHolder> grouperHolder = makeGrouper(columnSelectorFactory, 10000, 2, 0.75f)) { final Grouper grouper = grouperHolder.get(); - final int expectedMaxSize = NullHandling.replaceWithDefault() ? 219 : 210; + final int expectedMaxSize = 210; columnSelectorFactory.setRow(new MapBasedRow(0, ImmutableMap.of("value", 10L))); for (int i = 0; i < expectedMaxSize; i++) { @@ -126,27 +125,6 @@ public void testGrowing() } } - @Test - public void testGrowingOverflowingInteger() - { - // This test checks the bug reported in https://github.com/apache/druid/pull/4333 only when - // NullHandling.replaceWithDefault() is true - if (NullHandling.replaceWithDefault()) { - final GroupByTestColumnSelectorFactory columnSelectorFactory = GrouperTestUtil.newColumnSelectorFactory(); - // the buffer size below is chosen to test integer overflow in ByteBufferHashTable.adjustTableWhenFull(). - try (final ResourceHolder> holder = makeGrouper(columnSelectorFactory, 1_900_000_000, 2, 0.3f)) { - final Grouper grouper = holder.get(); - final int expectedMaxSize = 15323979; - - columnSelectorFactory.setRow(new MapBasedRow(0, ImmutableMap.of("value", 10L))); - for (int i = 0; i < expectedMaxSize; i++) { - Assert.assertTrue(String.valueOf(i), grouper.aggregate(new IntKey(i)).isOk()); - } - Assert.assertFalse(grouper.aggregate(new IntKey(expectedMaxSize)).isOk()); - } - } - } - @Test public void testNoGrowing() { @@ -154,7 +132,7 @@ public void testNoGrowing() try (final ResourceHolder> grouperHolder = makeGrouper(columnSelectorFactory, 10000, Integer.MAX_VALUE, 0.75f)) { final Grouper grouper = grouperHolder.get(); - final int expectedMaxSize = NullHandling.replaceWithDefault() ? 267 : 258; + final int expectedMaxSize = 258; columnSelectorFactory.setRow(new MapBasedRow(0, ImmutableMap.of("value", 10L))); for (int i = 0; i < expectedMaxSize; i++) { diff --git a/processing/src/test/java/org/apache/druid/query/groupby/epinephelinae/LimitedBufferHashGrouperTest.java b/processing/src/test/java/org/apache/druid/query/groupby/epinephelinae/LimitedBufferHashGrouperTest.java index b49b08803fa0..07631840231c 100644 --- a/processing/src/test/java/org/apache/druid/query/groupby/epinephelinae/LimitedBufferHashGrouperTest.java +++ b/processing/src/test/java/org/apache/druid/query/groupby/epinephelinae/LimitedBufferHashGrouperTest.java @@ -23,7 +23,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.MapBasedRow; import org.apache.druid.java.util.common.IAE; import org.apache.druid.java.util.common.Pair; @@ -68,36 +67,20 @@ public void testLimitAndBufferSwapping() for (int i = 0; i < NUM_ROWS; i++) { Assert.assertTrue(String.valueOf(i + KEY_BASE), grouper.aggregate(new IntKey(i + KEY_BASE)).isOk()); } - if (NullHandling.replaceWithDefault()) { - // bucket size is hash(int) + key(int) + aggs(2 longs) + heap offset(int) = 28 bytes - // limit is 100 so heap occupies 101 * 4 bytes = 404 bytes - // buffer is 20000 bytes, so table arena size is 20000 - 404 = 19596 bytes - // table arena is split in halves when doing push down, so each half is 9798 bytes - // each table arena half can hold 9798 / 28 = 349 buckets, with load factor of 0.5 max buckets per half is 174 - // First buffer swap occurs when we hit 174 buckets - // Subsequent buffer swaps occur after every 74 buckets, since we keep 100 buckets due to the limit - // With 1000 keys inserted, this results in one swap at the first 174 buckets, then 11 swaps afterwards. - // After the last swap, we have 100 keys + 12 new keys inserted. - Assert.assertEquals(12, grouper.getGrowthCount()); - Assert.assertEquals(112, grouper.getSize()); - Assert.assertEquals(349, grouper.getBuckets()); - Assert.assertEquals(174, grouper.getMaxSize()); - } else { - // With Nullability enabled - // bucket size is hash(int) + key(int) + aggs(2 longs + 1 bytes for Long Agg nullability) + heap offset(int) = 29 bytes - // limit is 100 so heap occupies 101 * 4 bytes = 404 bytes - // buffer is 20000 bytes, so table arena size is 20000 - 404 = 19596 bytes - // table arena is split in halves when doing push down, so each half is 9798 bytes - // each table arena half can hold 9798 / 29 = 337 buckets, with load factor of 0.5 max buckets per half is 168 - // First buffer swap occurs when we hit 168 buckets - // Subsequent buffer swaps occur after every 68 buckets, since we keep 100 buckets due to the limit - // With 1000 keys inserted, this results in one swap at the first 169 buckets, then 12 swaps afterwards. - // After the last swap, we have 100 keys + 16 new keys inserted. - Assert.assertEquals(13, grouper.getGrowthCount()); - Assert.assertEquals(116, grouper.getSize()); - Assert.assertEquals(337, grouper.getBuckets()); - Assert.assertEquals(168, grouper.getMaxSize()); - } + // With Nullability enabled + // bucket size is hash(int) + key(int) + aggs(2 longs + 1 bytes for Long Agg nullability) + heap offset(int) = 29 bytes + // limit is 100 so heap occupies 101 * 4 bytes = 404 bytes + // buffer is 20000 bytes, so table arena size is 20000 - 404 = 19596 bytes + // table arena is split in halves when doing push down, so each half is 9798 bytes + // each table arena half can hold 9798 / 29 = 337 buckets, with load factor of 0.5 max buckets per half is 168 + // First buffer swap occurs when we hit 168 buckets + // Subsequent buffer swaps occur after every 68 buckets, since we keep 100 buckets due to the limit + // With 1000 keys inserted, this results in one swap at the first 169 buckets, then 12 swaps afterwards. + // After the last swap, we have 100 keys + 16 new keys inserted. + Assert.assertEquals(13, grouper.getGrowthCount()); + Assert.assertEquals(116, grouper.getSize()); + Assert.assertEquals(337, grouper.getBuckets()); + Assert.assertEquals(168, grouper.getMaxSize()); Assert.assertEquals(100, grouper.getLimit()); @@ -109,26 +92,15 @@ public void testLimitAndBufferSwapping() Assert.assertTrue(String.valueOf(i), grouper.aggregate(new IntKey(i)).isOk()); } - if (NullHandling.replaceWithDefault()) { - // we added another 1000 unique keys - // previous size is 112, so next swap occurs after 62 rows - // after that, there are 1000 - 62 = 938 rows, 938 / 74 = 12 additional swaps after the first, - // with 50 keys being added after the final swap. - Assert.assertEquals(25, grouper.getGrowthCount()); - Assert.assertEquals(150, grouper.getSize()); - Assert.assertEquals(349, grouper.getBuckets()); - Assert.assertEquals(174, grouper.getMaxSize()); - } else { - // With Nullable Aggregator - // we added another 1000 unique keys - // previous size is 116, so next swap occurs after 52 rows - // after that, there are 1000 - 52 = 948 rows, 948 / 68 = 13 additional swaps after the first, - // with 64 keys being added after the final swap. - Assert.assertEquals(27, grouper.getGrowthCount()); - Assert.assertEquals(164, grouper.getSize()); - Assert.assertEquals(337, grouper.getBuckets()); - Assert.assertEquals(168, grouper.getMaxSize()); - } + // With Nullable Aggregator + // we added another 1000 unique keys + // previous size is 116, so next swap occurs after 52 rows + // after that, there are 1000 - 52 = 948 rows, 948 / 68 = 13 additional swaps after the first, + // with 64 keys being added after the final swap. + Assert.assertEquals(27, grouper.getGrowthCount()); + Assert.assertEquals(164, grouper.getSize()); + Assert.assertEquals(337, grouper.getBuckets()); + Assert.assertEquals(168, grouper.getMaxSize()); Assert.assertEquals(100, grouper.getLimit()); @@ -163,17 +135,10 @@ public void testMinBufferSize() } // With minimum buffer size, after the first swap, every new key added will result in a swap - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(224, grouper.getGrowthCount()); - Assert.assertEquals(104, grouper.getSize()); - Assert.assertEquals(209, grouper.getBuckets()); - Assert.assertEquals(104, grouper.getMaxSize()); - } else { - Assert.assertEquals(899, grouper.getGrowthCount()); - Assert.assertEquals(101, grouper.getSize()); - Assert.assertEquals(202, grouper.getBuckets()); - Assert.assertEquals(101, grouper.getMaxSize()); - } + Assert.assertEquals(899, grouper.getGrowthCount()); + Assert.assertEquals(101, grouper.getSize()); + Assert.assertEquals(202, grouper.getBuckets()); + Assert.assertEquals(101, grouper.getMaxSize()); Assert.assertEquals(100, grouper.getLimit()); // Aggregate slightly different row @@ -183,17 +148,10 @@ public void testMinBufferSize() for (int i = 0; i < NUM_ROWS; i++) { Assert.assertTrue(String.valueOf(i), grouper.aggregate(new IntKey(i)).isOk()); } - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(474, grouper.getGrowthCount()); - Assert.assertEquals(104, grouper.getSize()); - Assert.assertEquals(209, grouper.getBuckets()); - Assert.assertEquals(104, grouper.getMaxSize()); - } else { - Assert.assertEquals(1899, grouper.getGrowthCount()); - Assert.assertEquals(101, grouper.getSize()); - Assert.assertEquals(202, grouper.getBuckets()); - Assert.assertEquals(101, grouper.getMaxSize()); - } + Assert.assertEquals(1899, grouper.getGrowthCount()); + Assert.assertEquals(101, grouper.getSize()); + Assert.assertEquals(202, grouper.getBuckets()); + Assert.assertEquals(101, grouper.getMaxSize()); Assert.assertEquals(100, grouper.getLimit()); final List>> expected = new ArrayList<>(); diff --git a/processing/src/test/java/org/apache/druid/query/groupby/epinephelinae/StreamingMergeSortedGrouperTest.java b/processing/src/test/java/org/apache/druid/query/groupby/epinephelinae/StreamingMergeSortedGrouperTest.java index 9c2f8ee63079..203bf8c6ddbe 100644 --- a/processing/src/test/java/org/apache/druid/query/groupby/epinephelinae/StreamingMergeSortedGrouperTest.java +++ b/processing/src/test/java/org/apache/druid/query/groupby/epinephelinae/StreamingMergeSortedGrouperTest.java @@ -22,7 +22,6 @@ import com.google.common.base.Suppliers; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.MapBasedRow; import org.apache.druid.java.util.common.concurrent.Execs; import org.apache.druid.java.util.common.parsers.CloseableIterator; @@ -148,11 +147,7 @@ private void testStreamingAggregate(int bufferSize) throws ExecutionException, I public void testNotEnoughBuffer() { expectedException.expect(IllegalStateException.class); - if (NullHandling.replaceWithDefault()) { - expectedException.expectMessage("Buffer[50] should be large enough to store at least three records[20]"); - } else { - expectedException.expectMessage("Buffer[50] should be large enough to store at least three records[21]"); - } + expectedException.expectMessage("Buffer[50] should be large enough to store at least three records[21]"); newGrouper(GrouperTestUtil.newColumnSelectorFactory(), 50); } diff --git a/processing/src/test/java/org/apache/druid/query/groupby/epinephelinae/column/FixedWidthGroupByColumnSelectorStrategyTest.java b/processing/src/test/java/org/apache/druid/query/groupby/epinephelinae/column/FixedWidthGroupByColumnSelectorStrategyTest.java index d427cb88bef6..628ce7391c36 100644 --- a/processing/src/test/java/org/apache/druid/query/groupby/epinephelinae/column/FixedWidthGroupByColumnSelectorStrategyTest.java +++ b/processing/src/test/java/org/apache/druid/query/groupby/epinephelinae/column/FixedWidthGroupByColumnSelectorStrategyTest.java @@ -20,7 +20,6 @@ package org.apache.druid.query.groupby.epinephelinae.column; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.IterableRowsCursorHelper; import org.apache.druid.query.groupby.ResultRow; import org.apache.druid.query.groupby.epinephelinae.GroupByColumnSelectorStrategyFactory; @@ -84,7 +83,7 @@ public void testWriteToKeyBuffer() STRATEGY.processValueFromGroupingKey(groupByColumnSelectorPlus, BUFFER1, resultRow, 0); // There shouldn't be any internal size increase associated with the fixed width types Assert.assertEquals(0, sizeIncrease); - Assert.assertEquals(NullHandling.nullToEmptyIfNeeded((Long) DATASOURCE_ROWS.get(rowNum)[0]), resultRow.get(0)); + Assert.assertEquals(DATASOURCE_ROWS.get(rowNum)[0], resultRow.get(0)); cursor.advance(); ++rowNum; } @@ -101,7 +100,7 @@ public void testInitColumnValues() while (!cursor.isDone()) { int sizeIncrease = STRATEGY.initColumnValues(columnValueSelector, 0, valuess); Assert.assertEquals(0, sizeIncrease); - Assert.assertEquals(NullHandling.nullToEmptyIfNeeded((Long) DATASOURCE_ROWS.get(rowNum)[0]), valuess[0]); + Assert.assertEquals(DATASOURCE_ROWS.get(rowNum)[0], valuess[0]); cursor.advance(); ++rowNum; } @@ -228,7 +227,7 @@ public void testWriteToKeyBuffer() int sizeIncrease = STRATEGY.writeToKeyBuffer(0, columnValueSelector, BUFFER1); STRATEGY.processValueFromGroupingKey(groupByColumnSelectorPlus, BUFFER1, resultRow, 0); Assert.assertEquals(0, sizeIncrease); - Assert.assertEquals(NullHandling.nullToEmptyIfNeeded((Float) DATASOURCE_ROWS.get(rowNum)[1]), resultRow.get(0)); + Assert.assertEquals(DATASOURCE_ROWS.get(rowNum)[1], resultRow.get(0)); cursor.advance(); ++rowNum; } @@ -245,7 +244,7 @@ public void testInitColumnValues() while (!cursor.isDone()) { int sizeIncrease = STRATEGY.initColumnValues(columnValueSelector, 0, valuess); Assert.assertEquals(0, sizeIncrease); - Assert.assertEquals(NullHandling.nullToEmptyIfNeeded((Float) DATASOURCE_ROWS.get(rowNum)[1]), valuess[0]); + Assert.assertEquals(DATASOURCE_ROWS.get(rowNum)[1], valuess[0]); cursor.advance(); ++rowNum; } @@ -374,7 +373,7 @@ public void testWriteToKeyBuffer() STRATEGY.processValueFromGroupingKey(groupByColumnSelectorPlus, BUFFER1, resultRow, 0); Assert.assertEquals(0, sizeIncrease); Assert.assertEquals( - NullHandling.nullToEmptyIfNeeded((Double) DATASOURCE_ROWS.get(rowNum)[2]), + DATASOURCE_ROWS.get(rowNum)[2], resultRow.get(0) ); cursor.advance(); @@ -394,7 +393,7 @@ public void testInitColumnValues() while (!cursor.isDone()) { int sizeIncrease = STRATEGY.initColumnValues(columnValueSelector, 0, valuess); Assert.assertEquals(0, sizeIncrease); - Assert.assertEquals(NullHandling.nullToEmptyIfNeeded((Double) DATASOURCE_ROWS.get(rowNum)[2]), valuess[0]); + Assert.assertEquals(DATASOURCE_ROWS.get(rowNum)[2], valuess[0]); cursor.advance(); ++rowNum; } diff --git a/processing/src/test/java/org/apache/druid/query/lookup/LookupExtractionFnExpectationsTest.java b/processing/src/test/java/org/apache/druid/query/lookup/LookupExtractionFnExpectationsTest.java index 02ffd2fc4b2d..4319cc4a3a8c 100644 --- a/processing/src/test/java/org/apache/druid/query/lookup/LookupExtractionFnExpectationsTest.java +++ b/processing/src/test/java/org/apache/druid/query/lookup/LookupExtractionFnExpectationsTest.java @@ -20,7 +20,6 @@ package org.apache.druid.query.lookup; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.extraction.MapLookupExtractor; import org.junit.Assert; import org.junit.Test; @@ -66,11 +65,7 @@ public void testNullKeyIsMappable() false, false ); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals("bar", lookupExtractionFn.apply(null)); - } else { - Assert.assertEquals("REPLACE", lookupExtractionFn.apply(null)); - } + Assert.assertEquals("REPLACE", lookupExtractionFn.apply(null)); } @Test diff --git a/processing/src/test/java/org/apache/druid/query/lookup/LookupExtractionFnTest.java b/processing/src/test/java/org/apache/druid/query/lookup/LookupExtractionFnTest.java index 08f41c785e91..8fea44694154 100644 --- a/processing/src/test/java/org/apache/druid/query/lookup/LookupExtractionFnTest.java +++ b/processing/src/test/java/org/apache/druid/query/lookup/LookupExtractionFnTest.java @@ -25,7 +25,6 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; import com.google.common.collect.Sets; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.java.util.common.IAE; import org.apache.druid.query.extraction.MapLookupExtractor; @@ -66,7 +65,7 @@ public static Iterable constructorFeeder() public LookupExtractionFnTest(boolean retainMissing, String replaceMissing, Optional injective) { - this.replaceMissing = NullHandling.emptyToNullIfNeeded(replaceMissing); + this.replaceMissing = replaceMissing; this.retainMissing = retainMissing; this.injective = injective.orElse(null); } @@ -74,7 +73,7 @@ public LookupExtractionFnTest(boolean retainMissing, String replaceMissing, Opti @Test public void testEqualsAndHash() { - if (retainMissing && !NullHandling.isNullOrEquivalent(replaceMissing)) { + if (retainMissing && replaceMissing != null) { // skip return; } @@ -111,7 +110,7 @@ public void testEqualsAndHash() @Test public void testSimpleSerDe() throws IOException { - if (retainMissing && !NullHandling.isNullOrEquivalent(replaceMissing)) { + if (retainMissing && replaceMissing != null) { // skip return; } @@ -146,12 +145,12 @@ public void testSimpleSerDe() throws IOException @Test(expected = IllegalArgumentException.class) public void testIllegalArgs() { - if (retainMissing && !NullHandling.isNullOrEquivalent(replaceMissing)) { + if (retainMissing && replaceMissing != null) { @SuppressWarnings("unused") // expected exception final LookupExtractionFn lookupExtractionFn = new LookupExtractionFn( new MapLookupExtractor(ImmutableMap.of("foo", "bar"), false), retainMissing, - NullHandling.emptyToNullIfNeeded(replaceMissing), + replaceMissing, injective, false ); @@ -163,7 +162,7 @@ public void testIllegalArgs() @Test public void testCacheKey() { - if (retainMissing && !NullHandling.isNullOrEquivalent(replaceMissing)) { + if (retainMissing && replaceMissing != null) { // skip return; } @@ -178,7 +177,7 @@ public void testCacheKey() false ); - if (NullHandling.isNullOrEquivalent(replaceMissing) || retainMissing) { + if (replaceMissing == null || retainMissing) { Assert.assertFalse( Arrays.equals( lookupExtractionFn.getCacheKey(), diff --git a/processing/src/test/java/org/apache/druid/query/metadata/SegmentMetadataQueryTest.java b/processing/src/test/java/org/apache/druid/query/metadata/SegmentMetadataQueryTest.java index 1abe8ec08c29..1ffdca6c0843 100644 --- a/processing/src/test/java/org/apache/druid/query/metadata/SegmentMetadataQueryTest.java +++ b/processing/src/test/java/org/apache/druid/query/metadata/SegmentMetadataQueryTest.java @@ -25,7 +25,6 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.impl.TimestampSpec; import org.apache.druid.error.DruidException; import org.apache.druid.error.DruidExceptionMatcher; @@ -345,8 +344,8 @@ public void testSegmentMetadataQueryWithRollupMerge() false, 0, 0, - NullHandling.defaultStringValue(), - NullHandling.defaultStringValue(), + null, + null, null ), "placementish", @@ -357,8 +356,8 @@ public void testSegmentMetadataQueryWithRollupMerge() false, 0, 0, - NullHandling.defaultStringValue(), - NullHandling.defaultStringValue(), + null, + null, null ) ) @@ -419,8 +418,8 @@ public void testSegmentMetadataQueryWithHasMultipleValuesMerge() false, 0, 1, - NullHandling.defaultStringValue(), - NullHandling.defaultStringValue(), + null, + null, null ), "placementish", @@ -431,8 +430,8 @@ public void testSegmentMetadataQueryWithHasMultipleValuesMerge() false, 0, 9, - NullHandling.defaultStringValue(), - NullHandling.defaultStringValue(), + null, + null, null ) ) @@ -493,8 +492,8 @@ public void testSegmentMetadataQueryWithComplexColumnMerge() false, 0, 1, - NullHandling.defaultStringValue(), - NullHandling.defaultStringValue(), + null, + null, null ), "quality_uniques", @@ -707,8 +706,8 @@ public void testSegmentMetadataQueryWithNoAnalysisTypesMerge() false, 0, 0, - NullHandling.defaultStringValue(), - NullHandling.defaultStringValue(), + null, + null, null ) ) @@ -773,8 +772,8 @@ public void testSegmentMetadataQueryWithAggregatorsMerge() false, 0, 0, - NullHandling.defaultStringValue(), - NullHandling.defaultStringValue(), + null, + null, null ) ) @@ -839,8 +838,8 @@ public void testSegmentMetadataQueryWithAggregatorsMergeLenientStrategy() false, 0, 0, - NullHandling.defaultStringValue(), - NullHandling.defaultStringValue(), + null, + null, null ) ) @@ -902,8 +901,8 @@ public void testSegmentMetadataQueryWithTimestampSpecMerge() false, 0, 0, - NullHandling.defaultStringValue(), - NullHandling.defaultStringValue(), + null, + null, null ) ) @@ -964,8 +963,8 @@ public void testSegmentMetadataQueryWithQueryGranularityMerge() false, 0, 0, - NullHandling.defaultStringValue(), - NullHandling.defaultStringValue(), + null, + null, null ) ) @@ -1480,7 +1479,7 @@ public void testLongNullableColumn() ColumnType.LONG, ValueType.LONG.toString(), false, - NullHandling.replaceWithDefault() ? false : true, + true, 19344, null, null, @@ -1497,7 +1496,7 @@ public void testDoubleNullableColumn() ColumnType.DOUBLE, ValueType.DOUBLE.toString(), false, - NullHandling.replaceWithDefault() ? false : true, + true, 19344, null, null, @@ -1515,7 +1514,7 @@ public void testFloatNullableColumn() ColumnType.FLOAT, ValueType.FLOAT.toString(), false, - NullHandling.replaceWithDefault() ? false : true, + true, 19344, null, null, @@ -1535,8 +1534,8 @@ public void testStringNullOnlyColumn() true, 0, 1, - NullHandling.defaultStringValue(), - NullHandling.defaultStringValue(), + null, + null, null ); testSegmentMetadataQueryWithDefaultAnalysisMerge("null_column", analysis); diff --git a/processing/src/test/java/org/apache/druid/query/operator/ScanOperatorFactoryTest.java b/processing/src/test/java/org/apache/druid/query/operator/ScanOperatorFactoryTest.java index ca2eca8d3042..7e5fdc0e414d 100644 --- a/processing/src/test/java/org/apache/druid/query/operator/ScanOperatorFactoryTest.java +++ b/processing/src/test/java/org/apache/druid/query/operator/ScanOperatorFactoryTest.java @@ -24,7 +24,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableSet; import nl.jqno.equalsverifier.EqualsVerifier; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.StringUtils; @@ -52,10 +51,6 @@ @SuppressWarnings("unchecked") public class ScanOperatorFactoryTest { - static { - NullHandling.initializeForTests(); - } - @Test public void testEquals() { diff --git a/processing/src/test/java/org/apache/druid/query/operator/window/WindowFramedAggregateProcessorTest.java b/processing/src/test/java/org/apache/druid/query/operator/window/WindowFramedAggregateProcessorTest.java index 9bae78bc2ccf..86d6aa9cd9d5 100644 --- a/processing/src/test/java/org/apache/druid/query/operator/window/WindowFramedAggregateProcessorTest.java +++ b/processing/src/test/java/org/apache/druid/query/operator/window/WindowFramedAggregateProcessorTest.java @@ -22,7 +22,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import nl.jqno.equalsverifier.EqualsVerifier; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.aggregation.AggregatorFactory; import org.apache.druid.query.aggregation.DoubleSumAggregatorFactory; import org.apache.druid.query.aggregation.LongMaxAggregatorFactory; @@ -39,10 +38,6 @@ @SuppressWarnings("unchecked") public class WindowFramedAggregateProcessorTest { - static { - NullHandling.initializeForTests(); - } - @Test public void testIsPassThruWhenRACReturnsSemanticInterface() { diff --git a/processing/src/test/java/org/apache/druid/query/rowsandcols/RowsAndColumnsTestBase.java b/processing/src/test/java/org/apache/druid/query/rowsandcols/RowsAndColumnsTestBase.java index 2973df31ab58..439c78cddb09 100644 --- a/processing/src/test/java/org/apache/druid/query/rowsandcols/RowsAndColumnsTestBase.java +++ b/processing/src/test/java/org/apache/druid/query/rowsandcols/RowsAndColumnsTestBase.java @@ -20,7 +20,6 @@ package org.apache.druid.query.rowsandcols; import com.google.common.collect.Lists; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.ISE; import org.apache.druid.query.rowsandcols.concrete.ColumnBasedFrameRowsAndColumns; import org.apache.druid.query.rowsandcols.concrete.ColumnBasedFrameRowsAndColumnsTest; @@ -52,10 +51,6 @@ */ public abstract class RowsAndColumnsTestBase { - static { - NullHandling.initializeForTests(); - } - private final Class expectedClass; private static final AtomicReference> MAKERS = new AtomicReference<>(); diff --git a/processing/src/test/java/org/apache/druid/query/rowsandcols/semantic/ClusteredGroupPartitionerTest.java b/processing/src/test/java/org/apache/druid/query/rowsandcols/semantic/ClusteredGroupPartitionerTest.java index dd62fcb04c73..aeaf91f95f7b 100644 --- a/processing/src/test/java/org/apache/druid/query/rowsandcols/semantic/ClusteredGroupPartitionerTest.java +++ b/processing/src/test/java/org/apache/druid/query/rowsandcols/semantic/ClusteredGroupPartitionerTest.java @@ -20,7 +20,6 @@ package org.apache.druid.query.rowsandcols.semantic; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.operator.window.RowsAndColumnsHelper; import org.apache.druid.query.rowsandcols.MapOfColumnsRowsAndColumns; import org.apache.druid.query.rowsandcols.RowsAndColumns; @@ -37,8 +36,6 @@ import java.util.function.BiFunction; import java.util.function.Function; -import static org.junit.Assume.assumeTrue; - public class ClusteredGroupPartitionerTest extends SemanticTestBase { public ClusteredGroupPartitionerTest( @@ -135,8 +132,6 @@ public void testDefaultClusteredGroupPartitioner() @Test public void testDefaultClusteredGroupPartitionerWithNulls() { - assumeTrue("testcase only enabled in sqlCompatible mode", NullHandling.sqlCompatible()); - RowsAndColumns rac = make(MapOfColumnsRowsAndColumns.fromMap( ImmutableMap.of( "sorted", new ObjectArrayColumn(new Object[]{null, null, null, 1, 1, 2, 4, 4, 4}, ColumnType.LONG), diff --git a/processing/src/test/java/org/apache/druid/query/rowsandcols/semantic/SemanticTestBase.java b/processing/src/test/java/org/apache/druid/query/rowsandcols/semantic/SemanticTestBase.java index d1431e5f973c..d1d00595a16f 100644 --- a/processing/src/test/java/org/apache/druid/query/rowsandcols/semantic/SemanticTestBase.java +++ b/processing/src/test/java/org/apache/druid/query/rowsandcols/semantic/SemanticTestBase.java @@ -20,7 +20,6 @@ package org.apache.druid.query.rowsandcols.semantic; import com.google.common.collect.FluentIterable; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.RE; import org.apache.druid.query.rowsandcols.MapOfColumnsRowsAndColumns; import org.apache.druid.query.rowsandcols.NoAsRowsAndColumns; @@ -41,10 +40,6 @@ @RunWith(Parameterized.class) public abstract class SemanticTestBase { - static { - NullHandling.initializeForTests(); - } - @Parameterized.Parameters(name = "{0}") public static Iterable parameterFeed() { diff --git a/processing/src/test/java/org/apache/druid/query/scan/NestedDataScanQueryTest.java b/processing/src/test/java/org/apache/druid/query/scan/NestedDataScanQueryTest.java index ba1c1c5b9486..81a747c745ca 100644 --- a/processing/src/test/java/org/apache/druid/query/scan/NestedDataScanQueryTest.java +++ b/processing/src/test/java/org/apache/druid/query/scan/NestedDataScanQueryTest.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.databind.Module; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.impl.DimensionsSpec; import org.apache.druid.guice.BuiltInTypesModule; import org.apache.druid.java.util.common.Intervals; @@ -193,9 +192,7 @@ public void testIngestAndScanSegmentsRealtime() throws Exception logResults(resultsRealtime); Assert.assertEquals(1, resultsRealtime.size()); Assert.assertEquals(resultsRealtime.size(), resultsSegments.size()); - if (NullHandling.sqlCompatible()) { - Assert.assertEquals(resultsSegments.get(0).getEvents().toString(), resultsRealtime.get(0).getEvents().toString()); - } + Assert.assertEquals(resultsSegments.get(0).getEvents().toString(), resultsRealtime.get(0).getEvents().toString()); } @Test @@ -782,17 +779,10 @@ public void testIngestAndScanSegmentsRealtimeSchemaDiscoveryTypeGauntlet() throw logResults(resultsRealtime); Assert.assertEquals(1, resultsRealtime.size()); Assert.assertEquals(resultsRealtime.size(), resultsSegments.size()); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals( - "[[1672531200000, null, 0, 0.0, 1, 51, -0.13, 1, [], [51, -35], {a=700, b={x=g, y=1.1, z=[9, null, 9, 9]}, v=[]}, {x=400, y=[{l=[null], m=100, n=5}, {l=[a, b, c], m=a, n=1}], z={}}, null, [a, b], null, [2, 3], null, [null], null, [1, 0, 1], null, [{x=1}, {x=2}], null, hello, 1234, 1.234, {x=1, y=hello, z={a=1.1, b=1234, c=[a, b, c], d=[]}}, [a, b, c], [1, 2, 3], [1.1, 2.2, 3.3], [], {}, [null, null], [{}, {}, {}], [{a=b, x=1, y=1.3}], 1], [1672531200000, null, 2, 0.0, 0, b, 1.1, b, 2, b, {a=200, b={x=b, y=1.1, z=[2, 4, 6]}, v=[]}, {x=10, y=[{l=[b, b, c], m=b, n=2}, [1, 2, 3]], z={a=[5.5], b=false}}, [a, b, c], [null, b], [2, 3], null, [3.3, 4.4, 5.5], [999.0, null, 5.5], [null, null, 2.2], [1, 1], [null, [null], []], [{x=3}, {x=4}], null, hello, 1234, 1.234, {x=1, y=hello, z={a=1.1, b=1234, c=[a, b, c], d=[]}}, [a, b, c], [1, 2, 3], [1.1, 2.2, 3.3], [], {}, [null, null], [{}, {}, {}], [{a=b, x=1, y=1.3}], 1], [1672531200000, a, 1, 1.0, 1, 1, 1, 1, 1, 1, {a=100, b={x=a, y=1.1, z=[1, 2, 3, 4]}, v=[]}, {x=1234, y=[{l=[a, b, c], m=a, n=1}, {l=[a, b, c], m=a, n=1}], z={a=[1.1, 2.2, 3.3], b=true}}, [a, b], [a, b], [1, 2, 3], [1, null, 3], [1.1, 2.2, 3.3], [1.1, 2.2, null], [a, 1, 2.2], [1, 0, 1], [[1, 2, null], [3, 4]], [{x=1}, {x=2}], null, hello, 1234, 1.234, {x=1, y=hello, z={a=1.1, b=1234, c=[a, b, c], d=[]}}, [a, b, c], [1, 2, 3], [1.1, 2.2, 3.3], [], {}, [null, null], [{}, {}, {}], [{a=b, x=1, y=1.3}], 1], [1672531200000, b, 4, 3.3, 1, 1, 0.0, {}, 4, 1, {a=400, b={x=d, y=1.1, z=[3, 4]}, v=[]}, {x=1234, z={a=[1.1, 2.2, 3.3], b=true}}, [d, e], [b, b], [1, 4], [1], [2.2, 3.3, 4.0], null, [a, b, c], [null, 0, 1], [[1, 2], [3, 4], [5, 6, 7]], [{x=null}, {x=2}], null, hello, 1234, 1.234, {x=1, y=hello, z={a=1.1, b=1234, c=[a, b, c], d=[]}}, [a, b, c], [1, 2, 3], [1.1, 2.2, 3.3], [], {}, [null, null], [{}, {}, {}], [{a=b, x=1, y=1.3}], 1], [1672531200000, c, 0, 4.4, 1, hello, -1000, {}, [], hello, {a=500, b={x=e, z=[1, 2, 3, 4]}, v=a}, {x=11, y=[], z={a=[null], b=false}}, null, null, [1, 2, 3], [], [1.1, 2.2, 3.3], null, null, [0], null, [{x=1000}, {y=2000}], null, hello, 1234, 1.234, {x=1, y=hello, z={a=1.1, b=1234, c=[a, b, c], d=[]}}, [a, b, c], [1, 2, 3], [1.1, 2.2, 3.3], [], {}, [null, null], [{}, {}, {}], [{a=b, x=1, y=1.3}], 1], [1672531200000, d, 5, 5.9, 0, null, 3.33, a, 6, null, {a=600, b={x=f, y=1.1, z=[6, 7, 8, 9]}, v=b}, null, [a, b], null, null, [null, 2, 9], null, [999.0, 5.5, null], [a, 1, 2.2], [], [[1], [1, 2, null]], [{a=1}, {b=2}], null, hello, 1234, 1.234, {x=1, y=hello, z={a=1.1, b=1234, c=[a, b, c], d=[]}}, [a, b, c], [1, 2, 3], [1.1, 2.2, 3.3], [], {}, [null, null], [{}, {}, {}], [{a=b, x=1, y=1.3}], 1], [1672531200000, null, 3, 2.0, 0, 3.0, 1.0, 3.3, 3, 3.0, {a=300}, {x=4.4, y=[{l=[], m=100, n=3}, {l=[a]}, {l=[b], n=[]}], z={a=[], b=true}}, [b, c], [d, null, b], [1, 2, 3, 4], [1, 2, 3], [1.1, 3.3], [null, 2.2, null], [1, null, 1], [1, null, 1], [[1], null, [1, 2, 3]], [null, {x=2}], null, hello, 1234, 1.234, {x=1, y=hello, z={a=1.1, b=1234, c=[a, b, c], d=[]}}, [a, b, c], [1, 2, 3], [1.1, 2.2, 3.3], [], {}, [null, null], [{}, {}, {}], [{a=b, x=1, y=1.3}], 1]]", - resultsSegments.get(0).getEvents().toString() - ); - } else { - Assert.assertEquals( - "[[1672531200000, null, null, null, 1, 51, -0.13, 1, [], [51, -35], {a=700, b={x=g, y=1.1, z=[9, null, 9, 9]}, v=[]}, {x=400, y=[{l=[null], m=100, n=5}, {l=[a, b, c], m=a, n=1}], z={}}, null, [a, b], null, [2, 3], null, [null], null, [1, 0, 1], null, [{x=1}, {x=2}], null, hello, 1234, 1.234, {x=1, y=hello, z={a=1.1, b=1234, c=[a, b, c], d=[]}}, [a, b, c], [1, 2, 3], [1.1, 2.2, 3.3], [], {}, [null, null], [{}, {}, {}], [{a=b, x=1, y=1.3}], 1], [1672531200000, , 2, null, 0, b, 1.1, b, 2, b, {a=200, b={x=b, y=1.1, z=[2, 4, 6]}, v=[]}, {x=10, y=[{l=[b, b, c], m=b, n=2}, [1, 2, 3]], z={a=[5.5], b=false}}, [a, b, c], [null, b], [2, 3], null, [3.3, 4.4, 5.5], [999.0, null, 5.5], [null, null, 2.2], [1, 1], [null, [null], []], [{x=3}, {x=4}], null, hello, 1234, 1.234, {x=1, y=hello, z={a=1.1, b=1234, c=[a, b, c], d=[]}}, [a, b, c], [1, 2, 3], [1.1, 2.2, 3.3], [], {}, [null, null], [{}, {}, {}], [{a=b, x=1, y=1.3}], 1], [1672531200000, a, 1, 1.0, 1, 1, 1, 1, 1, 1, {a=100, b={x=a, y=1.1, z=[1, 2, 3, 4]}, v=[]}, {x=1234, y=[{l=[a, b, c], m=a, n=1}, {l=[a, b, c], m=a, n=1}], z={a=[1.1, 2.2, 3.3], b=true}}, [a, b], [a, b], [1, 2, 3], [1, null, 3], [1.1, 2.2, 3.3], [1.1, 2.2, null], [a, 1, 2.2], [1, 0, 1], [[1, 2, null], [3, 4]], [{x=1}, {x=2}], null, hello, 1234, 1.234, {x=1, y=hello, z={a=1.1, b=1234, c=[a, b, c], d=[]}}, [a, b, c], [1, 2, 3], [1.1, 2.2, 3.3], [], {}, [null, null], [{}, {}, {}], [{a=b, x=1, y=1.3}], 1], [1672531200000, b, 4, 3.3, 1, 1, null, {}, 4, 1, {a=400, b={x=d, y=1.1, z=[3, 4]}, v=[]}, {x=1234, z={a=[1.1, 2.2, 3.3], b=true}}, [d, e], [b, b], [1, 4], [1], [2.2, 3.3, 4.0], null, [a, b, c], [null, 0, 1], [[1, 2], [3, 4], [5, 6, 7]], [{x=null}, {x=2}], null, hello, 1234, 1.234, {x=1, y=hello, z={a=1.1, b=1234, c=[a, b, c], d=[]}}, [a, b, c], [1, 2, 3], [1.1, 2.2, 3.3], [], {}, [null, null], [{}, {}, {}], [{a=b, x=1, y=1.3}], 1], [1672531200000, c, null, 4.4, 1, hello, -1000, {}, [], hello, {a=500, b={x=e, z=[1, 2, 3, 4]}, v=a}, {x=11, y=[], z={a=[null], b=false}}, null, null, [1, 2, 3], [], [1.1, 2.2, 3.3], null, null, [0], null, [{x=1000}, {y=2000}], null, hello, 1234, 1.234, {x=1, y=hello, z={a=1.1, b=1234, c=[a, b, c], d=[]}}, [a, b, c], [1, 2, 3], [1.1, 2.2, 3.3], [], {}, [null, null], [{}, {}, {}], [{a=b, x=1, y=1.3}], 1], [1672531200000, d, 5, 5.9, 0, null, 3.33, a, 6, null, {a=600, b={x=f, y=1.1, z=[6, 7, 8, 9]}, v=b}, null, [a, b], null, null, [null, 2, 9], null, [999.0, 5.5, null], [a, 1, 2.2], [], [[1], [1, 2, null]], [{a=1}, {b=2}], null, hello, 1234, 1.234, {x=1, y=hello, z={a=1.1, b=1234, c=[a, b, c], d=[]}}, [a, b, c], [1, 2, 3], [1.1, 2.2, 3.3], [], {}, [null, null], [{}, {}, {}], [{a=b, x=1, y=1.3}], 1], [1672531200000, null, 3, 2.0, null, 3.0, 1.0, 3.3, 3, 3.0, {a=300}, {x=4.4, y=[{l=[], m=100, n=3}, {l=[a]}, {l=[b], n=[]}], z={a=[], b=true}}, [b, c], [d, null, b], [1, 2, 3, 4], [1, 2, 3], [1.1, 3.3], [null, 2.2, null], [1, null, 1], [1, null, 1], [[1], null, [1, 2, 3]], [null, {x=2}], null, hello, 1234, 1.234, {x=1, y=hello, z={a=1.1, b=1234, c=[a, b, c], d=[]}}, [a, b, c], [1, 2, 3], [1.1, 2.2, 3.3], [], {}, [null, null], [{}, {}, {}], [{a=b, x=1, y=1.3}], 1]]", - resultsSegments.get(0).getEvents().toString() - ); - } + Assert.assertEquals( + "[[1672531200000, null, null, null, 1, 51, -0.13, 1, [], [51, -35], {a=700, b={x=g, y=1.1, z=[9, null, 9, 9]}, v=[]}, {x=400, y=[{l=[null], m=100, n=5}, {l=[a, b, c], m=a, n=1}], z={}}, null, [a, b], null, [2, 3], null, [null], null, [1, 0, 1], null, [{x=1}, {x=2}], null, hello, 1234, 1.234, {x=1, y=hello, z={a=1.1, b=1234, c=[a, b, c], d=[]}}, [a, b, c], [1, 2, 3], [1.1, 2.2, 3.3], [], {}, [null, null], [{}, {}, {}], [{a=b, x=1, y=1.3}], 1], [1672531200000, , 2, null, 0, b, 1.1, b, 2, b, {a=200, b={x=b, y=1.1, z=[2, 4, 6]}, v=[]}, {x=10, y=[{l=[b, b, c], m=b, n=2}, [1, 2, 3]], z={a=[5.5], b=false}}, [a, b, c], [null, b], [2, 3], null, [3.3, 4.4, 5.5], [999.0, null, 5.5], [null, null, 2.2], [1, 1], [null, [null], []], [{x=3}, {x=4}], null, hello, 1234, 1.234, {x=1, y=hello, z={a=1.1, b=1234, c=[a, b, c], d=[]}}, [a, b, c], [1, 2, 3], [1.1, 2.2, 3.3], [], {}, [null, null], [{}, {}, {}], [{a=b, x=1, y=1.3}], 1], [1672531200000, a, 1, 1.0, 1, 1, 1, 1, 1, 1, {a=100, b={x=a, y=1.1, z=[1, 2, 3, 4]}, v=[]}, {x=1234, y=[{l=[a, b, c], m=a, n=1}, {l=[a, b, c], m=a, n=1}], z={a=[1.1, 2.2, 3.3], b=true}}, [a, b], [a, b], [1, 2, 3], [1, null, 3], [1.1, 2.2, 3.3], [1.1, 2.2, null], [a, 1, 2.2], [1, 0, 1], [[1, 2, null], [3, 4]], [{x=1}, {x=2}], null, hello, 1234, 1.234, {x=1, y=hello, z={a=1.1, b=1234, c=[a, b, c], d=[]}}, [a, b, c], [1, 2, 3], [1.1, 2.2, 3.3], [], {}, [null, null], [{}, {}, {}], [{a=b, x=1, y=1.3}], 1], [1672531200000, b, 4, 3.3, 1, 1, null, {}, 4, 1, {a=400, b={x=d, y=1.1, z=[3, 4]}, v=[]}, {x=1234, z={a=[1.1, 2.2, 3.3], b=true}}, [d, e], [b, b], [1, 4], [1], [2.2, 3.3, 4.0], null, [a, b, c], [null, 0, 1], [[1, 2], [3, 4], [5, 6, 7]], [{x=null}, {x=2}], null, hello, 1234, 1.234, {x=1, y=hello, z={a=1.1, b=1234, c=[a, b, c], d=[]}}, [a, b, c], [1, 2, 3], [1.1, 2.2, 3.3], [], {}, [null, null], [{}, {}, {}], [{a=b, x=1, y=1.3}], 1], [1672531200000, c, null, 4.4, 1, hello, -1000, {}, [], hello, {a=500, b={x=e, z=[1, 2, 3, 4]}, v=a}, {x=11, y=[], z={a=[null], b=false}}, null, null, [1, 2, 3], [], [1.1, 2.2, 3.3], null, null, [0], null, [{x=1000}, {y=2000}], null, hello, 1234, 1.234, {x=1, y=hello, z={a=1.1, b=1234, c=[a, b, c], d=[]}}, [a, b, c], [1, 2, 3], [1.1, 2.2, 3.3], [], {}, [null, null], [{}, {}, {}], [{a=b, x=1, y=1.3}], 1], [1672531200000, d, 5, 5.9, 0, null, 3.33, a, 6, null, {a=600, b={x=f, y=1.1, z=[6, 7, 8, 9]}, v=b}, null, [a, b], null, null, [null, 2, 9], null, [999.0, 5.5, null], [a, 1, 2.2], [], [[1], [1, 2, null]], [{a=1}, {b=2}], null, hello, 1234, 1.234, {x=1, y=hello, z={a=1.1, b=1234, c=[a, b, c], d=[]}}, [a, b, c], [1, 2, 3], [1.1, 2.2, 3.3], [], {}, [null, null], [{}, {}, {}], [{a=b, x=1, y=1.3}], 1], [1672531200000, null, 3, 2.0, null, 3.0, 1.0, 3.3, 3, 3.0, {a=300}, {x=4.4, y=[{l=[], m=100, n=3}, {l=[a]}, {l=[b], n=[]}], z={a=[], b=true}}, [b, c], [d, null, b], [1, 2, 3, 4], [1, 2, 3], [1.1, 3.3], [null, 2.2, null], [1, null, 1], [1, null, 1], [[1], null, [1, 2, 3]], [null, {x=2}], null, hello, 1234, 1.234, {x=1, y=hello, z={a=1.1, b=1234, c=[a, b, c], d=[]}}, [a, b, c], [1, 2, 3], [1.1, 2.2, 3.3], [], {}, [null, null], [{}, {}, {}], [{a=b, x=1, y=1.3}], 1]]", + resultsSegments.get(0).getEvents().toString() + ); Assert.assertEquals(resultsSegments.get(0).getEvents().toString(), resultsRealtime.get(0).getEvents().toString()); } @@ -966,17 +956,10 @@ public void testIngestAndScanSegmentsNestedColumnNotNullFilter() throws Exceptio logResults(resultsRealtime); Assert.assertEquals(1, resultsRealtime.size()); Assert.assertEquals(resultsRealtime.size(), resultsSegments.size()); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals( - "[[{x=400, y=[{l=[null], m=100, n=5}, {l=[a, b, c], m=a, n=1}], z={}}], [{x=10, y=[{l=[b, b, c], m=b, n=2}, [1, 2, 3]], z={a=[5.5], b=false}}], [{x=1234, y=[{l=[a, b, c], m=a, n=1}, {l=[a, b, c], m=a, n=1}], z={a=[1.1, 2.2, 3.3], b=true}}], [{x=1234, z={a=[1.1, 2.2, 3.3], b=true}}], [{x=11, y=[], z={a=[null], b=false}}], [{x=4.4, y=[{l=[], m=100, n=3}, {l=[a]}, {l=[b], n=[]}], z={a=[], b=true}}]]", - resultsSegments.get(0).getEvents().toString() - ); - } else { - Assert.assertEquals( - "[[{x=400, y=[{l=[null], m=100, n=5}, {l=[a, b, c], m=a, n=1}], z={}}], [{x=10, y=[{l=[b, b, c], m=b, n=2}, [1, 2, 3]], z={a=[5.5], b=false}}], [{x=1234, y=[{l=[a, b, c], m=a, n=1}, {l=[a, b, c], m=a, n=1}], z={a=[1.1, 2.2, 3.3], b=true}}], [{x=1234, z={a=[1.1, 2.2, 3.3], b=true}}], [{x=11, y=[], z={a=[null], b=false}}], [{x=4.4, y=[{l=[], m=100, n=3}, {l=[a]}, {l=[b], n=[]}], z={a=[], b=true}}]]", - resultsSegments.get(0).getEvents().toString() - ); - } + Assert.assertEquals( + "[[{x=400, y=[{l=[null], m=100, n=5}, {l=[a, b, c], m=a, n=1}], z={}}], [{x=10, y=[{l=[b, b, c], m=b, n=2}, [1, 2, 3]], z={a=[5.5], b=false}}], [{x=1234, y=[{l=[a, b, c], m=a, n=1}, {l=[a, b, c], m=a, n=1}], z={a=[1.1, 2.2, 3.3], b=true}}], [{x=1234, z={a=[1.1, 2.2, 3.3], b=true}}], [{x=11, y=[], z={a=[null], b=false}}], [{x=4.4, y=[{l=[], m=100, n=3}, {l=[a]}, {l=[b], n=[]}], z={a=[], b=true}}]]", + resultsSegments.get(0).getEvents().toString() + ); Assert.assertEquals(resultsSegments.get(0).getEvents().toString(), resultsRealtime.get(0).getEvents().toString()); } diff --git a/processing/src/test/java/org/apache/druid/query/scan/ScanQueryQueryToolChestTest.java b/processing/src/test/java/org/apache/druid/query/scan/ScanQueryQueryToolChestTest.java index 2e2158f866ab..ac782332d696 100644 --- a/processing/src/test/java/org/apache/druid/query/scan/ScanQueryQueryToolChestTest.java +++ b/processing/src/test/java/org/apache/druid/query/scan/ScanQueryQueryToolChestTest.java @@ -20,7 +20,6 @@ package org.apache.druid.query.scan; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.frame.allocation.HeapMemoryAllocator; import org.apache.druid.frame.allocation.SingleMemoryAllocatorFactory; import org.apache.druid.java.util.common.ISE; @@ -51,7 +50,6 @@ public class ScanQueryQueryToolChestTest { static { - NullHandling.initializeForTests(); ComplexMetrics.registerSerde(NestedDataComplexTypeSerde.TYPE_NAME, NestedDataComplexTypeSerde.INSTANCE); } diff --git a/processing/src/test/java/org/apache/druid/query/scan/ScanQueryRunnerTest.java b/processing/src/test/java/org/apache/druid/query/scan/ScanQueryRunnerTest.java index 365fdbb465d1..b19312384ad1 100644 --- a/processing/src/test/java/org/apache/druid/query/scan/ScanQueryRunnerTest.java +++ b/processing/src/test/java/org/apache/druid/query/scan/ScanQueryRunnerTest.java @@ -30,7 +30,6 @@ import com.google.common.io.CharSource; import com.google.common.io.LineProcessor; import org.apache.commons.lang3.ArrayUtils; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.hll.HyperLogLogCollector; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.ISE; @@ -992,7 +991,7 @@ public static List>> toEvents(final String[] dimSpecs, eventVal = DateTimes.of(values1[i]).getMillis(); } else if (specs[1].equals("FLOAT")) { try { - eventVal = values1[i].isEmpty() ? NullHandling.defaultFloatValue() : Float.valueOf(values1[i]); + eventVal = values1[i].isEmpty() ? null : Float.valueOf(values1[i]); } catch (NumberFormatException nfe) { throw new ISE("This object cannot be converted to a Float!"); @@ -1000,7 +999,7 @@ public static List>> toEvents(final String[] dimSpecs, } else if (specs[1].equals("DOUBLE")) { try { eventVal = values1[i].isEmpty() - ? NullHandling.defaultDoubleValue() + ? null : Double.valueOf(values1[i]); } catch (NumberFormatException nfe) { @@ -1008,7 +1007,7 @@ public static List>> toEvents(final String[] dimSpecs, } } else if (specs[1].equals("LONG")) { try { - eventVal = values1[i].isEmpty() ? NullHandling.defaultLongValue() : Long.valueOf(values1[i]); + eventVal = values1[i].isEmpty() ? null : Long.valueOf(values1[i]); } catch (NumberFormatException nfe) { throw new ISE("This object cannot be converted to a Long!"); diff --git a/processing/src/test/java/org/apache/druid/query/search/SearchQueryRunnerTest.java b/processing/src/test/java/org/apache/druid/query/search/SearchQueryRunnerTest.java index b38283662c02..fa8fb02ffcb5 100644 --- a/processing/src/test/java/org/apache/druid/query/search/SearchQueryRunnerTest.java +++ b/processing/src/test/java/org/apache/druid/query/search/SearchQueryRunnerTest.java @@ -22,7 +22,6 @@ import com.google.common.base.Suppliers; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.MapBasedInputRow; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.Intervals; @@ -770,7 +769,7 @@ public void testSearchWithNullValueInDimension() throws Exception ); List expectedHits = new ArrayList<>(); expectedHits.add(new SearchHit("table", "table", 1)); - expectedHits.add(new SearchHit("table", NullHandling.defaultStringValue(), 1)); + expectedHits.add(new SearchHit("table", null, 1)); checkSearchQuery(searchQuery, runner, expectedHits); } diff --git a/processing/src/test/java/org/apache/druid/query/timeseries/NestedDataTimeseriesQueryTest.java b/processing/src/test/java/org/apache/druid/query/timeseries/NestedDataTimeseriesQueryTest.java index c99b1f0fb08f..2ecb36279682 100644 --- a/processing/src/test/java/org/apache/druid/query/timeseries/NestedDataTimeseriesQueryTest.java +++ b/processing/src/test/java/org/apache/druid/query/timeseries/NestedDataTimeseriesQueryTest.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.guice.BuiltInTypesModule; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.Intervals; @@ -281,7 +280,7 @@ public void testFilterLong() new Result<>( DateTimes.of("2023-01-01T00:00:00.000Z"), new TimeseriesResultValue( - ImmutableMap.of("count", NullHandling.replaceWithDefault() ? 6L : 8L) + ImmutableMap.of("count", 8L) ) ) ) diff --git a/processing/src/test/java/org/apache/druid/query/timeseries/TimeseriesQueryQueryToolChestTest.java b/processing/src/test/java/org/apache/druid/query/timeseries/TimeseriesQueryQueryToolChestTest.java index 8d9166d27467..f5e46f04c008 100644 --- a/processing/src/test/java/org/apache/druid/query/timeseries/TimeseriesQueryQueryToolChestTest.java +++ b/processing/src/test/java/org/apache/druid/query/timeseries/TimeseriesQueryQueryToolChestTest.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.granularity.Granularities; @@ -46,7 +45,6 @@ import org.apache.druid.segment.column.ColumnType; import org.apache.druid.segment.column.RowSignature; import org.junit.Assert; -import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -59,12 +57,6 @@ public class TimeseriesQueryQueryToolChestTest private static final String TIMESTAMP_RESULT_FIELD_NAME = "d0"; private static final TimeseriesQueryQueryToolChest TOOL_CHEST = new TimeseriesQueryQueryToolChest(null); - @BeforeClass - public static void setUpClass() - { - NullHandling.initializeForTests(); - } - @Parameterized.Parameters(name = "descending={0}") public static Iterable constructorFeeder() { diff --git a/processing/src/test/java/org/apache/druid/query/timeseries/TimeseriesQueryRunnerTest.java b/processing/src/test/java/org/apache/druid/query/timeseries/TimeseriesQueryRunnerTest.java index a2a85b2fc6f8..d34f3fb84ce7 100644 --- a/processing/src/test/java/org/apache/druid/query/timeseries/TimeseriesQueryRunnerTest.java +++ b/processing/src/test/java/org/apache/druid/query/timeseries/TimeseriesQueryRunnerTest.java @@ -25,7 +25,6 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import com.google.common.primitives.Doubles; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.HumanReadableBytes; import org.apache.druid.java.util.common.Intervals; @@ -188,8 +187,8 @@ public void testEmptyTimeseries() .build(); Map resultMap = new HashMap<>(); resultMap.put("rows", 0L); - resultMap.put("index", NullHandling.defaultDoubleValue()); - resultMap.put("first", NullHandling.defaultDoubleValue()); + resultMap.put("index", null); + resultMap.put("first", null); List> expectedResults = ImmutableList.of( new Result<>( DateTimes.of("2020-04-02"), @@ -277,39 +276,19 @@ public void testFullOnTimeseries() 0.02 ); } else { - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals( - result.toString(), - 0.0D, - value.getDoubleMetric("index").doubleValue(), - value.getDoubleMetric("index").doubleValue() * 1e-6 - ); - Assert.assertEquals( - result.toString(), - new Double(expectedIndex[count]) + 1L, - value.getDoubleMetric("addRowsIndexConstant"), - value.getDoubleMetric("addRowsIndexConstant") * 1e-6 - ); - Assert.assertEquals( - 0.0D, - value.getDoubleMetric("uniques"), - 0.02 - ); - } else { - Assert.assertNull( - result.toString(), - value.getDoubleMetric("index") - ); - Assert.assertNull( - result.toString(), - value.getDoubleMetric("addRowsIndexConstant") - ); - Assert.assertEquals( - value.getDoubleMetric("uniques"), - 0.0d, - 0.02 - ); - } + Assert.assertNull( + result.toString(), + value.getDoubleMetric("index") + ); + Assert.assertNull( + result.toString(), + value.getDoubleMetric("addRowsIndexConstant") + ); + Assert.assertEquals( + value.getDoubleMetric("uniques"), + 0.0d, + 0.02 + ); } lastResult = result; @@ -654,21 +633,21 @@ public void testTimeseriesIntervalOutOfRanges() "rows", 0L, "index", - NullHandling.defaultLongValue(), + null, QueryRunnerTestHelper.ADD_ROWS_INDEX_CONSTANT_METRIC, - NullHandling.sqlCompatible() ? null : 1.0, + null, QueryRunnerTestHelper.LONG_MIN_INDEX_METRIC, - NullHandling.sqlCompatible() ? null : Long.MAX_VALUE, + null, QueryRunnerTestHelper.LONG_MAX_INDEX_METRIC, - NullHandling.sqlCompatible() ? null : Long.MIN_VALUE, + null, QueryRunnerTestHelper.DOUBLE_MIN_INDEX_METRIC, - NullHandling.sqlCompatible() ? null : Double.POSITIVE_INFINITY, + null, QueryRunnerTestHelper.DOUBLE_MAX_INDEX_METRIC, - NullHandling.sqlCompatible() ? null : Double.NEGATIVE_INFINITY, + null, QueryRunnerTestHelper.FLOAT_MIN_INDEX_METRIC, - NullHandling.sqlCompatible() ? null : Float.POSITIVE_INFINITY, + null, QueryRunnerTestHelper.FLOAT_MAX_INDEX_METRIC, - NullHandling.sqlCompatible() ? null : Float.NEGATIVE_INFINITY + null ) ) ) @@ -931,7 +910,7 @@ public void testTimeseriesQueryZeroFilling() ); Map noRowsResult = new HashMap<>(); noRowsResult.put("rows", 0L); - noRowsResult.put("idx", NullHandling.defaultLongValue()); + noRowsResult.put("idx", null); for (Interval interval : iterable) { lotsOfZeroes.add( new Result<>( @@ -1667,8 +1646,8 @@ public void testTimeseriesWithFilterOnNonExistentDimension() Map resultMap = new HashMap<>(); resultMap.put("rows", 0L); - resultMap.put("index", NullHandling.defaultDoubleValue()); - resultMap.put("addRowsIndexConstant", NullHandling.replaceWithDefault() ? 1.0 : null); + resultMap.put("index", null); + resultMap.put("addRowsIndexConstant", null); resultMap.put("uniques", 0.0); List> expectedResults = Arrays.asList( @@ -1770,48 +1749,20 @@ public void testTimeseriesWithInvertedFilterOnNonExistentDimension() .build(); - List> expectedResults; - if (NullHandling.sqlCompatible()) { - expectedResults = Arrays.asList( - new Result<>( - DateTimes.of("2011-04-01"), - new TimeseriesResultValue( - TestHelper.makeMap("rows", 0L, "index", null, "uniques", 0.0, "addRowsIndexConstant", null) - ) - ), - new Result<>( - DateTimes.of("2011-04-02"), - new TimeseriesResultValue( - TestHelper.makeMap("rows", 0L, "index", null, "uniques", 0.0, "addRowsIndexConstant", null) - ) - ) - ); - } else { - expectedResults = Arrays.asList( - new Result<>( - DateTimes.of("2011-04-01"), - new TimeseriesResultValue( - ImmutableMap.of( - "rows", 13L, - "index", 6626.151596069336, - "addRowsIndexConstant", 6640.151596069336, - "uniques", QueryRunnerTestHelper.UNIQUES_9 - ) - ) - ), - new Result<>( - DateTimes.of("2011-04-02"), - new TimeseriesResultValue( - ImmutableMap.of( - "rows", 13L, - "index", 5833.2095947265625, - "addRowsIndexConstant", 5847.2095947265625, - "uniques", QueryRunnerTestHelper.UNIQUES_9 - ) - ) - ) - ); - } + List> expectedResults = Arrays.asList( + new Result<>( + DateTimes.of("2011-04-01"), + new TimeseriesResultValue( + TestHelper.makeMap("rows", 0L, "index", null, "uniques", 0.0, "addRowsIndexConstant", null) + ) + ), + new Result<>( + DateTimes.of("2011-04-02"), + new TimeseriesResultValue( + TestHelper.makeMap("rows", 0L, "index", null, "uniques", 0.0, "addRowsIndexConstant", null) + ) + ) + ); Iterable> results = runner.run(QueryPlus.wrap(query)) .toList(); @@ -1833,8 +1784,8 @@ public void testTimeseriesWithNonExistentFilter() .build(); Map resultMap = new HashMap<>(); resultMap.put("rows", 0L); - resultMap.put("index", NullHandling.defaultDoubleValue()); - resultMap.put("addRowsIndexConstant", NullHandling.replaceWithDefault() ? 1.0 : null); + resultMap.put("index", null); + resultMap.put("addRowsIndexConstant", null); resultMap.put("uniques", 0.0); List> expectedResults = Arrays.asList( @@ -1875,8 +1826,8 @@ public void testTimeseriesWithNonExistentFilterAndMultiDim() .build(); Map resultMap = new HashMap<>(); resultMap.put("rows", 0L); - resultMap.put("index", NullHandling.defaultDoubleValue()); - resultMap.put("addRowsIndexConstant", NullHandling.replaceWithDefault() ? 1.0 : null); + resultMap.put("index", null); + resultMap.put("addRowsIndexConstant", null); resultMap.put("uniques", 0.0); List> expectedResults = Arrays.asList( @@ -2733,35 +2684,17 @@ public void testTimeseriesWithTimestampResultFieldContextForArrayResponse() (Double) result[5] * 1e-6 ); } else { - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals( - 0.0D, - (Double) result[3], - (Double) result[3] * 1e-6 - ); - Assert.assertEquals( - 0.0D, - (Double) result[4], - 0.02 - ); - Assert.assertEquals( - new Double(expectedIndexToUse[count]) + 1L, - (Double) result[5], - (Double) result[5] * 1e-6 - ); - } else { - Assert.assertNull( - result[3] - ); - Assert.assertEquals( - (Double) result[4], - 0.0, - 0.02 - ); - Assert.assertNull( - result[5] - ); - } + Assert.assertNull( + result[3] + ); + Assert.assertEquals( + (Double) result[4], + 0.0, + 0.02 + ); + Assert.assertNull( + result[5] + ); } lastResult = result; @@ -2853,39 +2786,19 @@ public void testTimeseriesWithTimestampResultFieldContextForMapResponse() 0.02 ); } else { - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals( - result.toString(), - 0.0D, - value.getDoubleMetric("index").doubleValue(), - value.getDoubleMetric("index").doubleValue() * 1e-6 - ); - Assert.assertEquals( - result.toString(), - new Double(expectedIndexToUse[count]) + 1L, - value.getDoubleMetric("addRowsIndexConstant"), - value.getDoubleMetric("addRowsIndexConstant") * 1e-6 - ); - Assert.assertEquals( - 0.0D, - value.getDoubleMetric("uniques"), - 0.02 - ); - } else { - Assert.assertNull( - result.toString(), - value.getDoubleMetric("index") - ); - Assert.assertNull( - result.toString(), - value.getDoubleMetric("addRowsIndexConstant") - ); - Assert.assertEquals( - value.getDoubleMetric("uniques"), - 0.0d, - 0.02 - ); - } + Assert.assertNull( + result.toString(), + value.getDoubleMetric("index") + ); + Assert.assertNull( + result.toString(), + value.getDoubleMetric("addRowsIndexConstant") + ); + Assert.assertEquals( + value.getDoubleMetric("uniques"), + 0.0d, + 0.02 + ); } lastResult = result; @@ -3246,7 +3159,7 @@ public void testTimeseriesCardinalityAggOnHyperUnique() "rows", 26L, "cardinality", - NullHandling.replaceWithDefault() ? 1.0002442201269182 : 0.0d, + 0.0d, "hyperUnique", 9.019833517963864d ) diff --git a/processing/src/test/java/org/apache/druid/query/topn/NestedDataTopNQueryTest.java b/processing/src/test/java/org/apache/druid/query/topn/NestedDataTopNQueryTest.java index cb3b5fbfc9a9..80af74d1f4c2 100644 --- a/processing/src/test/java/org/apache/druid/query/topn/NestedDataTopNQueryTest.java +++ b/processing/src/test/java/org/apache/druid/query/topn/NestedDataTopNQueryTest.java @@ -20,7 +20,6 @@ package org.apache.druid.query.topn; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.guice.BuiltInTypesModule; import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.StringUtils; @@ -157,7 +156,7 @@ public void testGroupBySomeFieldAggregateSomeField() verifyResults( results, ImmutableList.of( - new Object[]{1672531200000L, null, NullHandling.defaultDoubleValue()}, + new Object[]{1672531200000L, null, null}, new Object[]{1672531200000L, "100", 200.0}, new Object[]{1672531200000L, "200", 400.0}, new Object[]{1672531200000L, "300", 1200.0} diff --git a/processing/src/test/java/org/apache/druid/query/topn/TopNQueryQueryToolChestTest.java b/processing/src/test/java/org/apache/druid/query/topn/TopNQueryQueryToolChestTest.java index f53fc77cb216..b120bdeea4bc 100644 --- a/processing/src/test/java/org/apache/druid/query/topn/TopNQueryQueryToolChestTest.java +++ b/processing/src/test/java/org/apache/druid/query/topn/TopNQueryQueryToolChestTest.java @@ -24,7 +24,6 @@ import com.google.common.collect.ImmutableMap; import org.apache.druid.collections.CloseableStupidPool; import org.apache.druid.collections.SerializablePair; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.hll.HyperLogLogCollector; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.Intervals; @@ -70,7 +69,6 @@ import org.apache.druid.testing.InitializedNullHandlingTest; import org.apache.druid.timeline.SegmentId; import org.junit.Assert; -import org.junit.BeforeClass; import org.junit.Test; import java.io.IOException; @@ -85,12 +83,6 @@ public class TopNQueryQueryToolChestTest extends InitializedNullHandlingTest private static final SegmentId SEGMENT_ID = SegmentId.dummy("testSegment"); - @BeforeClass - public static void setUpClass() - { - NullHandling.initializeForTests(); - } - @Test public void testCacheStrategy() throws Exception { diff --git a/processing/src/test/java/org/apache/druid/query/topn/TopNQueryRunnerTest.java b/processing/src/test/java/org/apache/druid/query/topn/TopNQueryRunnerTest.java index c3a0982d3716..06e9a262b6ef 100644 --- a/processing/src/test/java/org/apache/druid/query/topn/TopNQueryRunnerTest.java +++ b/processing/src/test/java/org/apache/druid/query/topn/TopNQueryRunnerTest.java @@ -29,7 +29,6 @@ import com.google.common.primitives.Doubles; import com.google.common.primitives.Longs; import org.apache.druid.collections.CloseableStupidPool; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.IAE; import org.apache.druid.java.util.common.ISE; @@ -4150,13 +4149,7 @@ public void testTopNWithExtractionFilterAndFilteredAggregatorCaseNoExistingValue Map extractionMap = new HashMap<>(); MapLookupExtractor mapLookupExtractor = new MapLookupExtractor(extractionMap, false); - LookupExtractionFn lookupExtractionFn; - if (NullHandling.replaceWithDefault()) { - lookupExtractionFn = new LookupExtractionFn(mapLookupExtractor, false, null, true, false); - extractionMap.put("", "NULL"); - } else { - lookupExtractionFn = new LookupExtractionFn(mapLookupExtractor, false, "NULL", true, false); - } + LookupExtractionFn lookupExtractionFn = new LookupExtractionFn(mapLookupExtractor, false, "NULL", true, false); DimFilter extractionFilter = new ExtractionDimFilter("null_column", "NULL", lookupExtractionFn, null); TopNQueryBuilder topNQueryBuilder = new TopNQueryBuilder() .dataSource(QueryRunnerTestHelper.DATA_SOURCE) @@ -4216,14 +4209,8 @@ public void testTopNWithExtractionFilterNoExistingValue() Map extractionMap = new HashMap<>(); MapLookupExtractor mapLookupExtractor = new MapLookupExtractor(extractionMap, false); - LookupExtractionFn lookupExtractionFn; - if (NullHandling.replaceWithDefault()) { - lookupExtractionFn = new LookupExtractionFn(mapLookupExtractor, false, null, true, true); - extractionMap.put("", "NULL"); - } else { - extractionMap.put("", "NOT_USED"); - lookupExtractionFn = new LookupExtractionFn(mapLookupExtractor, false, "NULL", true, true); - } + LookupExtractionFn lookupExtractionFn = new LookupExtractionFn(mapLookupExtractor, false, "NULL", true, true); + extractionMap.put("", "NOT_USED"); DimFilter extractionFilter = new ExtractionDimFilter("null_column", "NULL", lookupExtractionFn, null); TopNQueryBuilder topNQueryBuilder = new TopNQueryBuilder() .dataSource(QueryRunnerTestHelper.DATA_SOURCE) @@ -5791,9 +5778,9 @@ public void test_topN_orderByLongNumericColumnWithNulls_returnsDescendingResults .put("index_alias", 147L) .put("longNumericNull", 10L) .build(), - makeRowWithNulls("index_alias", 114L, "longNumericNull", NullHandling.defaultLongValue()), - makeRowWithNulls("index_alias", 126L, "longNumericNull", NullHandling.defaultLongValue()), - makeRowWithNulls("index_alias", 166L, "longNumericNull", NullHandling.defaultLongValue()) + makeRowWithNulls("index_alias", 114L, "longNumericNull", null), + makeRowWithNulls("index_alias", 126L, "longNumericNull", null), + makeRowWithNulls("index_alias", 166L, "longNumericNull", null) ) ) ) @@ -5859,9 +5846,9 @@ public void test_topN_orderByFloatNumericColumnWithNulls_returnsDescendingResult .put("index_alias", 147L) .put("floatNumericNull", 10f) .build(), - makeRowWithNulls("index_alias", 114L, "floatNumericNull", NullHandling.defaultFloatValue()), - makeRowWithNulls("index_alias", 126L, "floatNumericNull", NullHandling.defaultFloatValue()), - makeRowWithNulls("index_alias", 166L, "floatNumericNull", NullHandling.defaultFloatValue()) + makeRowWithNulls("index_alias", 114L, "floatNumericNull", null), + makeRowWithNulls("index_alias", 126L, "floatNumericNull", null), + makeRowWithNulls("index_alias", 166L, "floatNumericNull", null) ) ) ) @@ -5927,9 +5914,9 @@ public void test_topN_orderByDoubleNumericColumnWithNulls_returnsDescendingResul .put("index_alias", 147L) .put("doubleNumericNull", 10d) .build(), - makeRowWithNulls("index_alias", 114L, "doubleNumericNull", NullHandling.defaultDoubleValue()), - makeRowWithNulls("index_alias", 126L, "doubleNumericNull", NullHandling.defaultDoubleValue()), - makeRowWithNulls("index_alias", 166L, "doubleNumericNull", NullHandling.defaultDoubleValue()) + makeRowWithNulls("index_alias", 114L, "doubleNumericNull", null), + makeRowWithNulls("index_alias", 126L, "doubleNumericNull", null), + makeRowWithNulls("index_alias", 166L, "doubleNumericNull", null) ) ) ) @@ -5956,7 +5943,7 @@ public void testAggregateOnLongNumericNull() DateTimes.of("2011-01-12T00:00:00.000Z"), TopNResultValue.create( Arrays.asList( - makeRowWithNulls("dim", NullHandling.defaultLongValue(), "count", 279L), + makeRowWithNulls("dim", null, "count", 279L), makeRowWithNulls("dim", 10L, "count", 93L), makeRowWithNulls("dim", 20L, "count", 93L), makeRowWithNulls("dim", 40L, "count", 93L), @@ -5988,7 +5975,7 @@ public void testAggregateOnDoubleNumericNull() DateTimes.of("2011-01-12T00:00:00.000Z"), TopNResultValue.create( Arrays.asList( - makeRowWithNulls("dim", NullHandling.defaultDoubleValue(), "count", 279L), + makeRowWithNulls("dim", null, "count", 279L), makeRowWithNulls("dim", 10.0, "count", 93L), makeRowWithNulls("dim", 20.0, "count", 93L), makeRowWithNulls("dim", 40.0, "count", 93L), @@ -6020,7 +6007,7 @@ public void testAggregateOnFloatNumericNull() DateTimes.of("2011-01-12T00:00:00.000Z"), TopNResultValue.create( Arrays.asList( - makeRowWithNulls("dim", NullHandling.defaultFloatValue(), "count", 279L), + makeRowWithNulls("dim", null, "count", 279L), makeRowWithNulls("dim", 10.0f, "count", 93L), makeRowWithNulls("dim", 20.0f, "count", 93L), makeRowWithNulls("dim", 40.0f, "count", 93L), diff --git a/processing/src/test/java/org/apache/druid/query/union/UnionQueryQueryToolChestTest.java b/processing/src/test/java/org/apache/druid/query/union/UnionQueryQueryToolChestTest.java index 295b34b4b2b0..c4669b5075ad 100644 --- a/processing/src/test/java/org/apache/druid/query/union/UnionQueryQueryToolChestTest.java +++ b/processing/src/test/java/org/apache/druid/query/union/UnionQueryQueryToolChestTest.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.guava.Sequence; import org.apache.druid.java.util.common.guava.Sequences; @@ -43,7 +42,6 @@ import org.apache.druid.segment.column.ColumnType; import org.apache.druid.segment.column.RowSignature; import org.junit.Assert; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.mockito.Mockito; @@ -57,12 +55,6 @@ public class UnionQueryQueryToolChestTest { - @BeforeAll - public static void setUpClass() - { - NullHandling.initializeForTests(); - } - final UnionQueryLogic queryLogic; private ScanQueryQueryToolChest scanToolChest; diff --git a/processing/src/test/java/org/apache/druid/segment/AutoTypeColumnIndexerTest.java b/processing/src/test/java/org/apache/druid/segment/AutoTypeColumnIndexerTest.java index 2c570981f656..0d78b03a7867 100644 --- a/processing/src/test/java/org/apache/druid/segment/AutoTypeColumnIndexerTest.java +++ b/processing/src/test/java/org/apache/druid/segment/AutoTypeColumnIndexerTest.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.MapBasedInputRow; import org.apache.druid.data.input.impl.DimensionsSpec; import org.apache.druid.data.input.impl.TimestampSpec; @@ -65,7 +64,7 @@ public void testKeySizeEstimation() { AutoTypeColumnIndexer indexer = new AutoTypeColumnIndexer("test", null); Assert.assertEquals(DimensionDictionarySelector.CARDINALITY_UNKNOWN, indexer.getCardinality()); - int baseCardinality = NullHandling.sqlCompatible() ? 0 : 2; + int baseCardinality = 0; Assert.assertEquals(baseCardinality, indexer.globalDictionary.getCardinality()); EncodedKeyComponent key; @@ -114,22 +113,14 @@ public void testKeySizeEstimation() Assert.assertEquals(baseCardinality + 6, indexer.globalDictionary.getCardinality()); key = indexer.processRowValsToUnsortedEncodedKeyComponent("", false); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(0, key.getEffectiveSizeBytes()); - Assert.assertEquals(baseCardinality + 7, indexer.globalDictionary.getCardinality()); - } else { - Assert.assertEquals(104, key.getEffectiveSizeBytes()); - Assert.assertEquals(baseCardinality + 7, indexer.globalDictionary.getCardinality()); - } + + Assert.assertEquals(104, key.getEffectiveSizeBytes()); + Assert.assertEquals(baseCardinality + 7, indexer.globalDictionary.getCardinality()); key = indexer.processRowValsToUnsortedEncodedKeyComponent(0L, false); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(16, key.getEffectiveSizeBytes()); - Assert.assertEquals(baseCardinality + 7, indexer.globalDictionary.getCardinality()); - } else { - Assert.assertEquals(48, key.getEffectiveSizeBytes()); - Assert.assertEquals(baseCardinality + 8, indexer.globalDictionary.getCardinality()); - } + + Assert.assertEquals(48, key.getEffectiveSizeBytes()); + Assert.assertEquals(baseCardinality + 8, indexer.globalDictionary.getCardinality()); Assert.assertEquals(DimensionDictionarySelector.CARDINALITY_UNKNOWN, indexer.getCardinality()); } @@ -230,41 +221,18 @@ public void testNestedColumnIndexerSchemaDiscoveryRootLong() throws IndexSizeExc Assert.assertEquals("3", dimensionSelector.getObject()); cursor.advance(); - if (NullHandling.sqlCompatible()) { - Assert.assertNull(valueSelector.getObject()); - Assert.assertTrue(valueSelector.isNull()); - Assert.assertEquals(1, dimensionSelector.getRow().size()); - Assert.assertNull(dimensionSelector.lookupName(dimensionSelector.getRow().get(0))); - Assert.assertNull(dimensionSelector.getObject()); - } else { - Assert.assertEquals(NullHandling.defaultLongValue(), valueSelector.getObject()); - Assert.assertFalse(valueSelector.isNull()); - Assert.assertEquals(1, dimensionSelector.getRow().size()); - Assert.assertEquals( - String.valueOf(NullHandling.defaultLongValue()), - dimensionSelector.lookupName(dimensionSelector.getRow().get(0)) - ); - Assert.assertEquals(String.valueOf(NullHandling.defaultLongValue()), dimensionSelector.getObject()); - } - + Assert.assertNull(valueSelector.getObject()); + Assert.assertTrue(valueSelector.isNull()); + Assert.assertEquals(1, dimensionSelector.getRow().size()); + Assert.assertNull(dimensionSelector.lookupName(dimensionSelector.getRow().get(0))); + Assert.assertNull(dimensionSelector.getObject()); cursor.advance(); - if (NullHandling.sqlCompatible()) { - Assert.assertNull(valueSelector.getObject()); - Assert.assertTrue(valueSelector.isNull()); - Assert.assertEquals(1, dimensionSelector.getRow().size()); - Assert.assertNull(dimensionSelector.lookupName(dimensionSelector.getRow().get(0))); - Assert.assertNull(dimensionSelector.getObject()); - } else { - Assert.assertEquals(NullHandling.defaultLongValue(), valueSelector.getObject()); - Assert.assertFalse(valueSelector.isNull()); - Assert.assertEquals(1, dimensionSelector.getRow().size()); - Assert.assertEquals( - String.valueOf(NullHandling.defaultLongValue()), - dimensionSelector.lookupName(dimensionSelector.getRow().get(0)) - ); - Assert.assertEquals(String.valueOf(NullHandling.defaultLongValue()), dimensionSelector.getObject()); - } + Assert.assertNull(valueSelector.getObject()); + Assert.assertTrue(valueSelector.isNull()); + Assert.assertEquals(1, dimensionSelector.getRow().size()); + Assert.assertNull(dimensionSelector.lookupName(dimensionSelector.getRow().get(0))); + Assert.assertNull(dimensionSelector.getObject()); Assert.assertEquals(ColumnType.LONG, cursorFactory.getColumnCapabilities(LONG_COL).toColumnType()); } } @@ -314,40 +282,18 @@ public void testNestedColumnIndexerSchemaDiscoveryRootDouble() throws IndexSizeE Assert.assertEquals("3.3", dimensionSelector.getObject()); cursor.advance(); - if (NullHandling.sqlCompatible()) { - Assert.assertNull(valueSelector.getObject()); - Assert.assertTrue(valueSelector.isNull()); - Assert.assertEquals(1, dimensionSelector.getRow().size()); - Assert.assertNull(dimensionSelector.lookupName(dimensionSelector.getRow().get(0))); - Assert.assertNull(dimensionSelector.getObject()); - } else { - Assert.assertEquals(NullHandling.defaultDoubleValue(), valueSelector.getObject()); - Assert.assertFalse(valueSelector.isNull()); - Assert.assertEquals(1, dimensionSelector.getRow().size()); - Assert.assertEquals( - String.valueOf(NullHandling.defaultDoubleValue()), - dimensionSelector.lookupName(dimensionSelector.getRow().get(0)) - ); - Assert.assertEquals(String.valueOf(NullHandling.defaultDoubleValue()), dimensionSelector.getObject()); - } + Assert.assertNull(valueSelector.getObject()); + Assert.assertTrue(valueSelector.isNull()); + Assert.assertEquals(1, dimensionSelector.getRow().size()); + Assert.assertNull(dimensionSelector.lookupName(dimensionSelector.getRow().get(0))); + Assert.assertNull(dimensionSelector.getObject()); cursor.advance(); - if (NullHandling.sqlCompatible()) { - Assert.assertNull(valueSelector.getObject()); - Assert.assertTrue(valueSelector.isNull()); - Assert.assertEquals(1, dimensionSelector.getRow().size()); - Assert.assertNull(dimensionSelector.lookupName(dimensionSelector.getRow().get(0))); - Assert.assertNull(dimensionSelector.getObject()); - } else { - Assert.assertEquals(NullHandling.defaultDoubleValue(), valueSelector.getObject()); - Assert.assertFalse(valueSelector.isNull()); - Assert.assertEquals(1, dimensionSelector.getRow().size()); - Assert.assertEquals( - String.valueOf(NullHandling.defaultDoubleValue()), - dimensionSelector.lookupName(dimensionSelector.getRow().get(0)) - ); - Assert.assertEquals(String.valueOf(NullHandling.defaultDoubleValue()), dimensionSelector.getObject()); - } + Assert.assertNull(valueSelector.getObject()); + Assert.assertTrue(valueSelector.isNull()); + Assert.assertEquals(1, dimensionSelector.getRow().size()); + Assert.assertNull(dimensionSelector.lookupName(dimensionSelector.getRow().get(0))); + Assert.assertNull(dimensionSelector.getObject()); Assert.assertEquals(ColumnType.DOUBLE, cursorFactory.getColumnCapabilities(DOUBLE_COL).toColumnType()); } } @@ -549,7 +495,7 @@ public void testNestedColumnIndexerSchemaDiscoveryTypeCoercion() throws IndexSiz @Test public void testConstantNull() { - int baseCardinality = NullHandling.sqlCompatible() ? 0 : 2; + int baseCardinality = 0; AutoTypeColumnIndexer indexer = new AutoTypeColumnIndexer("test", null); EncodedKeyComponent key; @@ -574,7 +520,7 @@ public void testConstantNull() @Test public void testConstantString() { - int baseCardinality = NullHandling.sqlCompatible() ? 0 : 2; + int baseCardinality = 0; AutoTypeColumnIndexer indexer = new AutoTypeColumnIndexer("test", null); EncodedKeyComponent key; @@ -598,7 +544,7 @@ public void testConstantString() @Test public void testConstantLong() { - int baseCardinality = NullHandling.sqlCompatible() ? 0 : 2; + int baseCardinality = 0; AutoTypeColumnIndexer indexer = new AutoTypeColumnIndexer("test", null); EncodedKeyComponent key; @@ -622,7 +568,7 @@ public void testConstantLong() @Test public void testConstantEmptyArray() { - int baseCardinality = NullHandling.sqlCompatible() ? 0 : 2; + int baseCardinality = 0; AutoTypeColumnIndexer indexer = new AutoTypeColumnIndexer("test", null); EncodedKeyComponent key; @@ -646,7 +592,7 @@ public void testConstantEmptyArray() @Test public void testConstantArray() { - int baseCardinality = NullHandling.sqlCompatible() ? 0 : 2; + int baseCardinality = 0; AutoTypeColumnIndexer indexer = new AutoTypeColumnIndexer("test", null); EncodedKeyComponent key; @@ -670,7 +616,7 @@ public void testConstantArray() @Test public void testConstantEmptyObject() { - int baseCardinality = NullHandling.sqlCompatible() ? 0 : 2; + int baseCardinality = 0; AutoTypeColumnIndexer indexer = new AutoTypeColumnIndexer("test", null); EncodedKeyComponent key; diff --git a/processing/src/test/java/org/apache/druid/segment/ConstantDimensionSelectorTest.java b/processing/src/test/java/org/apache/druid/segment/ConstantDimensionSelectorTest.java index a1c972db04bf..b5193397ab51 100644 --- a/processing/src/test/java/org/apache/druid/segment/ConstantDimensionSelectorTest.java +++ b/processing/src/test/java/org/apache/druid/segment/ConstantDimensionSelectorTest.java @@ -19,7 +19,6 @@ package org.apache.druid.segment; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.extraction.StringFormatExtractionFn; import org.apache.druid.query.extraction.SubstringDimExtractionFn; import org.apache.druid.query.filter.DruidObjectPredicate; @@ -75,7 +74,7 @@ public void testLookupName() public void testLookupId() { Assert.assertEquals(0, NULL_SELECTOR.idLookup().lookupId(null)); - Assert.assertEquals(NullHandling.replaceWithDefault() ? 0 : -1, NULL_SELECTOR.idLookup().lookupId("")); + Assert.assertEquals(-1, NULL_SELECTOR.idLookup().lookupId("")); Assert.assertEquals(-1, NULL_SELECTOR.idLookup().lookupId("billy")); Assert.assertEquals(-1, NULL_SELECTOR.idLookup().lookupId("bob")); diff --git a/processing/src/test/java/org/apache/druid/segment/CursorFactoryProjectionTest.java b/processing/src/test/java/org/apache/druid/segment/CursorFactoryProjectionTest.java index 7ddf086eb5a0..403ae7058ba9 100644 --- a/processing/src/test/java/org/apache/druid/segment/CursorFactoryProjectionTest.java +++ b/processing/src/test/java/org/apache/druid/segment/CursorFactoryProjectionTest.java @@ -26,7 +26,6 @@ import org.apache.druid.collections.CloseableDefaultBlockingPool; import org.apache.druid.collections.CloseableStupidPool; import org.apache.druid.collections.NonBlockingPool; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.data.input.ListBasedInputRow; import org.apache.druid.data.input.impl.AggregateProjectionSpec; @@ -987,10 +986,10 @@ public void testProjectionSelectionMissingAggregatorButHasAggregatorInput() final List results = resultRows.toList(); Assert.assertEquals(4, results.size()); - Assert.assertArrayEquals(new Object[]{"aa", 9L, NullHandling.defaultFloatValue()}, results.get(0).getArray()); - Assert.assertArrayEquals(new Object[]{"bb", 6L, NullHandling.defaultFloatValue()}, results.get(1).getArray()); - Assert.assertArrayEquals(new Object[]{"cc", 2L, NullHandling.defaultFloatValue()}, results.get(2).getArray()); - Assert.assertArrayEquals(new Object[]{"dd", 2L, NullHandling.defaultFloatValue()}, results.get(3).getArray()); + Assert.assertArrayEquals(new Object[]{"aa", 9L, null}, results.get(0).getArray()); + Assert.assertArrayEquals(new Object[]{"bb", 6L, null}, results.get(1).getArray()); + Assert.assertArrayEquals(new Object[]{"cc", 2L, null}, results.get(2).getArray()); + Assert.assertArrayEquals(new Object[]{"dd", 2L, null}, results.get(3).getArray()); } @Test diff --git a/processing/src/test/java/org/apache/druid/segment/IndexIOTest.java b/processing/src/test/java/org/apache/druid/segment/IndexIOTest.java index e755df26822a..5107dd76ba43 100644 --- a/processing/src/test/java/org/apache/druid/segment/IndexIOTest.java +++ b/processing/src/test/java/org/apache/druid/segment/IndexIOTest.java @@ -26,7 +26,6 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.MapBasedInputRow; import org.apache.druid.data.input.impl.DimensionsSpec; import org.apache.druid.java.util.common.Intervals; @@ -73,10 +72,6 @@ public class IndexIOTest extends InitializedNullHandlingTest .withLongEncoding(CompressionFactory.LongEncodingStrategy.LONGS) .build(); - static { - NullHandling.initializeForTests(); - } - private static List filterByBitset(List list, BitSet bitSet) { final ArrayList outList = new ArrayList<>(bitSet.cardinality()); diff --git a/processing/src/test/java/org/apache/druid/segment/IndexMergerNullHandlingTest.java b/processing/src/test/java/org/apache/druid/segment/IndexMergerNullHandlingTest.java index 9e2a69ff364b..02fb30d417f2 100644 --- a/processing/src/test/java/org/apache/druid/segment/IndexMergerNullHandlingTest.java +++ b/processing/src/test/java/org/apache/druid/segment/IndexMergerNullHandlingTest.java @@ -24,7 +24,6 @@ import com.google.common.collect.ImmutableMultiset; import com.google.common.collect.Sets; import org.apache.druid.collections.bitmap.ImmutableBitmap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.MapBasedInputRow; import org.apache.druid.java.util.common.ISE; import org.apache.druid.java.util.common.guava.Comparators; @@ -52,16 +51,13 @@ import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; import java.util.stream.IntStream; public class IndexMergerNullHandlingTest { - static { - NullHandling.initializeForTests(); - } - private IndexMerger indexMerger; private IndexIO indexIO; private IndexSpec indexSpec; @@ -98,13 +94,8 @@ public void testStringColumnNullHandling() throws Exception nullFlavors.add(mNull); nullFlavors.add(mListOfNull); - if (NullHandling.replaceWithDefault()) { - nullFlavors.add(mEmptyString); - nullFlavors.add(mListOfEmptyString); - } else { - nonNullFlavors.add(mEmptyString); - nonNullFlavors.add(mListOfEmptyString); - } + nonNullFlavors.add(mEmptyString); + nonNullFlavors.add(mListOfEmptyString); Set> allValues = new HashSet<>(); allValues.addAll(nonNullFlavors); @@ -193,7 +184,7 @@ public void testStringColumnNullHandling() throws Exception final List expectedNullRows = new ArrayList<>(); for (int i = 0; i < index.getNumRows(); i++) { final List row = getRow(dictionaryColumn, i); - if (row.isEmpty() || row.stream().anyMatch(NullHandling::isNullOrEquivalent)) { + if (row.isEmpty() || row.stream().anyMatch(Objects::isNull)) { expectedNullRows.add(i); } } @@ -232,7 +223,7 @@ private static List normalize(final Object value) if (value == null) { retVal.add(null); } else if (value instanceof String) { - retVal.add(NullHandling.emptyToNullIfNeeded(((String) value))); + retVal.add((String) value); } else if (value instanceof List) { final List list = (List) value; if (list.isEmpty()) { @@ -240,7 +231,7 @@ private static List normalize(final Object value) // they sometimes also become nulls in multi-valued columns (see comments in getRow()) retVal.add(null); } else { - retVal.addAll(list.stream().map(NullHandling::emptyToNullIfNeeded).collect(Collectors.toList())); + retVal.addAll(list); } } else { throw new ISE("didn't expect class[%s]", value.getClass()); diff --git a/processing/src/test/java/org/apache/druid/segment/IndexMergerTestBase.java b/processing/src/test/java/org/apache/druid/segment/IndexMergerTestBase.java index a68937564968..d234badaed38 100644 --- a/processing/src/test/java/org/apache/druid/segment/IndexMergerTestBase.java +++ b/processing/src/test/java/org/apache/druid/segment/IndexMergerTestBase.java @@ -28,7 +28,6 @@ import com.google.common.collect.Sets; import it.unimi.dsi.fastutil.ints.IntIterator; import org.apache.druid.collections.bitmap.RoaringBitmapFactory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.data.input.ListBasedInputRow; import org.apache.druid.data.input.MapBasedInputRow; @@ -1197,68 +1196,35 @@ public void testJointDimMerge() throws Exception final QueryableIndexIndexableAdapter adapter = new QueryableIndexIndexableAdapter(merged); final List rowList = RowIteratorHelper.toList(adapter.getRows()); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals( - ImmutableList.of("__time", "d2", "d3", "d5", "d6", "d7", "d8", "d9"), - ImmutableList.copyOf(adapter.getDimensionNames(true)) - ); - Assert.assertEquals( - ImmutableList.of("d2", "d3", "d5", "d6", "d7", "d8", "d9"), - ImmutableList.copyOf(adapter.getDimensionNames(false)) - ); - } else { - Assert.assertEquals( - ImmutableList.of("__time", "d1", "d2", "d3", "d5", "d6", "d7", "d8", "d9"), - ImmutableList.copyOf(adapter.getDimensionNames(true)) - ); - Assert.assertEquals( - ImmutableList.of("d1", "d2", "d3", "d5", "d6", "d7", "d8", "d9"), - ImmutableList.copyOf(adapter.getDimensionNames(false)) - ); - } + Assert.assertEquals( + ImmutableList.of("__time", "d1", "d2", "d3", "d5", "d6", "d7", "d8", "d9"), + ImmutableList.copyOf(adapter.getDimensionNames(true)) + ); + Assert.assertEquals( + ImmutableList.of("d1", "d2", "d3", "d5", "d6", "d7", "d8", "d9"), + ImmutableList.copyOf(adapter.getDimensionNames(false)) + ); Assert.assertEquals(4, rowList.size()); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals( - Arrays.asList(null, "310", null, null, null, null, "910"), - rowList.get(0).dimensionValues() - ); - Assert.assertEquals( - Arrays.asList("210", "311", null, null, "710", "810", "911"), - rowList.get(1).dimensionValues() - ); - Assert.assertEquals( - Arrays.asList(null, null, "520", "620", "720", "820", "920"), - rowList.get(2).dimensionValues() - ); - Assert.assertEquals( - Arrays.asList(null, null, null, "621", null, "821", "921"), - rowList.get(3).dimensionValues() - ); - - checkBitmapIndex(Arrays.asList(0, 2, 3), getBitmapIndex(adapter, "d2", null)); - checkBitmapIndex(Arrays.asList(0, 1, 3), getBitmapIndex(adapter, "d5", null)); - checkBitmapIndex(Arrays.asList(0, 3), getBitmapIndex(adapter, "d7", null)); - } else { - Assert.assertEquals( - Arrays.asList("", "", "310", null, null, "", null, "910"), - rowList.get(0).dimensionValues() - ); - Assert.assertEquals( - Arrays.asList(null, "210", "311", null, null, "710", "810", "911"), - rowList.get(1).dimensionValues() - ); - Assert.assertEquals( - Arrays.asList(null, null, null, "520", "620", "720", "820", "920"), - rowList.get(2).dimensionValues() - ); - Assert.assertEquals( - Arrays.asList(null, null, null, "", "621", "", "821", "921"), - rowList.get(3).dimensionValues() - ); - checkBitmapIndex(Arrays.asList(2, 3), getBitmapIndex(adapter, "d2", null)); - checkBitmapIndex(Arrays.asList(0, 1), getBitmapIndex(adapter, "d5", null)); - checkBitmapIndex(Collections.emptyList(), getBitmapIndex(adapter, "d7", null)); - } + + Assert.assertEquals( + Arrays.asList("", "", "310", null, null, "", null, "910"), + rowList.get(0).dimensionValues() + ); + Assert.assertEquals( + Arrays.asList(null, "210", "311", null, null, "710", "810", "911"), + rowList.get(1).dimensionValues() + ); + Assert.assertEquals( + Arrays.asList(null, null, null, "520", "620", "720", "820", "920"), + rowList.get(2).dimensionValues() + ); + Assert.assertEquals( + Arrays.asList(null, null, null, "", "621", "", "821", "921"), + rowList.get(3).dimensionValues() + ); + checkBitmapIndex(Arrays.asList(2, 3), getBitmapIndex(adapter, "d2", null)); + checkBitmapIndex(Arrays.asList(0, 1), getBitmapIndex(adapter, "d5", null)); + checkBitmapIndex(Collections.emptyList(), getBitmapIndex(adapter, "d7", null)); checkBitmapIndex(Collections.singletonList(1), getBitmapIndex(adapter, "d2", "210")); @@ -1379,41 +1345,24 @@ public void testNoRollupMergeWithDuplicateRow() throws Exception final QueryableIndexIndexableAdapter adapter = new QueryableIndexIndexableAdapter(merged); final List rowList = RowIteratorHelper.toList(adapter.getRows()); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals( - ImmutableList.of("__time", "d3", "d6", "d8", "d9"), - ImmutableList.copyOf(adapter.getDimensionNames(true)) - ); - Assert.assertEquals( - ImmutableList.of("d3", "d6", "d8", "d9"), - ImmutableList.copyOf(adapter.getDimensionNames(false)) - ); - } else { - Assert.assertEquals( - ImmutableList.of("__time", "d1", "d2", "d3", "d5", "d6", "d7", "d8", "d9"), - ImmutableList.copyOf(adapter.getDimensionNames(true)) - ); - Assert.assertEquals( - ImmutableList.of("d1", "d2", "d3", "d5", "d6", "d7", "d8", "d9"), - ImmutableList.copyOf(adapter.getDimensionNames(false)) - ); - } + Assert.assertEquals( + ImmutableList.of("__time", "d1", "d2", "d3", "d5", "d6", "d7", "d8", "d9"), + ImmutableList.copyOf(adapter.getDimensionNames(true)) + ); + Assert.assertEquals( + ImmutableList.of("d1", "d2", "d3", "d5", "d6", "d7", "d8", "d9"), + ImmutableList.copyOf(adapter.getDimensionNames(false)) + ); Assert.assertEquals(4, rowList.size()); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(Arrays.asList("310", null, null, "910"), rowList.get(0).dimensionValues()); - Assert.assertEquals(Arrays.asList("310", null, null, "910"), rowList.get(1).dimensionValues()); - Assert.assertEquals(Arrays.asList("310", null, null, "910"), rowList.get(2).dimensionValues()); - Assert.assertEquals(Arrays.asList(null, "621", "821", "921"), rowList.get(3).dimensionValues()); - } else { - Assert.assertEquals(Arrays.asList("", "", "310", null, null, "", null, "910"), rowList.get(0).dimensionValues()); - Assert.assertEquals(Arrays.asList("", "", "310", null, null, "", null, "910"), rowList.get(1).dimensionValues()); - Assert.assertEquals(Arrays.asList("", "", "310", null, null, "", null, "910"), rowList.get(2).dimensionValues()); - Assert.assertEquals( - Arrays.asList(null, null, null, "", "621", "", "821", "921"), - rowList.get(3).dimensionValues() - ); - } + + Assert.assertEquals(Arrays.asList("", "", "310", null, null, "", null, "910"), rowList.get(0).dimensionValues()); + Assert.assertEquals(Arrays.asList("", "", "310", null, null, "", null, "910"), rowList.get(1).dimensionValues()); + Assert.assertEquals(Arrays.asList("", "", "310", null, null, "", null, "910"), rowList.get(2).dimensionValues()); + Assert.assertEquals( + Arrays.asList(null, null, null, "", "621", "", "821", "921"), + rowList.get(3).dimensionValues() + ); checkBitmapIndex(Collections.singletonList(3), getBitmapIndex(adapter, "d3", null)); checkBitmapIndex(Arrays.asList(0, 1, 2), getBitmapIndex(adapter, "d3", "310")); @@ -1972,8 +1921,8 @@ public void testMergeNumericDims() throws Exception Assert.assertEquals( Arrays.asList( - NullHandling.defaultLongValue(), - NullHandling.defaultFloatValue(), + null, + null, "Nully Row" ), rowList.get(0).dimensionValues() @@ -2668,108 +2617,60 @@ public void testMultivalDim_persistAndMerge_dimensionValueOrderingRules() throws ImmutableList.copyOf(adapter.getDimensionNames(false)) ); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(11, rowList.size()); - - Assert.assertEquals(Arrays.asList("leek", null), rowList.get(0).dimensionValues()); - Assert.assertEquals(12L, rowList.get(0).metricValues().get(0)); - - Assert.assertEquals(Arrays.asList("leek", Arrays.asList(null, "1", "2", "3")), rowList.get(1).dimensionValues()); - Assert.assertEquals(4L, rowList.get(1).metricValues().get(0)); - - Assert.assertEquals(Arrays.asList("leek", Arrays.asList(null, "3")), rowList.get(2).dimensionValues()); - Assert.assertEquals(4L, rowList.get(2).metricValues().get(0)); - - Assert.assertEquals(Arrays.asList("leek", "1"), rowList.get(3).dimensionValues()); - Assert.assertEquals(4L, rowList.get(3).metricValues().get(0)); - - Assert.assertEquals(Arrays.asList("leek", Arrays.asList("1", "2", "3")), rowList.get(4).dimensionValues()); - Assert.assertEquals(2L, rowList.get(4).metricValues().get(0)); - - Assert.assertEquals(Arrays.asList("leek", Arrays.asList("1", "3")), rowList.get(5).dimensionValues()); - Assert.assertEquals(2L, rowList.get(5).metricValues().get(0)); - - Assert.assertEquals(Arrays.asList("leek", Arrays.asList("1", "3", "5")), rowList.get(6).dimensionValues()); - Assert.assertEquals(2L, rowList.get(6).metricValues().get(0)); - - Assert.assertEquals(Arrays.asList("leek", Arrays.asList("1", "4")), rowList.get(7).dimensionValues()); - Assert.assertEquals(2L, rowList.get(7).metricValues().get(0)); + Assert.assertEquals(14, rowList.size()); - Assert.assertEquals(Arrays.asList("leek", "2"), rowList.get(8).dimensionValues()); - Assert.assertEquals(4L, rowList.get(8).metricValues().get(0)); + Assert.assertEquals(Arrays.asList("leek", null), rowList.get(0).dimensionValues()); + Assert.assertEquals(8L, rowList.get(0).metricValues().get(0)); - Assert.assertEquals(Arrays.asList("potato", Arrays.asList("1", "3")), rowList.get(9).dimensionValues()); - Assert.assertEquals(2L, rowList.get(9).metricValues().get(0)); - - Assert.assertEquals(Arrays.asList("potato", "2"), rowList.get(10).dimensionValues()); - Assert.assertEquals(4L, rowList.get(10).metricValues().get(0)); - - checkBitmapIndex(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8), getBitmapIndex(adapter, "dimA", "leek")); - checkBitmapIndex(Arrays.asList(9, 10), getBitmapIndex(adapter, "dimA", "potato")); - - checkBitmapIndex(Arrays.asList(0, 1, 2), getBitmapIndex(adapter, "dimMultiVal", null)); - checkBitmapIndex(ImmutableList.of(), getBitmapIndex(adapter, "dimMultiVal", "")); - checkBitmapIndex(Arrays.asList(1, 3, 4, 5, 6, 7, 9), getBitmapIndex(adapter, "dimMultiVal", "1")); - checkBitmapIndex(Arrays.asList(1, 4, 8, 10), getBitmapIndex(adapter, "dimMultiVal", "2")); - checkBitmapIndex(Arrays.asList(1, 2, 4, 5, 6, 9), getBitmapIndex(adapter, "dimMultiVal", "3")); - checkBitmapIndex(Collections.singletonList(7), getBitmapIndex(adapter, "dimMultiVal", "4")); - checkBitmapIndex(Collections.singletonList(6), getBitmapIndex(adapter, "dimMultiVal", "5")); - } else { - Assert.assertEquals(14, rowList.size()); - - Assert.assertEquals(Arrays.asList("leek", null), rowList.get(0).dimensionValues()); - Assert.assertEquals(8L, rowList.get(0).metricValues().get(0)); - - Assert.assertEquals(Arrays.asList("leek", Arrays.asList(null, "1", "2", "3")), rowList.get(1).dimensionValues()); - Assert.assertEquals(2L, rowList.get(1).metricValues().get(0)); + Assert.assertEquals(Arrays.asList("leek", Arrays.asList(null, "1", "2", "3")), rowList.get(1).dimensionValues()); + Assert.assertEquals(2L, rowList.get(1).metricValues().get(0)); - Assert.assertEquals(Arrays.asList("leek", Arrays.asList(null, "3")), rowList.get(2).dimensionValues()); - Assert.assertEquals(2L, rowList.get(2).metricValues().get(0)); + Assert.assertEquals(Arrays.asList("leek", Arrays.asList(null, "3")), rowList.get(2).dimensionValues()); + Assert.assertEquals(2L, rowList.get(2).metricValues().get(0)); - Assert.assertEquals(Arrays.asList("leek", ""), rowList.get(3).dimensionValues()); - Assert.assertEquals(4L, rowList.get(3).metricValues().get(0)); + Assert.assertEquals(Arrays.asList("leek", ""), rowList.get(3).dimensionValues()); + Assert.assertEquals(4L, rowList.get(3).metricValues().get(0)); - Assert.assertEquals(Arrays.asList("leek", Arrays.asList("", "1", "2", "3")), rowList.get(4).dimensionValues()); - Assert.assertEquals(2L, rowList.get(4).metricValues().get(0)); + Assert.assertEquals(Arrays.asList("leek", Arrays.asList("", "1", "2", "3")), rowList.get(4).dimensionValues()); + Assert.assertEquals(2L, rowList.get(4).metricValues().get(0)); - Assert.assertEquals(Arrays.asList("leek", Arrays.asList("", "3")), rowList.get(5).dimensionValues()); - Assert.assertEquals(2L, rowList.get(5).metricValues().get(0)); + Assert.assertEquals(Arrays.asList("leek", Arrays.asList("", "3")), rowList.get(5).dimensionValues()); + Assert.assertEquals(2L, rowList.get(5).metricValues().get(0)); - Assert.assertEquals(Arrays.asList("leek", "1"), rowList.get(6).dimensionValues()); - Assert.assertEquals(4L, rowList.get(6).metricValues().get(0)); + Assert.assertEquals(Arrays.asList("leek", "1"), rowList.get(6).dimensionValues()); + Assert.assertEquals(4L, rowList.get(6).metricValues().get(0)); - Assert.assertEquals(Arrays.asList("leek", Arrays.asList("1", "2", "3")), rowList.get(7).dimensionValues()); - Assert.assertEquals(2L, rowList.get(7).metricValues().get(0)); + Assert.assertEquals(Arrays.asList("leek", Arrays.asList("1", "2", "3")), rowList.get(7).dimensionValues()); + Assert.assertEquals(2L, rowList.get(7).metricValues().get(0)); - Assert.assertEquals(Arrays.asList("leek", Arrays.asList("1", "3")), rowList.get(8).dimensionValues()); - Assert.assertEquals(2L, rowList.get(8).metricValues().get(0)); + Assert.assertEquals(Arrays.asList("leek", Arrays.asList("1", "3")), rowList.get(8).dimensionValues()); + Assert.assertEquals(2L, rowList.get(8).metricValues().get(0)); - Assert.assertEquals(Arrays.asList("leek", Arrays.asList("1", "3", "5")), rowList.get(9).dimensionValues()); - Assert.assertEquals(2L, rowList.get(9).metricValues().get(0)); + Assert.assertEquals(Arrays.asList("leek", Arrays.asList("1", "3", "5")), rowList.get(9).dimensionValues()); + Assert.assertEquals(2L, rowList.get(9).metricValues().get(0)); - Assert.assertEquals(Arrays.asList("leek", Arrays.asList("1", "4")), rowList.get(10).dimensionValues()); - Assert.assertEquals(2L, rowList.get(10).metricValues().get(0)); + Assert.assertEquals(Arrays.asList("leek", Arrays.asList("1", "4")), rowList.get(10).dimensionValues()); + Assert.assertEquals(2L, rowList.get(10).metricValues().get(0)); - Assert.assertEquals(Arrays.asList("leek", "2"), rowList.get(11).dimensionValues()); - Assert.assertEquals(4L, rowList.get(11).metricValues().get(0)); + Assert.assertEquals(Arrays.asList("leek", "2"), rowList.get(11).dimensionValues()); + Assert.assertEquals(4L, rowList.get(11).metricValues().get(0)); - Assert.assertEquals(Arrays.asList("potato", Arrays.asList("1", "3")), rowList.get(12).dimensionValues()); - Assert.assertEquals(2L, rowList.get(12).metricValues().get(0)); + Assert.assertEquals(Arrays.asList("potato", Arrays.asList("1", "3")), rowList.get(12).dimensionValues()); + Assert.assertEquals(2L, rowList.get(12).metricValues().get(0)); - Assert.assertEquals(Arrays.asList("potato", "2"), rowList.get(13).dimensionValues()); - Assert.assertEquals(4L, rowList.get(13).metricValues().get(0)); + Assert.assertEquals(Arrays.asList("potato", "2"), rowList.get(13).dimensionValues()); + Assert.assertEquals(4L, rowList.get(13).metricValues().get(0)); - checkBitmapIndex(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11), getBitmapIndex(adapter, "dimA", "leek")); - checkBitmapIndex(Arrays.asList(12, 13), getBitmapIndex(adapter, "dimA", "potato")); + checkBitmapIndex(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11), getBitmapIndex(adapter, "dimA", "leek")); + checkBitmapIndex(Arrays.asList(12, 13), getBitmapIndex(adapter, "dimA", "potato")); - checkBitmapIndex(Arrays.asList(0, 1, 2), getBitmapIndex(adapter, "dimMultiVal", null)); - checkBitmapIndex(ImmutableList.of(3, 4, 5), getBitmapIndex(adapter, "dimMultiVal", "")); - checkBitmapIndex(Arrays.asList(1, 4, 6, 7, 8, 9, 10, 12), getBitmapIndex(adapter, "dimMultiVal", "1")); - checkBitmapIndex(Arrays.asList(1, 4, 7, 11, 13), getBitmapIndex(adapter, "dimMultiVal", "2")); - checkBitmapIndex(Arrays.asList(1, 2, 4, 5, 7, 8, 9, 12), getBitmapIndex(adapter, "dimMultiVal", "3")); - checkBitmapIndex(Collections.singletonList(10), getBitmapIndex(adapter, "dimMultiVal", "4")); - checkBitmapIndex(Collections.singletonList(9), getBitmapIndex(adapter, "dimMultiVal", "5")); - } + checkBitmapIndex(Arrays.asList(0, 1, 2), getBitmapIndex(adapter, "dimMultiVal", null)); + checkBitmapIndex(ImmutableList.of(3, 4, 5), getBitmapIndex(adapter, "dimMultiVal", "")); + checkBitmapIndex(Arrays.asList(1, 4, 6, 7, 8, 9, 10, 12), getBitmapIndex(adapter, "dimMultiVal", "1")); + checkBitmapIndex(Arrays.asList(1, 4, 7, 11, 13), getBitmapIndex(adapter, "dimMultiVal", "2")); + checkBitmapIndex(Arrays.asList(1, 2, 4, 5, 7, 8, 9, 12), getBitmapIndex(adapter, "dimMultiVal", "3")); + checkBitmapIndex(Collections.singletonList(10), getBitmapIndex(adapter, "dimMultiVal", "4")); + checkBitmapIndex(Collections.singletonList(9), getBitmapIndex(adapter, "dimMultiVal", "5")); } private MapBasedInputRow getRowForTestMaxColumnsToMerge( diff --git a/processing/src/test/java/org/apache/druid/segment/NestedDataColumnIndexerV4Test.java b/processing/src/test/java/org/apache/druid/segment/NestedDataColumnIndexerV4Test.java index 9fc9fc0f578d..be41958f0066 100644 --- a/processing/src/test/java/org/apache/druid/segment/NestedDataColumnIndexerV4Test.java +++ b/processing/src/test/java/org/apache/druid/segment/NestedDataColumnIndexerV4Test.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.MapBasedInputRow; import org.apache.druid.data.input.impl.DimensionsSpec; import org.apache.druid.data.input.impl.TimestampSpec; @@ -64,7 +63,7 @@ public void testKeySizeEstimation() { NestedDataColumnIndexerV4 indexer = new NestedDataColumnIndexerV4(); Assert.assertEquals(DimensionDictionarySelector.CARDINALITY_UNKNOWN, indexer.getCardinality()); - int baseCardinality = NullHandling.sqlCompatible() ? 0 : 2; + int baseCardinality = 0; Assert.assertEquals(baseCardinality, indexer.globalDictionary.getCardinality()); EncodedKeyComponent key; @@ -113,22 +112,12 @@ public void testKeySizeEstimation() Assert.assertEquals(baseCardinality + 5, indexer.globalDictionary.getCardinality()); key = indexer.processRowValsToUnsortedEncodedKeyComponent("", false); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(0, key.getEffectiveSizeBytes()); - Assert.assertEquals(baseCardinality + 6, indexer.globalDictionary.getCardinality()); - } else { - Assert.assertEquals(104, key.getEffectiveSizeBytes()); - Assert.assertEquals(baseCardinality + 6, indexer.globalDictionary.getCardinality()); - } + Assert.assertEquals(104, key.getEffectiveSizeBytes()); + Assert.assertEquals(baseCardinality + 6, indexer.globalDictionary.getCardinality()); key = indexer.processRowValsToUnsortedEncodedKeyComponent(0, false); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(16, key.getEffectiveSizeBytes()); - Assert.assertEquals(baseCardinality + 6, indexer.globalDictionary.getCardinality()); - } else { - Assert.assertEquals(48, key.getEffectiveSizeBytes()); - Assert.assertEquals(baseCardinality + 7, indexer.globalDictionary.getCardinality()); - } + Assert.assertEquals(48, key.getEffectiveSizeBytes()); + Assert.assertEquals(baseCardinality + 7, indexer.globalDictionary.getCardinality()); Assert.assertEquals(DimensionDictionarySelector.CARDINALITY_UNKNOWN, indexer.getCardinality()); } @@ -228,40 +217,18 @@ public void testNestedColumnIndexerSchemaDiscoveryRootLong() throws IndexSizeExc Assert.assertEquals("3", dimensionSelector.getObject()); cursor.advance(); - if (NullHandling.sqlCompatible()) { - Assert.assertNull(valueSelector.getObject()); - Assert.assertTrue(valueSelector.isNull()); - Assert.assertEquals(1, dimensionSelector.getRow().size()); - Assert.assertNull(dimensionSelector.lookupName(dimensionSelector.getRow().get(0))); - Assert.assertNull(dimensionSelector.getObject()); - } else { - Assert.assertEquals(NullHandling.defaultLongValue(), valueSelector.getObject()); - Assert.assertFalse(valueSelector.isNull()); - Assert.assertEquals(1, dimensionSelector.getRow().size()); - Assert.assertEquals( - String.valueOf(NullHandling.defaultLongValue()), - dimensionSelector.lookupName(dimensionSelector.getRow().get(0)) - ); - Assert.assertEquals(String.valueOf(NullHandling.defaultLongValue()), dimensionSelector.getObject()); - } + Assert.assertNull(valueSelector.getObject()); + Assert.assertTrue(valueSelector.isNull()); + Assert.assertEquals(1, dimensionSelector.getRow().size()); + Assert.assertNull(dimensionSelector.lookupName(dimensionSelector.getRow().get(0))); + Assert.assertNull(dimensionSelector.getObject()); cursor.advance(); - if (NullHandling.sqlCompatible()) { - Assert.assertNull(valueSelector.getObject()); - Assert.assertTrue(valueSelector.isNull()); - Assert.assertEquals(1, dimensionSelector.getRow().size()); - Assert.assertNull(dimensionSelector.lookupName(dimensionSelector.getRow().get(0))); - Assert.assertNull(dimensionSelector.getObject()); - } else { - Assert.assertEquals(NullHandling.defaultLongValue(), valueSelector.getObject()); - Assert.assertFalse(valueSelector.isNull()); - Assert.assertEquals(1, dimensionSelector.getRow().size()); - Assert.assertEquals( - String.valueOf(NullHandling.defaultLongValue()), - dimensionSelector.lookupName(dimensionSelector.getRow().get(0)) - ); - Assert.assertEquals(String.valueOf(NullHandling.defaultLongValue()), dimensionSelector.getObject()); - } + Assert.assertNull(valueSelector.getObject()); + Assert.assertTrue(valueSelector.isNull()); + Assert.assertEquals(1, dimensionSelector.getRow().size()); + Assert.assertNull(dimensionSelector.lookupName(dimensionSelector.getRow().get(0))); + Assert.assertNull(dimensionSelector.getObject()); } } @@ -309,40 +276,18 @@ public void testNestedColumnIndexerSchemaDiscoveryRootDouble() throws IndexSizeE Assert.assertEquals("3.3", dimensionSelector.getObject()); cursor.advance(); - if (NullHandling.sqlCompatible()) { - Assert.assertNull(valueSelector.getObject()); - Assert.assertTrue(valueSelector.isNull()); - Assert.assertEquals(1, dimensionSelector.getRow().size()); - Assert.assertNull(dimensionSelector.lookupName(dimensionSelector.getRow().get(0))); - Assert.assertNull(dimensionSelector.getObject()); - } else { - Assert.assertEquals(NullHandling.defaultDoubleValue(), valueSelector.getObject()); - Assert.assertFalse(valueSelector.isNull()); - Assert.assertEquals(1, dimensionSelector.getRow().size()); - Assert.assertEquals( - String.valueOf(NullHandling.defaultDoubleValue()), - dimensionSelector.lookupName(dimensionSelector.getRow().get(0)) - ); - Assert.assertEquals(String.valueOf(NullHandling.defaultDoubleValue()), dimensionSelector.getObject()); - } + Assert.assertNull(valueSelector.getObject()); + Assert.assertTrue(valueSelector.isNull()); + Assert.assertEquals(1, dimensionSelector.getRow().size()); + Assert.assertNull(dimensionSelector.lookupName(dimensionSelector.getRow().get(0))); + Assert.assertNull(dimensionSelector.getObject()); cursor.advance(); - if (NullHandling.sqlCompatible()) { - Assert.assertNull(valueSelector.getObject()); - Assert.assertTrue(valueSelector.isNull()); - Assert.assertEquals(1, dimensionSelector.getRow().size()); - Assert.assertNull(dimensionSelector.lookupName(dimensionSelector.getRow().get(0))); - Assert.assertNull(dimensionSelector.getObject()); - } else { - Assert.assertEquals(NullHandling.defaultDoubleValue(), valueSelector.getObject()); - Assert.assertFalse(valueSelector.isNull()); - Assert.assertEquals(1, dimensionSelector.getRow().size()); - Assert.assertEquals( - String.valueOf(NullHandling.defaultDoubleValue()), - dimensionSelector.lookupName(dimensionSelector.getRow().get(0)) - ); - Assert.assertEquals(String.valueOf(NullHandling.defaultDoubleValue()), dimensionSelector.getObject()); - } + Assert.assertNull(valueSelector.getObject()); + Assert.assertTrue(valueSelector.isNull()); + Assert.assertEquals(1, dimensionSelector.getRow().size()); + Assert.assertNull(dimensionSelector.lookupName(dimensionSelector.getRow().get(0))); + Assert.assertNull(dimensionSelector.getObject()); } } diff --git a/processing/src/test/java/org/apache/druid/segment/QueryableIndexColumnCapabilitiesTest.java b/processing/src/test/java/org/apache/druid/segment/QueryableIndexColumnCapabilitiesTest.java index 0832796c4fdb..9f651c883bc9 100644 --- a/processing/src/test/java/org/apache/druid/segment/QueryableIndexColumnCapabilitiesTest.java +++ b/processing/src/test/java/org/apache/druid/segment/QueryableIndexColumnCapabilitiesTest.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.data.input.InputRowSchema; import org.apache.druid.data.input.impl.DimensionSchema; @@ -385,6 +384,6 @@ private void assertNonStringColumnCapabilitiesWithNulls(ColumnCapabilities caps, Assert.assertFalse(caps.hasMultipleValues().isMaybeTrue()); Assert.assertFalse(caps.hasSpatialIndexes()); // check isMaybeTrue because incremental index uses Unknown - Assert.assertEquals(NullHandling.sqlCompatible(), caps.hasNulls().isMaybeTrue()); + Assert.assertTrue(caps.hasNulls().isMaybeTrue()); } } diff --git a/processing/src/test/java/org/apache/druid/segment/RowBasedCursorFactoryTest.java b/processing/src/test/java/org/apache/druid/segment/RowBasedCursorFactoryTest.java index 9c5e79ae95e5..2b2613465084 100644 --- a/processing/src/test/java/org/apache/druid/segment/RowBasedCursorFactoryTest.java +++ b/processing/src/test/java/org/apache/druid/segment/RowBasedCursorFactoryTest.java @@ -24,7 +24,6 @@ import com.google.common.collect.Lists; import com.google.common.math.LongMath; import junitparams.converters.Nullable; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.guava.GuavaUtils; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.Intervals; @@ -99,8 +98,6 @@ public class RowBasedCursorFactoryTest @BeforeClass public static void setUpClass() { - NullHandling.initializeForTests(); - PROCESSORS.clear(); // Read all the types as all the other types. @@ -635,9 +632,9 @@ public void test_makeCursor_allProcessors() "0", // COMPLEX - NullHandling.defaultFloatValue(), - NullHandling.defaultDoubleValue(), - NullHandling.defaultLongValue(), + null, + null, + null, null, null, @@ -679,9 +676,9 @@ public void test_makeCursor_allProcessors() "1", // COMPLEX - NullHandling.defaultFloatValue(), - NullHandling.defaultDoubleValue(), - NullHandling.defaultLongValue(), + null, + null, + null, null, null, diff --git a/processing/src/test/java/org/apache/druid/segment/SchemalessTestFullTest.java b/processing/src/test/java/org/apache/druid/segment/SchemalessTestFullTest.java index 32211b2993f4..d99fad8fde86 100644 --- a/processing/src/test/java/org/apache/druid/segment/SchemalessTestFullTest.java +++ b/processing/src/test/java/org/apache/druid/segment/SchemalessTestFullTest.java @@ -23,7 +23,6 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.Pair; @@ -402,7 +401,7 @@ public void testNonIntersectingSchemas() .put("addRowsIndexConstant", 103.0D) .put("uniques", UNIQUES_1) .put("maxIndex", 100.0D) - .put("minIndex", NullHandling.replaceWithDefault() ? 0.0D : 100.0D) + .put("minIndex", 100.0D) .build() ) ) @@ -749,7 +748,7 @@ public void testValueAndEmptySchemas() .put("addRowsIndexConstant", 103.0D) .put("uniques", UNIQUES_1) .put("maxIndex", 100.0D) - .put("minIndex", NullHandling.replaceWithDefault() ? 0.0D : 100.0D) + .put("minIndex", 100.0D) .build() ) ) @@ -868,11 +867,11 @@ public void testEmptySchemas() new TimeseriesResultValue( TestHelper.makeMap( "rows", 1L, - "index", NullHandling.replaceWithDefault() ? 0.0D : null, - "addRowsIndexConstant", NullHandling.replaceWithDefault() ? 2.0D : null, + "index", null, + "addRowsIndexConstant", null, "uniques", 0.0D, - "maxIndex", NullHandling.replaceWithDefault() ? 0.0D : null, - "minIndex", NullHandling.replaceWithDefault() ? 0.0D : null + "maxIndex", null, + "minIndex", null )) ) ); @@ -883,11 +882,11 @@ public void testEmptySchemas() new TimeseriesResultValue( TestHelper.makeMap( "rows", 0L, - "index", NullHandling.replaceWithDefault() ? 0.0D : null, - "addRowsIndexConstant", NullHandling.replaceWithDefault() ? 1.0D : null, + "index", null, + "addRowsIndexConstant", null, "uniques", 0.0D, - "maxIndex", NullHandling.replaceWithDefault() ? Double.NEGATIVE_INFINITY : null, - "minIndex", NullHandling.replaceWithDefault() ? Double.POSITIVE_INFINITY : null + "maxIndex", null, + "minIndex", null ) ) ) @@ -1178,12 +1177,12 @@ public void testDifferentMetrics() DateTimes.of("2011-01-12T00:00:00.000Z"), new TimeseriesResultValue( ImmutableMap.builder() - .put("rows", NullHandling.sqlCompatible() ? 11L : 10L) + .put("rows", 11L) .put("index", 900.0D) - .put("addRowsIndexConstant", NullHandling.sqlCompatible() ? 912.0D : 911.0D) + .put("addRowsIndexConstant", 912.0D) .put("uniques", UNIQUES_1) .put("maxIndex", 100.0D) - .put("minIndex", NullHandling.replaceWithDefault() ? 0.0D : 100.0D) + .put("minIndex", 100.0D) .build() ) ) diff --git a/processing/src/test/java/org/apache/druid/segment/SchemalessTestSimpleTest.java b/processing/src/test/java/org/apache/druid/segment/SchemalessTestSimpleTest.java index 063e8cc0c2d7..e12c6c099aa9 100644 --- a/processing/src/test/java/org/apache/druid/segment/SchemalessTestSimpleTest.java +++ b/processing/src/test/java/org/apache/druid/segment/SchemalessTestSimpleTest.java @@ -23,7 +23,6 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import org.apache.druid.collections.CloseableStupidPool; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.granularity.Granularities; @@ -58,6 +57,7 @@ import org.apache.druid.segment.incremental.IncrementalIndex; import org.apache.druid.segment.writeout.SegmentWriteOutMediumFactory; import org.apache.druid.testing.InitializedNullHandlingTest; +import org.apache.druid.timeline.SegmentId; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; @@ -85,9 +85,9 @@ public static Collection constructorFeeder() final IncrementalIndex incrementalIndex = SchemalessIndexTest.getIncrementalIndex(); final QueryableIndex persistedIncrementalIndex = TestIndex.persistAndMemoryMap(incrementalIndex); final QueryableIndex mergedIncrementalIndex = schemalessIndexTest.getMergedIncrementalIndex(); - argumentArrays.add(new Object[] {new IncrementalIndexSegment(incrementalIndex, null), false}); - argumentArrays.add(new Object[] {new QueryableIndexSegment(persistedIncrementalIndex, null), false}); - argumentArrays.add(new Object[] {new QueryableIndexSegment(mergedIncrementalIndex, null), true}); + argumentArrays.add(new Object[] {new IncrementalIndexSegment(incrementalIndex, SegmentId.dummy("test"))}); + argumentArrays.add(new Object[] {new QueryableIndexSegment(persistedIncrementalIndex, SegmentId.dummy("test"))}); + argumentArrays.add(new Object[] {new QueryableIndexSegment(mergedIncrementalIndex, SegmentId.dummy("test"))}); } return argumentArrays; } @@ -116,13 +116,10 @@ public static Collection constructorFeeder() ); private final Segment segment; - private final boolean coalesceAbsentAndEmptyDims; - public SchemalessTestSimpleTest(Segment segment, boolean coalesceAbsentAndEmptyDims) + public SchemalessTestSimpleTest(Segment segment) { this.segment = segment; - // Empty and empty dims are equivalent only when replaceWithDefault is true - this.coalesceAbsentAndEmptyDims = coalesceAbsentAndEmptyDims && NullHandling.replaceWithDefault(); } @Test @@ -151,12 +148,12 @@ public void testFullOnTimeseries() DateTimes.of("2011-01-12T00:00:00.000Z"), new TimeseriesResultValue( ImmutableMap.builder() - .put("rows", coalesceAbsentAndEmptyDims ? 10L : 11L) + .put("rows", 11L) .put("index", 900.0) - .put("addRowsIndexConstant", coalesceAbsentAndEmptyDims ? 911.0 : 912.0) + .put("addRowsIndexConstant", 912.0) .put("uniques", 2.000977198748901D) .put("maxIndex", 100.0) - .put("minIndex", NullHandling.replaceWithDefault() ? 0.0 : 100.0) + .put("minIndex", 100.0) .build() ) ) diff --git a/processing/src/test/java/org/apache/druid/segment/TestNullableDoubleColumnSelector.java b/processing/src/test/java/org/apache/druid/segment/TestNullableDoubleColumnSelector.java index 39530701278f..ba2246476d69 100644 --- a/processing/src/test/java/org/apache/druid/segment/TestNullableDoubleColumnSelector.java +++ b/processing/src/test/java/org/apache/druid/segment/TestNullableDoubleColumnSelector.java @@ -19,8 +19,6 @@ package org.apache.druid.segment; -import org.apache.druid.common.config.NullHandling; - public class TestNullableDoubleColumnSelector extends TestDoubleColumnSelector { private final Double[] doubles; @@ -37,8 +35,6 @@ public double getDouble() { if (doubles[index] != null) { return doubles[index]; - } else if (NullHandling.replaceWithDefault()) { - return NullHandling.ZERO_DOUBLE; } else { throw new IllegalStateException("Should never be invoked when current value is null && SQL-compatible null handling is enabled!"); } @@ -47,7 +43,7 @@ public double getDouble() @Override public boolean isNull() { - return !NullHandling.replaceWithDefault() && doubles[index] == null; + return doubles[index] == null; } public void increment() diff --git a/processing/src/test/java/org/apache/druid/segment/TestNullableFloatColumnSelector.java b/processing/src/test/java/org/apache/druid/segment/TestNullableFloatColumnSelector.java index a96b31cb92eb..8e334be085f6 100644 --- a/processing/src/test/java/org/apache/druid/segment/TestNullableFloatColumnSelector.java +++ b/processing/src/test/java/org/apache/druid/segment/TestNullableFloatColumnSelector.java @@ -19,8 +19,6 @@ package org.apache.druid.segment; -import org.apache.druid.common.config.NullHandling; - public class TestNullableFloatColumnSelector extends TestFloatColumnSelector { @@ -38,8 +36,6 @@ public float getFloat() { if (floats[index] != null) { return floats[index]; - } else if (NullHandling.replaceWithDefault()) { - return NullHandling.ZERO_FLOAT; } else { throw new IllegalStateException("Should never be invoked when current value is null && SQL-compatible null handling is enabled!"); } @@ -48,7 +44,7 @@ public float getFloat() @Override public boolean isNull() { - return !NullHandling.replaceWithDefault() && floats[index] == null; + return floats[index] == null; } public void increment() diff --git a/processing/src/test/java/org/apache/druid/segment/TestNullableLongColumnSelector.java b/processing/src/test/java/org/apache/druid/segment/TestNullableLongColumnSelector.java index a30b6c9e353d..12599c863b27 100644 --- a/processing/src/test/java/org/apache/druid/segment/TestNullableLongColumnSelector.java +++ b/processing/src/test/java/org/apache/druid/segment/TestNullableLongColumnSelector.java @@ -19,8 +19,6 @@ package org.apache.druid.segment; -import org.apache.druid.common.config.NullHandling; - public class TestNullableLongColumnSelector extends TestLongColumnSelector { private final Long[] longs; @@ -37,8 +35,6 @@ public long getLong() { if (longs[index] != null) { return longs[index]; - } else if (NullHandling.replaceWithDefault()) { - return NullHandling.ZERO_LONG; } else { throw new IllegalStateException("Should never be invoked when current value is null && SQL-compatible null handling is enabled!"); } @@ -47,7 +43,7 @@ public long getLong() @Override public boolean isNull() { - return !NullHandling.replaceWithDefault() && longs[index] == null; + return longs[index] == null; } public void increment() diff --git a/processing/src/test/java/org/apache/druid/segment/UnnestColumnValueSelectorCursorTest.java b/processing/src/test/java/org/apache/druid/segment/UnnestColumnValueSelectorCursorTest.java index 475f26833823..5e60b1e04962 100644 --- a/processing/src/test/java/org/apache/druid/segment/UnnestColumnValueSelectorCursorTest.java +++ b/processing/src/test/java/org/apache/druid/segment/UnnestColumnValueSelectorCursorTest.java @@ -19,7 +19,6 @@ package org.apache.druid.segment; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.math.expr.ExprMacroTable; import org.apache.druid.query.dimension.DefaultDimensionSpec; import org.apache.druid.query.monomorphicprocessing.StringRuntimeShape; @@ -28,7 +27,6 @@ import org.apache.druid.testing.InitializedNullHandlingTest; import org.junit.AfterClass; import org.junit.Assert; -import org.junit.BeforeClass; import org.junit.Test; import java.util.ArrayList; @@ -40,12 +38,6 @@ public class UnnestColumnValueSelectorCursorTest extends InitializedNullHandling { private static String OUTPUT_NAME = "unnested-column"; - @BeforeClass - public static void setUpClass() - { - NullHandling.initializeForTests(); - } - @AfterClass public static void tearDownClass() { diff --git a/processing/src/test/java/org/apache/druid/segment/WrappingDimensionSelectorTest.java b/processing/src/test/java/org/apache/druid/segment/WrappingDimensionSelectorTest.java index fd4ebf69b308..8acf1a2520fd 100644 --- a/processing/src/test/java/org/apache/druid/segment/WrappingDimensionSelectorTest.java +++ b/processing/src/test/java/org/apache/druid/segment/WrappingDimensionSelectorTest.java @@ -19,7 +19,6 @@ package org.apache.druid.segment; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.extraction.DimExtractionFn; import org.apache.druid.testing.InitializedNullHandlingTest; import org.junit.Assert; @@ -40,13 +39,8 @@ public void testLongWrappingDimensionSelector() Assert.assertEquals("24", lngWrapSelector.getValue()); lngSelector.increment(); - if (NullHandling.sqlCompatible()) { - Assert.assertTrue(lngSelector.isNull()); - Assert.assertNull(lngWrapSelector.getValue()); - } else { - Assert.assertEquals(0L, lngSelector.getLong()); - Assert.assertEquals("0", lngWrapSelector.getValue()); - } + Assert.assertTrue(lngSelector.isNull()); + Assert.assertNull(lngWrapSelector.getValue()); lngSelector.increment(); Assert.assertEquals(50L, lngSelector.getLong()); @@ -72,13 +66,8 @@ public void testDoubleWrappingDimensionSelector() Assert.assertEquals("32.0", dblWrapSelector.getValue()); dblSelector.increment(); - if (NullHandling.sqlCompatible()) { - Assert.assertTrue(dblSelector.isNull()); - Assert.assertNull(dblWrapSelector.getValue()); - } else { - Assert.assertEquals(0d, dblSelector.getDouble(), 0); - Assert.assertEquals("0.0", dblWrapSelector.getValue()); - } + Assert.assertTrue(dblSelector.isNull()); + Assert.assertNull(dblWrapSelector.getValue()); dblSelector.increment(); Assert.assertEquals(5.0d, dblSelector.getDouble(), 0); @@ -104,13 +93,8 @@ public void testFloatWrappingDimensionSelector() Assert.assertEquals("32.0", flWrapSelector.getValue()); flSelector.increment(); - if (NullHandling.sqlCompatible()) { - Assert.assertTrue(flSelector.isNull()); - Assert.assertNull(flWrapSelector.getValue()); - } else { - Assert.assertEquals(0f, flSelector.getFloat(), 0); - Assert.assertEquals("0.0", flWrapSelector.getValue()); - } + Assert.assertTrue(flSelector.isNull()); + Assert.assertNull(flWrapSelector.getValue()); flSelector.increment(); Assert.assertEquals(5.0f, flSelector.getFloat(), 0); @@ -137,13 +121,8 @@ public void testLongWrappingDimensionSelectorExtractionFn() Assert.assertEquals("24x", lngWrapSelector.getValue()); lngSelector.increment(); - if (NullHandling.sqlCompatible()) { - Assert.assertTrue(lngSelector.isNull()); - Assert.assertEquals("nullx", lngWrapSelector.getValue()); - } else { - Assert.assertEquals(0L, lngSelector.getLong()); - Assert.assertEquals("0x", lngWrapSelector.getValue()); - } + Assert.assertTrue(lngSelector.isNull()); + Assert.assertEquals("nullx", lngWrapSelector.getValue()); lngSelector.increment(); Assert.assertEquals(50L, lngSelector.getLong()); @@ -170,13 +149,8 @@ public void testDoubleWrappingDimensionSelectorExtractionFn() Assert.assertEquals("32.0x", dblWrapSelector.getValue()); dblSelector.increment(); - if (NullHandling.sqlCompatible()) { - Assert.assertTrue(dblSelector.isNull()); - Assert.assertEquals("nullx", dblWrapSelector.getValue()); - } else { - Assert.assertEquals(0d, dblSelector.getDouble(), 0); - Assert.assertEquals("0.0x", dblWrapSelector.getValue()); - } + Assert.assertTrue(dblSelector.isNull()); + Assert.assertEquals("nullx", dblWrapSelector.getValue()); dblSelector.increment(); Assert.assertEquals(5.0d, dblSelector.getDouble(), 0); @@ -203,13 +177,8 @@ public void testFloatWrappingDimensionSelectorExtractionFn() Assert.assertEquals("32.0x", flWrapSelector.getValue()); flSelector.increment(); - if (NullHandling.sqlCompatible()) { - Assert.assertTrue(flSelector.isNull()); - Assert.assertEquals("nullx", flWrapSelector.getValue()); - } else { - Assert.assertEquals(0f, flSelector.getFloat(), 0); - Assert.assertEquals("0.0x", flWrapSelector.getValue()); - } + Assert.assertTrue(flSelector.isNull()); + Assert.assertEquals("nullx", flWrapSelector.getValue()); flSelector.increment(); Assert.assertEquals(5.0f, flSelector.getFloat(), 0); diff --git a/processing/src/test/java/org/apache/druid/segment/column/SchemaPayloadPlusTest.java b/processing/src/test/java/org/apache/druid/segment/column/SchemaPayloadPlusTest.java index 9fb08fb74ff9..0c2c692ccc08 100644 --- a/processing/src/test/java/org/apache/druid/segment/column/SchemaPayloadPlusTest.java +++ b/processing/src/test/java/org/apache/druid/segment/column/SchemaPayloadPlusTest.java @@ -20,7 +20,6 @@ package org.apache.druid.segment.column; import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.aggregation.firstlast.last.StringLastAggregatorFactory; import org.apache.druid.segment.SchemaPayload; import org.apache.druid.segment.SchemaPayloadPlus; @@ -33,11 +32,6 @@ public class SchemaPayloadPlusTest { - - static { - NullHandling.initializeForTests(); - } - private ObjectMapper mapper = TestHelper.makeJsonMapper(); @Test diff --git a/processing/src/test/java/org/apache/druid/segment/column/SchemaPayloadTest.java b/processing/src/test/java/org/apache/druid/segment/column/SchemaPayloadTest.java index dfb352775638..99477b0043fa 100644 --- a/processing/src/test/java/org/apache/druid/segment/column/SchemaPayloadTest.java +++ b/processing/src/test/java/org/apache/druid/segment/column/SchemaPayloadTest.java @@ -20,7 +20,6 @@ package org.apache.druid.segment.column; import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.aggregation.firstlast.last.StringLastAggregatorFactory; import org.apache.druid.segment.SchemaPayload; import org.apache.druid.segment.TestHelper; @@ -32,11 +31,6 @@ public class SchemaPayloadTest { - - static { - NullHandling.initializeForTests(); - } - private ObjectMapper mapper = TestHelper.makeJsonMapper(); @Test diff --git a/processing/src/test/java/org/apache/druid/segment/column/SegmentSchemaMappingTest.java b/processing/src/test/java/org/apache/druid/segment/column/SegmentSchemaMappingTest.java index 4272e67433cc..b4d6716db4bb 100644 --- a/processing/src/test/java/org/apache/druid/segment/column/SegmentSchemaMappingTest.java +++ b/processing/src/test/java/org/apache/druid/segment/column/SegmentSchemaMappingTest.java @@ -20,7 +20,6 @@ package org.apache.druid.segment.column; import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.aggregation.firstlast.last.StringLastAggregatorFactory; import org.apache.druid.segment.SchemaPayload; import org.apache.druid.segment.SchemaPayloadPlus; @@ -36,10 +35,6 @@ public class SegmentSchemaMappingTest { - static { - NullHandling.initializeForTests(); - } - private ObjectMapper mapper = TestHelper.makeJsonMapper(); @Test diff --git a/processing/src/test/java/org/apache/druid/segment/data/GenericIndexedWriterTest.java b/processing/src/test/java/org/apache/druid/segment/data/GenericIndexedWriterTest.java index 38c67d69bad0..96984c5a89b8 100644 --- a/processing/src/test/java/org/apache/druid/segment/data/GenericIndexedWriterTest.java +++ b/processing/src/test/java/org/apache/druid/segment/data/GenericIndexedWriterTest.java @@ -19,10 +19,8 @@ package org.apache.druid.segment.data; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.io.smoosh.FileSmoosher; import org.apache.druid.segment.writeout.OnHeapMemorySegmentWriteOutMedium; -import org.junit.BeforeClass; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; @@ -36,12 +34,6 @@ public class GenericIndexedWriterTest @Rule public TemporaryFolder temporaryFolder = new TemporaryFolder(); - @BeforeClass - public static void staticSetUp() - { - NullHandling.initializeForTests(); - } - @Test public void writeLargeValueIntoLargeColumn() throws IOException { diff --git a/processing/src/test/java/org/apache/druid/segment/data/IncrementalIndexTest.java b/processing/src/test/java/org/apache/druid/segment/data/IncrementalIndexTest.java index 55bf31d8c176..649613090134 100644 --- a/processing/src/test/java/org/apache/druid/segment/data/IncrementalIndexTest.java +++ b/processing/src/test/java/org/apache/druid/segment/data/IncrementalIndexTest.java @@ -29,7 +29,6 @@ import com.google.common.util.concurrent.ListeningExecutorService; import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.ThreadFactoryBuilder; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.MapBasedInputRow; import org.apache.druid.data.input.Row; import org.apache.druid.data.input.impl.DimensionsSpec; @@ -749,8 +748,7 @@ public void testSchemaRollupWithRowWithExistingMetricsAndWithoutMetric() throws Assert.assertEquals(1 + rowCount, row.getMetric("sum_of_x").intValue()); } else { Assert.assertEquals(1, row.getMetric("count").intValue()); - // The rows does not have the dim "x", hence metric is null (useDefaultValueForNull=false) or 0 (useDefaultValueForNull=true) - Assert.assertEquals(NullHandling.sqlCompatible() ? null : 0L, row.getMetric("sum_of_x")); + Assert.assertNull(row.getMetric("sum_of_x")); } } } @@ -817,8 +815,7 @@ public void testSchemaRollupWithRowWithExistingMetricsAndWithoutMetricUsingAggre Assert.assertEquals(1 + rowCount, row.getMetric("sum_of_x").intValue()); } else { Assert.assertEquals(1, row.getMetric("count").intValue()); - // The rows does not have the dim "x", hence metric is null (useDefaultValueForNull=false) or 0 (useDefaultValueForNull=true) - Assert.assertEquals(NullHandling.sqlCompatible() ? null : 0.0f, row.getMetric("sum_of_x")); + Assert.assertNull(row.getMetric("sum_of_x")); } } } @@ -867,8 +864,7 @@ public void testSchemaRollupWithRowWithOnlyExistingMetrics() throws IndexSizeExc Assert.assertEquals(4, row.getMetric("sum_of_x").intValue()); } else { Assert.assertEquals(1, row.getMetric("count").intValue()); - // The rows does not have the dim "x", hence metric is null (useDefaultValueForNull=false) or 0 (useDefaultValueForNull=true) - Assert.assertEquals(NullHandling.sqlCompatible() ? null : 0L, row.getMetric("sum_of_x")); + Assert.assertNull(row.getMetric("sum_of_x")); } } else { Assert.assertEquals(isPreserveExistingMetrics ? 3 : 1, row.getMetric("count").intValue()); @@ -966,8 +962,7 @@ public void testSchemaRollupWithRowWithMixedTypeMetrics() throws IndexSizeExceed // We still have 2 rows if (rowCount == 1) { Assert.assertEquals(1, row.getMetric("count").intValue()); - // The rows does not have the dim "x", hence metric is null (useDefaultValueForNull=false) or 0 (useDefaultValueForNull=true) - Assert.assertEquals(NullHandling.sqlCompatible() ? null : 0L, row.getMetric("sum_of_x")); + Assert.assertNull(row.getMetric("sum_of_x")); } else { Assert.assertEquals(1, row.getMetric("count").intValue()); Assert.assertEquals(3, row.getMetric("sum_of_x").intValue()); diff --git a/processing/src/test/java/org/apache/druid/segment/filter/ArrayContainsElementFilterTests.java b/processing/src/test/java/org/apache/druid/segment/filter/ArrayContainsElementFilterTests.java index 6830040bab88..4c459deed526 100644 --- a/processing/src/test/java/org/apache/druid/segment/filter/ArrayContainsElementFilterTests.java +++ b/processing/src/test/java/org/apache/druid/segment/filter/ArrayContainsElementFilterTests.java @@ -25,7 +25,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import nl.jqno.equalsverifier.EqualsVerifier; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; import org.apache.druid.guice.BuiltInTypesModule; import org.apache.druid.jackson.DefaultObjectMapper; @@ -102,9 +101,7 @@ public void testArrayStringColumn() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("1", "4", "5") - : ImmutableList.of("1", "2", "4", "5") + ImmutableList.of("1", "4", "5") ); assertFilterMatches( @@ -125,9 +122,7 @@ public void testArrayStringColumn() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("1", "5") - : ImmutableList.of("1", "2", "5") + ImmutableList.of("1", "5") ); assertFilterMatches( @@ -148,9 +143,7 @@ public void testArrayStringColumn() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("0", "1", "3", "4") - : ImmutableList.of("0", "1", "2", "3", "4") + ImmutableList.of("0", "1", "3", "4") ); } @@ -185,9 +178,7 @@ public void testArrayLongColumn() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("1", "4", "5") - : ImmutableList.of("1", "3", "4", "5") + ImmutableList.of("1", "4", "5") ); assertFilterMatches( @@ -208,9 +199,7 @@ public void testArrayLongColumn() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("0", "1", "2", "5") - : ImmutableList.of("0", "1", "2", "3", "5") + ImmutableList.of("0", "1", "2", "5") ); assertFilterMatches( @@ -266,9 +255,7 @@ public void testArrayDoubleColumn() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("2", "3", "4") - : ImmutableList.of("2", "3", "4", "5") + ImmutableList.of("2", "3", "4") ); assertFilterMatches( @@ -315,9 +302,7 @@ public void testArrayStringColumnContainsArrays() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("0", "1", "3", "4", "5") - : ImmutableList.of("0", "1", "2", "3", "4", "5") + ImmutableList.of("0", "1", "3", "4", "5") ); } @@ -345,9 +330,7 @@ public void testArrayLongColumnContainsArrays() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("0", "1", "2", "4", "5") - : ImmutableList.of("0", "1", "2", "3", "4", "5") + ImmutableList.of("0", "1", "2", "4", "5") ); } @@ -374,9 +357,7 @@ public void testArrayDoubleColumnContainsArrays() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("0", "1", "2", "3", "4") - : ImmutableList.of("0", "1", "2", "3", "4", "5") + ImmutableList.of("0", "1", "2", "3", "4") ); } @@ -485,22 +466,18 @@ public void testArrayContainsMvd() if (isAutoSchema()) { assertFilterMatches( NotDimFilter.of(new ArrayContainsElementFilter("dim2", ColumnType.STRING, "a", null)), - NullHandling.sqlCompatible() - ? ImmutableList.of("1", "2", "4") - : ImmutableList.of("1", "2", "4", "5") + ImmutableList.of("1", "2", "4") ); // [""] becomes [null] in default value mode assertFilterMatches( new ArrayContainsElementFilter("dim2", ColumnType.STRING, null, null), - NullHandling.sqlCompatible() ? ImmutableList.of() : ImmutableList.of("2") + ImmutableList.of() ); } else { // multi-value dimension treats [] as null, so in sql compatible mode row 1 ends up as not matching assertFilterMatches( NotDimFilter.of(new ArrayContainsElementFilter("dim2", ColumnType.STRING, "a", null)), - NullHandling.sqlCompatible() - ? ImmutableList.of("2", "4") - : ImmutableList.of("1", "2", "4", "5") + ImmutableList.of("2", "4") ); assertFilterMatches( new ArrayContainsElementFilter("dim2", ColumnType.STRING, null, null), @@ -542,9 +519,7 @@ public void testNestedArrayStringColumn() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("1", "4", "5") - : ImmutableList.of("1", "2", "4", "5") + ImmutableList.of("1", "4", "5") ); assertFilterMatches( @@ -565,9 +540,7 @@ public void testNestedArrayStringColumn() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("1", "5") - : ImmutableList.of("1", "2", "5") + ImmutableList.of("1", "5") ); assertFilterMatches( @@ -588,9 +561,7 @@ public void testNestedArrayStringColumn() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("0", "1", "3", "4") - : ImmutableList.of("0", "1", "2", "3", "4") + ImmutableList.of("0", "1", "3", "4") ); } @@ -626,9 +597,7 @@ public void testNestedArrayLongColumn() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("1", "4", "5") - : ImmutableList.of("1", "3", "4", "5") + ImmutableList.of("1", "4", "5") ); assertFilterMatches( @@ -649,9 +618,7 @@ public void testNestedArrayLongColumn() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("0", "1", "2", "5") - : ImmutableList.of("0", "1", "2", "3", "5") + ImmutableList.of("0", "1", "2", "5") ); assertFilterMatches( @@ -708,9 +675,7 @@ public void testNestedArrayDoubleColumn() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("2", "3", "4") - : ImmutableList.of("2", "3", "4", "5") + ImmutableList.of("2", "3", "4") ); assertFilterMatches( @@ -758,9 +723,7 @@ public void testNestedArrayStringColumnContainsArrays() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("0", "1", "3", "4", "5") - : ImmutableList.of("0", "1", "2", "3", "4", "5") + ImmutableList.of("0", "1", "3", "4", "5") ); } @@ -789,9 +752,7 @@ public void testNestedArrayLongColumnContainsArrays() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("0", "1", "2", "4", "5") - : ImmutableList.of("0", "1", "2", "3", "4", "5") + ImmutableList.of("0", "1", "2", "4", "5") ); } @@ -819,9 +780,7 @@ public void testNestedArrayDoubleColumnContainsArrays() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("0", "1", "2", "3", "4") - : ImmutableList.of("0", "1", "2", "3", "4", "5") + ImmutableList.of("0", "1", "2", "3", "4") ); } diff --git a/processing/src/test/java/org/apache/druid/segment/filter/BaseFilterTest.java b/processing/src/test/java/org/apache/druid/segment/filter/BaseFilterTest.java index a174bc9e6679..bddbf7f453fc 100644 --- a/processing/src/test/java/org/apache/druid/segment/filter/BaseFilterTest.java +++ b/processing/src/test/java/org/apache/druid/segment/filter/BaseFilterTest.java @@ -25,7 +25,6 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Maps; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.guava.SettableSupplier; import org.apache.druid.data.input.InputRow; import org.apache.druid.data.input.impl.DimensionSchema; @@ -108,7 +107,6 @@ import org.apache.druid.segment.writeout.TmpFileSegmentWriteOutMediumFactory; import org.apache.druid.testing.InitializedNullHandlingTest; import org.junit.Assert; -import org.junit.Assume; import org.junit.Before; import org.junit.Rule; import org.junit.rules.TemporaryFolder; @@ -116,8 +114,6 @@ import javax.annotation.Nullable; import java.io.Closeable; -import java.io.File; -import java.io.IOException; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Arrays; @@ -414,11 +410,6 @@ public static InputRow makeSchemaRow( protected final boolean optimize; protected final String testName; - // 'rowBasedWithoutTypeSignature' does not handle numeric null default values correctly, is equivalent to - // druid.generic.useDefaultValueForNull being set to false, regardless of how it is actually set. - // In other words, numeric null values will be treated as nulls instead of the default value - protected final boolean canTestNumericNullsAsDefaultValues; - protected CursorFactory cursorFactory; protected VirtualColumns virtualColumns; @@ -445,8 +436,6 @@ public BaseFilterTest( this.finisher = finisher; this.cnf = cnf; this.optimize = optimize; - this.canTestNumericNullsAsDefaultValues = - NullHandling.replaceWithDefault() && !testName.contains("finisher[rowBasedWithoutTypeSignature]"); } @Before @@ -630,31 +619,6 @@ public static Collection makeConstructors() return Pair.of(new QueryableIndexCursorFactory(index), index); } ) - .put( - "mmappedWithSqlCompatibleNulls", - input -> { - // Build mmapped index in SQL-compatible null handling mode; read it in default-value mode. - Assume.assumeTrue(NullHandling.replaceWithDefault()); - final File file; - try { - NullHandling.initializeForTestsWithValues(false, null); - Assert.assertTrue(NullHandling.sqlCompatible()); - file = input.buildMMappedIndexFile(); - } - finally { - NullHandling.initializeForTests(); - } - - Assert.assertTrue(NullHandling.replaceWithDefault()); - try { - final QueryableIndex index = input.getIndexIO().loadIndex(file); - return Pair.of(new QueryableIndexCursorFactory(index), index); - } - catch (IOException e) { - throw new RuntimeException(e); - } - } - ) .put( "rowBasedWithoutTypeSignature", input -> Pair.of(input.buildRowBasedSegmentWithoutTypeSignature().asCursorFactory(), () -> {}) @@ -782,7 +746,7 @@ private Filter makeFilter(final DimFilter dimFilter) return null; } - final DimFilter maybeOptimized = optimize ? dimFilter.optimize(false) : dimFilter; + final DimFilter maybeOptimized = maybeOptimize(dimFilter); final Filter filter = maybeOptimized.toFilter(); try { return cnf ? Filters.toCnf(filter) : filter; diff --git a/processing/src/test/java/org/apache/druid/segment/filter/BoundFilterTest.java b/processing/src/test/java/org/apache/druid/segment/filter/BoundFilterTest.java index 69d80b3f3a2c..b82643935411 100644 --- a/processing/src/test/java/org/apache/druid/segment/filter/BoundFilterTest.java +++ b/processing/src/test/java/org/apache/druid/segment/filter/BoundFilterTest.java @@ -23,7 +23,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import nl.jqno.equalsverifier.EqualsVerifier; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.java.util.common.IAE; import org.apache.druid.java.util.common.Pair; @@ -111,20 +110,11 @@ public void testLexicographicMatchWithEmptyString() new BoundDimFilter("dim2", "", "z", false, false, false, null, StringComparators.LEXICOGRAPHIC), new BoundDimFilter("dim3", "", "z", false, false, false, null, StringComparators.LEXICOGRAPHIC) ); - if (NullHandling.replaceWithDefault()) { - for (BoundDimFilter filter : filters) { - if (filter.getDimension().equals("dim2")) { - assertFilterMatchesSkipArrays(filter, ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7")); - } else { - assertFilterMatches(filter, ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7")); - } - } - } else { - assertFilterMatches(filters.get(0), ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7")); - assertFilterMatches(filters.get(1), ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7")); - assertFilterMatchesSkipArrays(filters.get(2), ImmutableList.of("0", "2", "3", "4", "6", "7")); - assertFilterMatches(filters.get(3), ImmutableList.of()); - } + + assertFilterMatches(filters.get(0), ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7")); + assertFilterMatches(filters.get(1), ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7")); + assertFilterMatchesSkipArrays(filters.get(2), ImmutableList.of("0", "2", "3", "4", "6", "7")); + assertFilterMatches(filters.get(3), ImmutableList.of()); } @Test @@ -138,49 +128,28 @@ public void testLexicographicMatchNull() new BoundDimFilter("dim1", "", "", false, false, false, null, StringComparators.LEXICOGRAPHIC), ImmutableList.of("0") ); - if (NullHandling.replaceWithDefault()) { - assertFilterMatchesSkipArrays( - new BoundDimFilter("dim2", "", "", false, false, false, null, StringComparators.LEXICOGRAPHIC), - ImmutableList.of("1", "2", "5") - ); - } else { - assertFilterMatchesSkipArrays( - new BoundDimFilter("dim2", "", "", false, false, false, null, StringComparators.LEXICOGRAPHIC), - ImmutableList.of("2") - ); - } + + assertFilterMatchesSkipArrays( + new BoundDimFilter("dim2", "", "", false, false, false, null, StringComparators.LEXICOGRAPHIC), + ImmutableList.of("2") + ); } @Test public void testLexicographicMatchMissingColumn() { - if (NullHandling.replaceWithDefault()) { - assertFilterMatches( - new BoundDimFilter("dim3", "", "", false, false, false, null, StringComparators.LEXICOGRAPHIC), - ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7") - ); - assertFilterMatches( - new BoundDimFilter("dim3", "", null, false, true, false, null, StringComparators.LEXICOGRAPHIC), - ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7") - ); - assertFilterMatches( - new BoundDimFilter("dim3", null, "", false, true, false, null, StringComparators.LEXICOGRAPHIC), - ImmutableList.of() - ); - } else { - assertFilterMatches( - new BoundDimFilter("dim3", "", "", false, false, false, null, StringComparators.LEXICOGRAPHIC), - ImmutableList.of() - ); - assertFilterMatches( - new BoundDimFilter("dim3", "", null, false, true, false, null, StringComparators.LEXICOGRAPHIC), - ImmutableList.of() - ); - assertFilterMatches( - new BoundDimFilter("dim3", null, "", false, true, false, null, StringComparators.LEXICOGRAPHIC), - ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7") - ); - } + assertFilterMatches( + new BoundDimFilter("dim3", "", "", false, false, false, null, StringComparators.LEXICOGRAPHIC), + ImmutableList.of() + ); + assertFilterMatches( + new BoundDimFilter("dim3", "", null, false, true, false, null, StringComparators.LEXICOGRAPHIC), + ImmutableList.of() + ); + assertFilterMatches( + new BoundDimFilter("dim3", null, "", false, true, false, null, StringComparators.LEXICOGRAPHIC), + ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7") + ); assertFilterMatches( new BoundDimFilter("dim3", "", "", true, false, false, null, StringComparators.LEXICOGRAPHIC), ImmutableList.of() @@ -194,17 +163,10 @@ public void testLexicographicMatchMissingColumn() new BoundDimFilter("dim3", null, "", false, false, false, null, StringComparators.LEXICOGRAPHIC), ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7") ); - if (NullHandling.sqlCompatible()) { - assertFilterMatches( - new BoundDimFilter("dim3", null, "", false, true, false, null, StringComparators.LEXICOGRAPHIC), - ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7") - ); - } else { - assertFilterMatches( - new BoundDimFilter("dim3", null, "", false, true, false, null, StringComparators.LEXICOGRAPHIC), - ImmutableList.of() - ); - } + assertFilterMatches( + new BoundDimFilter("dim3", null, "", false, true, false, null, StringComparators.LEXICOGRAPHIC), + ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7") + ); } @@ -289,25 +251,15 @@ public void testAlphaNumericMatchNull() new BoundDimFilter("dim1", "", "", false, false, true, null, StringComparators.ALPHANUMERIC), ImmutableList.of("0") ); - if (NullHandling.replaceWithDefault()) { - assertFilterMatchesSkipArrays( - new BoundDimFilter("dim2", "", "", false, false, true, null, StringComparators.ALPHANUMERIC), - ImmutableList.of("1", "2", "5") - ); - assertFilterMatches( - new BoundDimFilter("dim3", "", "", false, false, true, null, StringComparators.ALPHANUMERIC), - ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7") - ); - } else { - assertFilterMatchesSkipArrays( - new BoundDimFilter("dim2", "", "", false, false, true, null, StringComparators.ALPHANUMERIC), - ImmutableList.of("2") - ); - assertFilterMatches( - new BoundDimFilter("dim3", "", "", false, false, true, null, StringComparators.ALPHANUMERIC), - ImmutableList.of() - ); - } + + assertFilterMatchesSkipArrays( + new BoundDimFilter("dim2", "", "", false, false, true, null, StringComparators.ALPHANUMERIC), + ImmutableList.of("2") + ); + assertFilterMatches( + new BoundDimFilter("dim3", "", "", false, false, true, null, StringComparators.ALPHANUMERIC), + ImmutableList.of() + ); } @Test @@ -398,25 +350,14 @@ public void testNumericMatchNull() new BoundDimFilter("dim1", "", "", false, false, false, null, StringComparators.NUMERIC), ImmutableList.of("0") ); - if (NullHandling.replaceWithDefault()) { - assertFilterMatchesSkipArrays( - new BoundDimFilter("dim2", "", "", false, false, false, null, StringComparators.NUMERIC), - ImmutableList.of("1", "2", "5") - ); - assertFilterMatches( - new BoundDimFilter("dim3", "", "", false, false, false, null, StringComparators.NUMERIC), - ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7") - ); - } else { - assertFilterMatchesSkipArrays( - new BoundDimFilter("dim2", "", "", false, false, false, null, StringComparators.NUMERIC), - ImmutableList.of("2") - ); - assertFilterMatches( - new BoundDimFilter("dim3", "", "", false, false, false, null, StringComparators.NUMERIC), - ImmutableList.of() - ); - } + assertFilterMatchesSkipArrays( + new BoundDimFilter("dim2", "", "", false, false, false, null, StringComparators.NUMERIC), + ImmutableList.of("2") + ); + assertFilterMatches( + new BoundDimFilter("dim3", "", "", false, false, false, null, StringComparators.NUMERIC), + ImmutableList.of() + ); } @@ -579,17 +520,10 @@ public void testMatchWithExtractionFn() String nullJsFn = "function(str) { return null; }"; ExtractionFn makeNullFn = new JavaScriptExtractionFn(nullJsFn, false, JavaScriptConfig.getEnabledInstance()); - if (NullHandling.replaceWithDefault()) { - assertFilterMatches( - new BoundDimFilter("dim0", "", "", false, false, false, makeNullFn, StringComparators.LEXICOGRAPHIC), - ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7") - ); - } else { - assertFilterMatches( - new BoundDimFilter("dim0", "", "", false, false, false, makeNullFn, StringComparators.LEXICOGRAPHIC), - ImmutableList.of() - ); - } + assertFilterMatches( + new BoundDimFilter("dim0", "", "", false, false, false, makeNullFn, StringComparators.LEXICOGRAPHIC), + ImmutableList.of() + ); assertFilterMatches( new BoundDimFilter( @@ -624,69 +558,41 @@ public void testMatchWithExtractionFn() ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7") ); - if (NullHandling.replaceWithDefault()) { - assertFilterMatchesSkipArrays( - new BoundDimFilter( - "dim2", - "super-null", - "super-null", - false, - false, - false, - superFn, - StringComparators.LEXICOGRAPHIC - ), - ImmutableList.of("1", "2", "5") - ); - assertFilterMatchesSkipArrays( - new BoundDimFilter( - "dim2", - "super-null", - "super-null", - false, - false, - false, - superFn, - StringComparators.NUMERIC - ), - ImmutableList.of("1", "2", "5") - ); - } else { - assertFilterMatchesSkipArrays( - new BoundDimFilter( - "dim2", - "super-null", - "super-null", - false, - false, - false, - superFn, - StringComparators.LEXICOGRAPHIC - ), - ImmutableList.of("1", "5") - ); - assertFilterMatchesSkipArrays( - new BoundDimFilter("dim2", "super-", "super-", false, false, false, superFn, StringComparators.NUMERIC), - ImmutableList.of("2") - ); - assertFilterMatchesSkipArrays( - new BoundDimFilter( - "dim2", - "super-null", - "super-null", - false, - false, - false, - superFn, - StringComparators.LEXICOGRAPHIC - ), - ImmutableList.of("1", "5") - ); - assertFilterMatchesSkipArrays( - new BoundDimFilter("dim2", "super-", "super-", false, false, false, superFn, StringComparators.NUMERIC), - ImmutableList.of("2") - ); - } + + assertFilterMatchesSkipArrays( + new BoundDimFilter( + "dim2", + "super-null", + "super-null", + false, + false, + false, + superFn, + StringComparators.LEXICOGRAPHIC + ), + ImmutableList.of("1", "5") + ); + assertFilterMatchesSkipArrays( + new BoundDimFilter("dim2", "super-", "super-", false, false, false, superFn, StringComparators.NUMERIC), + ImmutableList.of("2") + ); + assertFilterMatchesSkipArrays( + new BoundDimFilter( + "dim2", + "super-null", + "super-null", + false, + false, + false, + superFn, + StringComparators.LEXICOGRAPHIC + ), + ImmutableList.of("1", "5") + ); + assertFilterMatchesSkipArrays( + new BoundDimFilter("dim2", "super-", "super-", false, false, false, superFn, StringComparators.NUMERIC), + ImmutableList.of("2") + ); assertFilterMatches( new BoundDimFilter( @@ -736,7 +642,7 @@ public void testNumericNullsAndZeros() null, StringComparators.NUMERIC ), - canTestNumericNullsAsDefaultValues ? ImmutableList.of("0", "2", "7") : ImmutableList.of("0") + ImmutableList.of("0") ); assertFilterMatches( @@ -750,7 +656,7 @@ public void testNumericNullsAndZeros() null, StringComparators.NUMERIC ), - canTestNumericNullsAsDefaultValues ? ImmutableList.of("0", "4", "6") : ImmutableList.of("0") + ImmutableList.of("0") ); assertFilterMatches( @@ -764,9 +670,7 @@ public void testNumericNullsAndZeros() null, StringComparators.NUMERIC ), - NullHandling.replaceWithDefault() && canTestNumericNullsAsDefaultValues - ? ImmutableList.of("0", "3", "7") - : ImmutableList.of("0") + ImmutableList.of("0") ); } @@ -784,7 +688,7 @@ public void testVirtualNumericNullsAndZeros() null, StringComparators.NUMERIC ), - canTestNumericNullsAsDefaultValues ? ImmutableList.of("0", "2", "7") : ImmutableList.of("0") + ImmutableList.of("0") ); assertFilterMatches( @@ -798,7 +702,7 @@ public void testVirtualNumericNullsAndZeros() null, StringComparators.NUMERIC ), - canTestNumericNullsAsDefaultValues ? ImmutableList.of("0", "4", "6") : ImmutableList.of("0") + ImmutableList.of("0") ); assertFilterMatches( @@ -812,9 +716,7 @@ public void testVirtualNumericNullsAndZeros() null, StringComparators.NUMERIC ), - NullHandling.replaceWithDefault() && canTestNumericNullsAsDefaultValues - ? ImmutableList.of("0", "3", "7") - : ImmutableList.of("0") + ImmutableList.of("0") ); assertFilterMatches( @@ -828,9 +730,7 @@ public void testVirtualNumericNullsAndZeros() null, StringComparators.NUMERIC ), - NullHandling.replaceWithDefault() - ? ImmutableList.of("1", "3", "4", "5", "6") - : ImmutableList.of("1", "2", "3", "4", "5", "6", "7") + ImmutableList.of("1", "2", "3", "4", "5", "6", "7") ); } diff --git a/processing/src/test/java/org/apache/druid/segment/filter/ColumnComparisonFilterTest.java b/processing/src/test/java/org/apache/druid/segment/filter/ColumnComparisonFilterTest.java index 3525e120c3e3..dee4c1636b45 100644 --- a/processing/src/test/java/org/apache/druid/segment/filter/ColumnComparisonFilterTest.java +++ b/processing/src/test/java/org/apache/druid/segment/filter/ColumnComparisonFilterTest.java @@ -23,7 +23,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import nl.jqno.equalsverifier.EqualsVerifier; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.data.input.impl.DimensionsSpec; import org.apache.druid.data.input.impl.InputRowParser; @@ -132,57 +131,30 @@ public void testMissingColumnNotSpecifiedInDimensionList() DefaultDimensionSpec.of("dim7") )), ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7", "8", "9")); - if (NullHandling.replaceWithDefault()) { - // "" is equivalent to null which is equivalent to a missing dimension - assertFilterMatchesSkipVectorize(new ColumnComparisonDimFilter(ImmutableList.of( - DefaultDimensionSpec.of("dim1"), - DefaultDimensionSpec.of("dim6") - )), ImmutableList.of("0")); - - assertFilterMatchesSkipVectorize(new ColumnComparisonDimFilter(ImmutableList.of( - DefaultDimensionSpec.of("dim2"), - DefaultDimensionSpec.of("dim6") - )), ImmutableList.of("1", "2", "6", "7", "8")); - - assertFilterMatchesSkipVectorize( - new ColumnComparisonDimFilter( - ImmutableList.of(DefaultDimensionSpec.of("dim1"), DefaultDimensionSpec.of("dim6")) - ), - ImmutableList.of("0") - ); - - assertFilterMatchesSkipVectorize( - new ColumnComparisonDimFilter( - ImmutableList.of(DefaultDimensionSpec.of("dim2"), DefaultDimensionSpec.of("dim6")) - ), - ImmutableList.of("1", "2", "6", "7", "8") - ); - } else { - // "" is not equivalent to a missing dimension - assertFilterMatchesSkipVectorize(new ColumnComparisonDimFilter(ImmutableList.of( - DefaultDimensionSpec.of("dim1"), - DefaultDimensionSpec.of("dim6") - )), Collections.emptyList()); - - assertFilterMatchesSkipVectorize(new ColumnComparisonDimFilter(ImmutableList.of( - DefaultDimensionSpec.of("dim2"), - DefaultDimensionSpec.of("dim6") - )), ImmutableList.of("1", "6", "7", "8")); - - assertFilterMatchesSkipVectorize( - new ColumnComparisonDimFilter( - ImmutableList.of(DefaultDimensionSpec.of("dim1"), DefaultDimensionSpec.of("dim6")) - ), - ImmutableList.of() - ); - - assertFilterMatchesSkipVectorize( - new ColumnComparisonDimFilter( - ImmutableList.of(DefaultDimensionSpec.of("dim2"), DefaultDimensionSpec.of("dim6")) - ), - ImmutableList.of("1", "6", "7", "8") - ); - } + // "" is not equivalent to a missing dimension + assertFilterMatchesSkipVectorize(new ColumnComparisonDimFilter(ImmutableList.of( + DefaultDimensionSpec.of("dim1"), + DefaultDimensionSpec.of("dim6") + )), Collections.emptyList()); + + assertFilterMatchesSkipVectorize(new ColumnComparisonDimFilter(ImmutableList.of( + DefaultDimensionSpec.of("dim2"), + DefaultDimensionSpec.of("dim6") + )), ImmutableList.of("1", "6", "7", "8")); + + assertFilterMatchesSkipVectorize( + new ColumnComparisonDimFilter( + ImmutableList.of(DefaultDimensionSpec.of("dim1"), DefaultDimensionSpec.of("dim6")) + ), + ImmutableList.of() + ); + + assertFilterMatchesSkipVectorize( + new ColumnComparisonDimFilter( + ImmutableList.of(DefaultDimensionSpec.of("dim2"), DefaultDimensionSpec.of("dim6")) + ), + ImmutableList.of("1", "6", "7", "8") + ); } @Test diff --git a/processing/src/test/java/org/apache/druid/segment/filter/EqualityFilterTests.java b/processing/src/test/java/org/apache/druid/segment/filter/EqualityFilterTests.java index c76ea3e6b851..2a155ffde9df 100644 --- a/processing/src/test/java/org/apache/druid/segment/filter/EqualityFilterTests.java +++ b/processing/src/test/java/org/apache/druid/segment/filter/EqualityFilterTests.java @@ -28,7 +28,6 @@ import com.google.common.collect.RangeSet; import com.google.common.collect.TreeRangeSet; import nl.jqno.equalsverifier.EqualsVerifier; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; import org.apache.druid.guice.BuiltInTypesModule; import org.apache.druid.jackson.DefaultObjectMapper; @@ -80,13 +79,11 @@ public static void tearDown() throws Exception @Test public void testSingleValueStringColumnWithoutNulls() { - if (NullHandling.sqlCompatible()) { - assertFilterMatches(new EqualityFilter("dim0", ColumnType.STRING, "", null), ImmutableList.of()); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("dim0", ColumnType.STRING, "", null)), - ImmutableList.of("0", "1", "2", "3", "4", "5") - ); - } + assertFilterMatches(new EqualityFilter("dim0", ColumnType.STRING, "", null), ImmutableList.of()); + assertFilterMatches( + NotDimFilter.of(new EqualityFilter("dim0", ColumnType.STRING, "", null)), + ImmutableList.of("0", "1", "2", "3", "4", "5") + ); assertFilterMatches(new EqualityFilter("dim0", ColumnType.STRING, "0", null), ImmutableList.of("0")); assertFilterMatches( NotDimFilter.of(new EqualityFilter("dim0", ColumnType.STRING, "0", null)), @@ -119,9 +116,7 @@ public void testSingleValueStringColumnWithoutNulls() @Test public void testSingleValueVirtualStringColumnWithoutNulls() { - if (NullHandling.sqlCompatible()) { - assertFilterMatches(new EqualityFilter("vdim0", ColumnType.STRING, "", null), ImmutableList.of()); - } + assertFilterMatches(new EqualityFilter("vdim0", ColumnType.STRING, "", null), ImmutableList.of()); assertFilterMatches(new EqualityFilter("vdim0", ColumnType.STRING, "0", null), ImmutableList.of("0")); assertFilterMatches(new EqualityFilter("vdim0", ColumnType.STRING, "1", null), ImmutableList.of("1")); assertFilterMatches(new EqualityFilter("vdim0", ColumnType.LONG, 0L, null), ImmutableList.of("0")); @@ -138,9 +133,7 @@ public void testListFilteredVirtualColumn() ); assertFilterMatchesSkipVectorize( NotDimFilter.of(new EqualityFilter("allow-dim0", ColumnType.STRING, "1", null)), - NullHandling.sqlCompatible() - ? ImmutableList.of("3", "4") - : ImmutableList.of("0", "1", "2", "3", "4", "5") + ImmutableList.of("3", "4") ); assertFilterMatchesSkipVectorize( new EqualityFilter("allow-dim0", ColumnType.STRING, "4", null), @@ -148,9 +141,7 @@ public void testListFilteredVirtualColumn() ); assertFilterMatchesSkipVectorize( NotDimFilter.of(new EqualityFilter("allow-dim0", ColumnType.STRING, "4", null)), - NullHandling.sqlCompatible() - ? ImmutableList.of("3") - : ImmutableList.of("0", "1", "2", "3", "5") + ImmutableList.of("3") ); assertFilterMatchesSkipVectorize( new EqualityFilter("deny-dim0", ColumnType.STRING, "0", null), @@ -158,9 +149,7 @@ public void testListFilteredVirtualColumn() ); assertFilterMatchesSkipVectorize( NotDimFilter.of(new EqualityFilter("deny-dim0", ColumnType.STRING, "0", null)), - NullHandling.sqlCompatible() - ? ImmutableList.of("1", "2", "5") - : ImmutableList.of("1", "2", "3", "4", "5") + ImmutableList.of("1", "2", "5") ); assertFilterMatchesSkipVectorize( new EqualityFilter("deny-dim0", ColumnType.STRING, "4", null), @@ -168,9 +157,7 @@ public void testListFilteredVirtualColumn() ); assertFilterMatchesSkipVectorize( NotDimFilter.of(new EqualityFilter("deny-dim0", ColumnType.STRING, "4", null)), - NullHandling.sqlCompatible() - ? ImmutableList.of("0", "1", "2", "5") - : ImmutableList.of("0", "1", "2", "3", "4", "5") + ImmutableList.of("0", "1", "2", "5") ); // auto ingests arrays instead of MVDs which dont work with list filtered virtual column @@ -181,9 +168,7 @@ public void testListFilteredVirtualColumn() ); assertFilterMatchesSkipVectorize( NotDimFilter.of(new EqualityFilter("allow-dim2", ColumnType.STRING, "b", null)), - NullHandling.sqlCompatible() - ? ImmutableList.of("0", "3") - : ImmutableList.of("0", "1", "2", "3", "4", "5") + ImmutableList.of("0", "3") ); assertFilterMatchesSkipVectorize( new EqualityFilter("allow-dim2", ColumnType.STRING, "a", null), @@ -191,7 +176,7 @@ public void testListFilteredVirtualColumn() ); assertFilterMatchesSkipVectorize( NotDimFilter.of(new EqualityFilter("allow-dim2", ColumnType.STRING, "a", null)), - NullHandling.sqlCompatible() ? ImmutableList.of() : ImmutableList.of("1", "2", "4", "5") + ImmutableList.of() ); assertFilterMatchesSkipVectorize( new EqualityFilter("deny-dim2", ColumnType.STRING, "b", null), @@ -199,9 +184,7 @@ public void testListFilteredVirtualColumn() ); assertFilterMatchesSkipVectorize( NotDimFilter.of(new EqualityFilter("deny-dim2", ColumnType.STRING, "b", null)), - NullHandling.replaceWithDefault() - ? ImmutableList.of("1", "2", "3", "4", "5") - : ImmutableList.of("2", "4") + ImmutableList.of("2", "4") ); assertFilterMatchesSkipVectorize( new EqualityFilter("deny-dim2", ColumnType.STRING, "a", null), @@ -210,9 +193,7 @@ public void testListFilteredVirtualColumn() // mvds are strange assertFilterMatchesSkipVectorize( NotDimFilter.of(new EqualityFilter("deny-dim2", ColumnType.STRING, "a", null)), - NullHandling.replaceWithDefault() - ? ImmutableList.of("0", "1", "2", "3", "4", "5") - : ImmutableList.of("0", "2", "4") + ImmutableList.of("0", "2", "4") ); } } @@ -220,24 +201,22 @@ public void testListFilteredVirtualColumn() @Test public void testSingleValueStringColumnWithNulls() { - if (NullHandling.sqlCompatible()) { - assertFilterMatches( - new EqualityFilter("dim1", ColumnType.STRING, "", null), - ImmutableList.of("0") - ); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("dim1", ColumnType.STRING, "", null)), - ImmutableList.of("1", "2", "3", "4", "5") - ); - assertFilterMatches( - new EqualityFilter("s0", ColumnType.STRING, "", null), - ImmutableList.of("0") - ); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("s0", ColumnType.STRING, "", null)), - ImmutableList.of("1", "2", "4", "5") - ); - } + assertFilterMatches( + new EqualityFilter("dim1", ColumnType.STRING, "", null), + ImmutableList.of("0") + ); + assertFilterMatches( + NotDimFilter.of(new EqualityFilter("dim1", ColumnType.STRING, "", null)), + ImmutableList.of("1", "2", "3", "4", "5") + ); + assertFilterMatches( + new EqualityFilter("s0", ColumnType.STRING, "", null), + ImmutableList.of("0") + ); + assertFilterMatches( + NotDimFilter.of(new EqualityFilter("s0", ColumnType.STRING, "", null)), + ImmutableList.of("1", "2", "4", "5") + ); assertFilterMatches(new EqualityFilter("dim1", ColumnType.STRING, "10", null), ImmutableList.of("1")); assertFilterMatches(new EqualityFilter("dim1", ColumnType.STRING, "2", null), ImmutableList.of("2")); assertFilterMatches(new EqualityFilter("dim1", ColumnType.STRING, "1", null), ImmutableList.of("3")); @@ -250,119 +229,64 @@ public void testSingleValueStringColumnWithNulls() assertFilterMatches(new EqualityFilter("s0", ColumnType.STRING, "c", null), ImmutableList.of("4")); assertFilterMatches(new EqualityFilter("s0", ColumnType.STRING, "noexist", null), ImmutableList.of()); - if (NullHandling.sqlCompatible()) { - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("dim1", ColumnType.STRING, "10", null)), - ImmutableList.of("0", "2", "3", "4", "5") - ); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("dim1", ColumnType.STRING, "noexist", null)), - ImmutableList.of("0", "1", "2", "3", "4", "5") - ); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("s0", ColumnType.STRING, "a", null)), - ImmutableList.of("0", "2", "4") - ); - // "(s0 = 'a') is not true", same rows as "s0 <> 'a'", but also with null rows - assertFilterMatches( - NotDimFilter.of(IsTrueDimFilter.of(new EqualityFilter("s0", ColumnType.STRING, "a", null))), - ImmutableList.of("0", "2", "3", "4") - ); - // "(s0 = 'a') is true", equivalent to "s0 = 'a'" - assertFilterMatches( - IsTrueDimFilter.of(new EqualityFilter("s0", ColumnType.STRING, "a", null)), - ImmutableList.of("1", "5") - ); - // "(s0 = 'a') is false", equivalent results to "s0 <> 'a'" - assertFilterMatches( - IsFalseDimFilter.of(new EqualityFilter("s0", ColumnType.STRING, "a", null)), - ImmutableList.of("0", "2", "4") - ); - // "(s0 = 'a') is not false", same rows as "s0 = 'a'", but also with null rows - assertFilterMatches( - NotDimFilter.of(IsFalseDimFilter.of(new EqualityFilter("s0", ColumnType.STRING, "a", null))), - ImmutableList.of("1", "3", "5") - ); - - try { - // make sure if 3vl is disabled with behave with 2vl - NullHandling.initializeForTestsWithValues(false, false, null); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("s0", ColumnType.STRING, "a", null)), - ImmutableList.of("0", "2", "3", "4") - ); - } - finally { - NullHandling.initializeForTests(); - } - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("s0", ColumnType.STRING, "noexist", null)), - ImmutableList.of("0", "1", "2", "4", "5") - ); - } else { - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("dim1", ColumnType.STRING, "10", null)), - ImmutableList.of("0", "2", "3", "4", "5") - ); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("dim1", ColumnType.STRING, "noexist", null)), - ImmutableList.of("0", "1", "2", "3", "4", "5") - ); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("s0", ColumnType.STRING, "a", null)), - ImmutableList.of("0", "2", "3", "4") - ); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("s0", ColumnType.STRING, "noexist", null)), - ImmutableList.of("0", "1", "2", "3", "4", "5") - ); - - // in default value mode, is true/is false are basically pointless since they have the same behavior as = and <> - // "(s0 = 'a') is not true" equivalent to "s0 <> 'a'" - assertFilterMatches( - NotDimFilter.of(IsTrueDimFilter.of(new EqualityFilter("s0", ColumnType.STRING, "a", null))), - ImmutableList.of("0", "2", "3", "4") - ); - // "(s0 = 'a') is true", equivalent to "s0 = 'a'" - assertFilterMatches( - IsTrueDimFilter.of(new EqualityFilter("s0", ColumnType.STRING, "a", null)), - ImmutableList.of("1", "5") - ); - // "(s0 = 'a') is false" equivalent to "s0 <> 'a'" - assertFilterMatches( - IsFalseDimFilter.of(new EqualityFilter("s0", ColumnType.STRING, "a", null)), - ImmutableList.of("0", "2", "3", "4") - ); - // "(s0 = 'a') is not false", equivalent to "s0 = 'a'" - assertFilterMatches( - NotDimFilter.of(IsFalseDimFilter.of(new EqualityFilter("s0", ColumnType.STRING, "a", null))), - ImmutableList.of("1", "5") - ); - } + assertFilterMatches( + NotDimFilter.of(new EqualityFilter("dim1", ColumnType.STRING, "10", null)), + ImmutableList.of("0", "2", "3", "4", "5") + ); + assertFilterMatches( + NotDimFilter.of(new EqualityFilter("dim1", ColumnType.STRING, "noexist", null)), + ImmutableList.of("0", "1", "2", "3", "4", "5") + ); + assertFilterMatches( + NotDimFilter.of(new EqualityFilter("s0", ColumnType.STRING, "a", null)), + ImmutableList.of("0", "2", "4") + ); + // "(s0 = 'a') is not true", same rows as "s0 <> 'a'", but also with null rows + assertFilterMatches( + NotDimFilter.of(IsTrueDimFilter.of(new EqualityFilter("s0", ColumnType.STRING, "a", null))), + ImmutableList.of("0", "2", "3", "4") + ); + // "(s0 = 'a') is true", equivalent to "s0 = 'a'" + assertFilterMatches( + IsTrueDimFilter.of(new EqualityFilter("s0", ColumnType.STRING, "a", null)), + ImmutableList.of("1", "5") + ); + // "(s0 = 'a') is false", equivalent results to "s0 <> 'a'" + assertFilterMatches( + IsFalseDimFilter.of(new EqualityFilter("s0", ColumnType.STRING, "a", null)), + ImmutableList.of("0", "2", "4") + ); + // "(s0 = 'a') is not false", same rows as "s0 = 'a'", but also with null rows + assertFilterMatches( + NotDimFilter.of(IsFalseDimFilter.of(new EqualityFilter("s0", ColumnType.STRING, "a", null))), + ImmutableList.of("1", "3", "5") + ); + assertFilterMatches( + NotDimFilter.of(new EqualityFilter("s0", ColumnType.STRING, "noexist", null)), + ImmutableList.of("0", "1", "2", "4", "5") + ); } @Test public void testSingleValueVirtualStringColumnWithNulls() { // testSingleValueStringColumnWithNulls but with virtual column selector - if (NullHandling.sqlCompatible()) { - assertFilterMatches( - new EqualityFilter("vdim1", ColumnType.STRING, "", null), - ImmutableList.of("0") - ); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("vdim1", ColumnType.STRING, "", null)), - ImmutableList.of("1", "2", "3", "4", "5") - ); - assertFilterMatches( - new EqualityFilter("vs0", ColumnType.STRING, "", null), - ImmutableList.of("0") - ); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("vs0", ColumnType.STRING, "", null)), - ImmutableList.of("1", "2", "4", "5") - ); - } + assertFilterMatches( + new EqualityFilter("vdim1", ColumnType.STRING, "", null), + ImmutableList.of("0") + ); + assertFilterMatches( + NotDimFilter.of(new EqualityFilter("vdim1", ColumnType.STRING, "", null)), + ImmutableList.of("1", "2", "3", "4", "5") + ); + assertFilterMatches( + new EqualityFilter("vs0", ColumnType.STRING, "", null), + ImmutableList.of("0") + ); + assertFilterMatches( + NotDimFilter.of(new EqualityFilter("vs0", ColumnType.STRING, "", null)), + ImmutableList.of("1", "2", "4", "5") + ); assertFilterMatches(new EqualityFilter("vdim1", ColumnType.STRING, "10", null), ImmutableList.of("1")); assertFilterMatches(new EqualityFilter("vdim1", ColumnType.STRING, "2", null), ImmutableList.of("2")); assertFilterMatches(new EqualityFilter("vdim1", ColumnType.STRING, "1", null), ImmutableList.of("3")); @@ -375,41 +299,22 @@ public void testSingleValueVirtualStringColumnWithNulls() assertFilterMatches(new EqualityFilter("vs0", ColumnType.STRING, "c", null), ImmutableList.of("4")); assertFilterMatches(new EqualityFilter("vs0", ColumnType.STRING, "noexist", null), ImmutableList.of()); - if (NullHandling.sqlCompatible()) { - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("vdim1", ColumnType.STRING, "10", null)), - ImmutableList.of("0", "2", "3", "4", "5") - ); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("vdim1", ColumnType.STRING, "noexist", null)), - ImmutableList.of("0", "1", "2", "3", "4", "5") - ); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("vs0", ColumnType.STRING, "a", null)), - ImmutableList.of("0", "2", "4") - ); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("vs0", ColumnType.STRING, "noexist", null)), - ImmutableList.of("0", "1", "2", "4", "5") - ); - } else { - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("vdim1", ColumnType.STRING, "10", null)), - ImmutableList.of("0", "2", "3", "4", "5") - ); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("vdim1", ColumnType.STRING, "noexist", null)), - ImmutableList.of("0", "1", "2", "3", "4", "5") - ); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("vs0", ColumnType.STRING, "a", null)), - ImmutableList.of("0", "2", "3", "4") - ); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("vs0", ColumnType.STRING, "noexist", null)), - ImmutableList.of("0", "1", "2", "3", "4", "5") - ); - } + assertFilterMatches( + NotDimFilter.of(new EqualityFilter("vdim1", ColumnType.STRING, "10", null)), + ImmutableList.of("0", "2", "3", "4", "5") + ); + assertFilterMatches( + NotDimFilter.of(new EqualityFilter("vdim1", ColumnType.STRING, "noexist", null)), + ImmutableList.of("0", "1", "2", "3", "4", "5") + ); + assertFilterMatches( + NotDimFilter.of(new EqualityFilter("vs0", ColumnType.STRING, "a", null)), + ImmutableList.of("0", "2", "4") + ); + assertFilterMatches( + NotDimFilter.of(new EqualityFilter("vs0", ColumnType.STRING, "noexist", null)), + ImmutableList.of("0", "1", "2", "4", "5") + ); } @@ -431,13 +336,11 @@ public void testMultiValueStringColumn() { if (isAutoSchema()) { // auto ingests arrays instead of strings - if (NullHandling.sqlCompatible()) { - assertFilterMatches(new EqualityFilter("dim2", ColumnType.STRING, "", null), ImmutableList.of()); - assertFilterMatches( - new EqualityFilter("dim2", ColumnType.STRING_ARRAY, ImmutableList.of(""), null), - ImmutableList.of("2") - ); - } + assertFilterMatches(new EqualityFilter("dim2", ColumnType.STRING, "", null), ImmutableList.of()); + assertFilterMatches( + new EqualityFilter("dim2", ColumnType.STRING_ARRAY, ImmutableList.of(""), null), + ImmutableList.of("2") + ); assertFilterMatches(new EqualityFilter("dim2", ColumnType.STRING, "a", null), ImmutableList.of()); assertFilterMatches( new EqualityFilter("dim2", ColumnType.STRING_ARRAY, ImmutableList.of("a"), null), @@ -477,29 +380,25 @@ public void testMultiValueStringColumn() ImmutableList.of() ); } else { - if (NullHandling.sqlCompatible()) { - assertFilterMatches(new EqualityFilter("dim2", ColumnType.STRING, "", null), ImmutableList.of("2")); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("dim2", ColumnType.STRING, "", null)), - ImmutableList.of("0", "3", "4") - ); - } + assertFilterMatches(new EqualityFilter("dim2", ColumnType.STRING, "", null), ImmutableList.of("2")); + assertFilterMatches( + NotDimFilter.of(new EqualityFilter("dim2", ColumnType.STRING, "", null)), + ImmutableList.of("0", "3", "4") + ); assertFilterMatches( new EqualityFilter("dim2", ColumnType.STRING, "a", null), ImmutableList.of("0", "3") ); assertFilterMatches( NotDimFilter.of(new EqualityFilter("dim2", ColumnType.STRING, "a", null)), - NullHandling.replaceWithDefault() ? ImmutableList.of("1", "2", "4", "5") : ImmutableList.of("2", "4") + ImmutableList.of("2", "4") ); assertFilterMatches(new EqualityFilter("dim2", ColumnType.STRING, "b", null), ImmutableList.of("0")); assertFilterMatches(new EqualityFilter("dim2", ColumnType.STRING, "c", null), ImmutableList.of("4")); assertFilterMatches(new EqualityFilter("dim2", ColumnType.STRING, "d", null), ImmutableList.of()); assertFilterMatches( NotDimFilter.of(new EqualityFilter("dim2", ColumnType.STRING, "d", null)), - NullHandling.replaceWithDefault() - ? ImmutableList.of("0", "1", "2", "3", "4", "5") - : ImmutableList.of("0", "2", "3", "4") + ImmutableList.of("0", "2", "3", "4") ); } @@ -510,48 +409,40 @@ public void testMultiValueStringColumn() ); assertFilterMatchesSkipVectorize( NotDimFilter.of(new EqualityFilter("vdim2-offset", ColumnType.STRING, "b", null)), - NullHandling.sqlCompatible() ? ImmutableList.of() : ImmutableList.of("1", "2", "3", "4", "5") + ImmutableList.of() ); } @Test public void testMissingColumnSpecifiedInDimensionList() { - if (NullHandling.sqlCompatible()) { - assertFilterMatches(new EqualityFilter("dim3", ColumnType.STRING, "", null), ImmutableList.of()); - } + assertFilterMatches(new EqualityFilter("dim3", ColumnType.STRING, "", null), ImmutableList.of()); assertFilterMatches(new EqualityFilter("dim3", ColumnType.STRING, "a", null), ImmutableList.of()); assertFilterMatches(new EqualityFilter("dim3", ColumnType.STRING, "b", null), ImmutableList.of()); assertFilterMatches(new EqualityFilter("dim3", ColumnType.STRING, "c", null), ImmutableList.of()); assertFilterMatches( NotDimFilter.of(new EqualityFilter("dim3", ColumnType.STRING, "c", null)), - NullHandling.sqlCompatible() - ? ImmutableList.of() - : ImmutableList.of("0", "1", "2", "3", "4", "5") + ImmutableList.of() ); assertFilterMatches(new EqualityFilter("vdim3-concat", ColumnType.STRING, "1", null), ImmutableList.of()); assertFilterMatches( NotDimFilter.of(new EqualityFilter("vdim3-concat", ColumnType.STRING, "1", null)), - NullHandling.sqlCompatible() ? ImmutableList.of() : ImmutableList.of("0", "1", "2", "3", "4", "5") + ImmutableList.of() ); } @Test public void testMissingColumnNotSpecifiedInDimensionList() { - if (NullHandling.sqlCompatible()) { - assertFilterMatches(new EqualityFilter("dim4", ColumnType.STRING, "", null), ImmutableList.of()); - } + assertFilterMatches(new EqualityFilter("dim4", ColumnType.STRING, "", null), ImmutableList.of()); assertFilterMatches(new EqualityFilter("dim4", ColumnType.STRING, "a", null), ImmutableList.of()); assertFilterMatches(new EqualityFilter("dim4", ColumnType.STRING, "b", null), ImmutableList.of()); assertFilterMatches(new EqualityFilter("dim4", ColumnType.STRING, "c", null), ImmutableList.of()); assertFilterMatches( NotDimFilter.of(new EqualityFilter("dim4", ColumnType.STRING, "c", null)), - NullHandling.sqlCompatible() - ? ImmutableList.of() - : ImmutableList.of("0", "1", "2", "3", "4", "5") + ImmutableList.of() ); } @@ -595,198 +486,91 @@ public void testExpressionVirtualColumn() @Test public void testNumericColumnNullsAndDefaults() { - if (canTestNumericNullsAsDefaultValues) { - assertFilterMatches(new EqualityFilter("f0", ColumnType.FLOAT, 0f, null), ImmutableList.of("0", "4")); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("f0", ColumnType.FLOAT, 0f, null)), - ImmutableList.of("1", "2", "3", "5") - ); - assertFilterMatches(new EqualityFilter("d0", ColumnType.DOUBLE, 0.0, null), ImmutableList.of("0", "2")); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("d0", ColumnType.DOUBLE, 0.0, null)), - ImmutableList.of("1", "3", "4", "5") - ); - assertFilterMatches(new EqualityFilter("l0", ColumnType.LONG, 0L, null), ImmutableList.of("0", "3")); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("l0", ColumnType.LONG, 0L, null)), - ImmutableList.of("1", "2", "4", "5") - ); - - assertFilterMatches(new EqualityFilter("f0", ColumnType.STRING, "0", null), ImmutableList.of("0", "4")); - assertFilterMatches(new EqualityFilter("d0", ColumnType.STRING, "0", null), ImmutableList.of("0", "2")); - assertFilterMatches(new EqualityFilter("l0", ColumnType.STRING, "0", null), ImmutableList.of("0", "3")); - } else { - assertFilterMatches(new EqualityFilter("f0", ColumnType.FLOAT, 0f, null), ImmutableList.of("0")); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("f0", ColumnType.FLOAT, 0f, null)), - NullHandling.sqlCompatible() - ? ImmutableList.of("1", "2", "3", "5") - : ImmutableList.of("1", "2", "3", "4", "5") - ); - assertFilterMatches(new EqualityFilter("d0", ColumnType.DOUBLE, 0.0, null), ImmutableList.of("0")); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("d0", ColumnType.DOUBLE, 0.0, null)), - NullHandling.sqlCompatible() - ? ImmutableList.of("1", "3", "4", "5") - : ImmutableList.of("1", "2", "3", "4", "5") - ); - assertFilterMatches(new EqualityFilter("l0", ColumnType.LONG, 0L, null), ImmutableList.of("0")); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("l0", ColumnType.LONG, 0L, null)), - NullHandling.sqlCompatible() - ? ImmutableList.of("1", "2", "4", "5") - : ImmutableList.of("1", "2", "3", "4", "5") - ); + assertFilterMatches(new EqualityFilter("f0", ColumnType.FLOAT, 0f, null), ImmutableList.of("0")); + assertFilterMatches( + NotDimFilter.of(new EqualityFilter("f0", ColumnType.FLOAT, 0f, null)), + ImmutableList.of("1", "2", "3", "5") + ); + assertFilterMatches(new EqualityFilter("d0", ColumnType.DOUBLE, 0.0, null), ImmutableList.of("0")); + assertFilterMatches( + NotDimFilter.of(new EqualityFilter("d0", ColumnType.DOUBLE, 0.0, null)), + ImmutableList.of("1", "3", "4", "5") + ); + assertFilterMatches(new EqualityFilter("l0", ColumnType.LONG, 0L, null), ImmutableList.of("0")); + assertFilterMatches( + NotDimFilter.of(new EqualityFilter("l0", ColumnType.LONG, 0L, null)), + ImmutableList.of("1", "2", "4", "5") + ); - assertFilterMatches(new EqualityFilter("f0", ColumnType.STRING, "0", null), ImmutableList.of("0")); - assertFilterMatches(new EqualityFilter("d0", ColumnType.STRING, "0", null), ImmutableList.of("0")); - assertFilterMatches(new EqualityFilter("l0", ColumnType.STRING, "0", null), ImmutableList.of("0")); - } + assertFilterMatches(new EqualityFilter("f0", ColumnType.STRING, "0", null), ImmutableList.of("0")); + assertFilterMatches(new EqualityFilter("d0", ColumnType.STRING, "0", null), ImmutableList.of("0")); + assertFilterMatches(new EqualityFilter("l0", ColumnType.STRING, "0", null), ImmutableList.of("0")); } @Test public void testVirtualNumericColumnNullsAndDefaults() { - if (canTestNumericNullsAsDefaultValues) { - assertFilterMatches(new EqualityFilter("vf0", ColumnType.FLOAT, 0f, null), ImmutableList.of("0", "4")); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("vf0", ColumnType.FLOAT, 0f, null)), - ImmutableList.of("1", "2", "3", "5") - ); - assertFilterMatches(new EqualityFilter("vd0", ColumnType.DOUBLE, 0.0, null), ImmutableList.of("0", "2")); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("vd0", ColumnType.DOUBLE, 0.0, null)), - ImmutableList.of("1", "3", "4", "5") - ); - assertFilterMatches(new EqualityFilter("vl0", ColumnType.LONG, 0L, null), ImmutableList.of("0", "3")); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("vl0", ColumnType.LONG, 0L, null)), - ImmutableList.of("1", "2", "4", "5") - ); - - assertFilterMatches(new EqualityFilter("vf0-add-sub", ColumnType.STRING, "0", null), ImmutableList.of("0", "4")); - assertFilterMatches(new EqualityFilter("vd0-add-sub", ColumnType.STRING, "0", null), ImmutableList.of("0", "2")); - assertFilterMatches(new EqualityFilter("vl0-add-sub", ColumnType.STRING, "0", null), ImmutableList.of("0", "3")); - - assertFilterMatches(new EqualityFilter("vf0-add-sub", ColumnType.FLOAT, 0f, null), ImmutableList.of("0", "4")); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("vf0-add-sub", ColumnType.FLOAT, 0f, null)), - ImmutableList.of("1", "2", "3", "5") - ); - assertFilterMatches(new EqualityFilter("vd0-add-sub", ColumnType.DOUBLE, 0.0, null), ImmutableList.of("0", "2")); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("vd0-add-sub", ColumnType.DOUBLE, 0.0, null)), - ImmutableList.of("1", "3", "4", "5") - ); + assertFilterMatches(new EqualityFilter("vf0", ColumnType.FLOAT, 0f, null), ImmutableList.of("0")); + assertFilterMatches( + NotDimFilter.of(new EqualityFilter("vf0", ColumnType.FLOAT, 0f, null)), + ImmutableList.of("1", "2", "3", "5") + ); + assertFilterMatches(new EqualityFilter("vd0", ColumnType.DOUBLE, 0.0, null), ImmutableList.of("0")); + assertFilterMatches( + NotDimFilter.of(new EqualityFilter("vd0", ColumnType.DOUBLE, 0.0, null)), + ImmutableList.of("1", "3", "4", "5") + ); + assertFilterMatches(new EqualityFilter("vl0", ColumnType.LONG, 0L, null), ImmutableList.of("0")); + assertFilterMatches( + NotDimFilter.of(new EqualityFilter("vl0", ColumnType.LONG, 0L, null)), + ImmutableList.of("1", "2", "4", "5") + ); - // virtual column that refers to another virtual column - assertFilterMatches(new EqualityFilter("double-vf0-add-sub", ColumnType.STRING, "0", null), ImmutableList.of("0", "4")); - assertFilterMatches(new EqualityFilter("double-vd0-add-sub", ColumnType.STRING, "0", null), ImmutableList.of("0", "2")); - assertFilterMatches(new EqualityFilter("double-vl0-add-sub", ColumnType.STRING, "0", null), ImmutableList.of("0", "3")); + assertFilterMatches(new EqualityFilter("vf0", ColumnType.STRING, "0", null), ImmutableList.of("0")); + assertFilterMatches(new EqualityFilter("vd0", ColumnType.STRING, "0", null), ImmutableList.of("0")); + assertFilterMatches(new EqualityFilter("vl0", ColumnType.STRING, "0", null), ImmutableList.of("0")); - assertFilterMatches(new EqualityFilter("double-vf0-add-sub", ColumnType.FLOAT, 0f, null), ImmutableList.of("0", "4")); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("double-vf0-add-sub", ColumnType.FLOAT, 0f, null)), - ImmutableList.of("1", "2", "3", "5") - ); - assertFilterMatches(new EqualityFilter("double-vd0-add-sub", ColumnType.DOUBLE, 0.0, null), ImmutableList.of("0", "2")); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("double-vd0-add-sub", ColumnType.DOUBLE, 0.0, null)), - ImmutableList.of("1", "3", "4", "5") - ); + // these fail in default value mode that cannot be tested as numeric default values becuase of type + // mismatch for subtract operation + assertFilterMatches(new EqualityFilter("vf0-add-sub", ColumnType.FLOAT, 0f, null), ImmutableList.of("0")); + assertFilterMatches( + NotDimFilter.of(new EqualityFilter("vf0-add-sub", ColumnType.FLOAT, 0f, null)), + ImmutableList.of("1", "2", "3", "5") + ); + assertFilterMatches(new EqualityFilter("vd0-add-sub", ColumnType.DOUBLE, 0.0, null), ImmutableList.of("0")); + assertFilterMatches( + NotDimFilter.of(new EqualityFilter("vd0-add-sub", ColumnType.DOUBLE, 0.0, null)), + ImmutableList.of("1", "3", "4", "5") + ); + assertFilterMatches(new EqualityFilter("vl0-add-sub", ColumnType.LONG, 0L, null), ImmutableList.of("0")); + assertFilterMatches( + NotDimFilter.of(new EqualityFilter("vl0-add-sub", ColumnType.LONG, 0L, null)), + ImmutableList.of("1", "2", "4", "5") + ); - assertFilterMatches(new EqualityFilter("vl0", ColumnType.LONG, 0L, null), ImmutableList.of("0", "3")); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("vl0", ColumnType.LONG, 0L, null)), - ImmutableList.of("1", "2", "4", "5") - ); + assertFilterMatches(new EqualityFilter("vf0-add-sub", ColumnType.STRING, "0", null), ImmutableList.of("0")); + assertFilterMatches(new EqualityFilter("vd0-add-sub", ColumnType.STRING, "0", null), ImmutableList.of("0")); + assertFilterMatches(new EqualityFilter("vl0-add-sub", ColumnType.STRING, "0", null), ImmutableList.of("0")); - assertFilterMatches(new EqualityFilter("vf0", ColumnType.STRING, "0", null), ImmutableList.of("0", "4")); - assertFilterMatches(new EqualityFilter("vd0", ColumnType.STRING, "0", null), ImmutableList.of("0", "2")); - assertFilterMatches(new EqualityFilter("vl0", ColumnType.STRING, "0", null), ImmutableList.of("0", "3")); - } else { - assertFilterMatches(new EqualityFilter("vf0", ColumnType.FLOAT, 0f, null), ImmutableList.of("0")); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("vf0", ColumnType.FLOAT, 0f, null)), - NullHandling.sqlCompatible() - ? ImmutableList.of("1", "2", "3", "5") - : ImmutableList.of("1", "2", "3", "4", "5") - ); - assertFilterMatches(new EqualityFilter("vd0", ColumnType.DOUBLE, 0.0, null), ImmutableList.of("0")); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("vd0", ColumnType.DOUBLE, 0.0, null)), - NullHandling.sqlCompatible() - ? ImmutableList.of("1", "3", "4", "5") - : ImmutableList.of("1", "2", "3", "4", "5") - ); - assertFilterMatches(new EqualityFilter("vl0", ColumnType.LONG, 0L, null), ImmutableList.of("0")); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("vl0", ColumnType.LONG, 0L, null)), - NullHandling.sqlCompatible() - ? ImmutableList.of("1", "2", "4", "5") - : ImmutableList.of("1", "2", "3", "4", "5") - ); + assertFilterMatches(new EqualityFilter("double-vf0-add-sub", ColumnType.FLOAT, 0f, null), ImmutableList.of("0")); + assertFilterMatches( + NotDimFilter.of(new EqualityFilter("double-vf0-add-sub", ColumnType.FLOAT, 0f, null)), + ImmutableList.of("1", "2", "3", "5") + ); + assertFilterMatches(new EqualityFilter("double-vd0-add-sub", ColumnType.DOUBLE, 0.0, null), ImmutableList.of("0")); + assertFilterMatches( + NotDimFilter.of(new EqualityFilter("double-vd0-add-sub", ColumnType.DOUBLE, 0.0, null)), + ImmutableList.of("1", "3", "4", "5") + ); + assertFilterMatches(new EqualityFilter("double-vl0-add-sub", ColumnType.LONG, 0L, null), ImmutableList.of("0")); + assertFilterMatches( + NotDimFilter.of(new EqualityFilter("double-vl0-add-sub", ColumnType.LONG, 0L, null)), + ImmutableList.of("1", "2", "4", "5") + ); - assertFilterMatches(new EqualityFilter("vf0", ColumnType.STRING, "0", null), ImmutableList.of("0")); - assertFilterMatches(new EqualityFilter("vd0", ColumnType.STRING, "0", null), ImmutableList.of("0")); - assertFilterMatches(new EqualityFilter("vl0", ColumnType.STRING, "0", null), ImmutableList.of("0")); - - if (NullHandling.sqlCompatible()) { - // these fail in default value mode that cannot be tested as numeric default values becuase of type - // mismatch for subtract operation - assertFilterMatches(new EqualityFilter("vf0-add-sub", ColumnType.FLOAT, 0f, null), ImmutableList.of("0")); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("vf0-add-sub", ColumnType.FLOAT, 0f, null)), - NullHandling.sqlCompatible() - ? ImmutableList.of("1", "2", "3", "5") - : ImmutableList.of("1", "2", "3", "4", "5") - ); - assertFilterMatches(new EqualityFilter("vd0-add-sub", ColumnType.DOUBLE, 0.0, null), ImmutableList.of("0")); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("vd0-add-sub", ColumnType.DOUBLE, 0.0, null)), - NullHandling.sqlCompatible() - ? ImmutableList.of("1", "3", "4", "5") - : ImmutableList.of("1", "2", "3", "4", "5") - ); - assertFilterMatches(new EqualityFilter("vl0-add-sub", ColumnType.LONG, 0L, null), ImmutableList.of("0")); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("vl0-add-sub", ColumnType.LONG, 0L, null)), - NullHandling.sqlCompatible() - ? ImmutableList.of("1", "2", "4", "5") - : ImmutableList.of("1", "2", "3", "4", "5") - ); - - assertFilterMatches(new EqualityFilter("vf0-add-sub", ColumnType.STRING, "0", null), ImmutableList.of("0")); - assertFilterMatches(new EqualityFilter("vd0-add-sub", ColumnType.STRING, "0", null), ImmutableList.of("0")); - assertFilterMatches(new EqualityFilter("vl0-add-sub", ColumnType.STRING, "0", null), ImmutableList.of("0")); - - assertFilterMatches(new EqualityFilter("double-vf0-add-sub", ColumnType.FLOAT, 0f, null), ImmutableList.of("0")); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("double-vf0-add-sub", ColumnType.FLOAT, 0f, null)), - NullHandling.sqlCompatible() - ? ImmutableList.of("1", "2", "3", "5") - : ImmutableList.of("1", "2", "3", "4", "5") - ); - assertFilterMatches(new EqualityFilter("double-vd0-add-sub", ColumnType.DOUBLE, 0.0, null), ImmutableList.of("0")); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("double-vd0-add-sub", ColumnType.DOUBLE, 0.0, null)), - NullHandling.sqlCompatible() - ? ImmutableList.of("1", "3", "4", "5") - : ImmutableList.of("1", "2", "3", "4", "5") - ); - assertFilterMatches(new EqualityFilter("double-vl0-add-sub", ColumnType.LONG, 0L, null), ImmutableList.of("0")); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("double-vl0-add-sub", ColumnType.LONG, 0L, null)), - NullHandling.sqlCompatible() - ? ImmutableList.of("1", "2", "4", "5") - : ImmutableList.of("1", "2", "3", "4", "5") - ); - - assertFilterMatches(new EqualityFilter("double-vf0-add-sub", ColumnType.STRING, "0", null), ImmutableList.of("0")); - assertFilterMatches(new EqualityFilter("double-vd0-add-sub", ColumnType.STRING, "0", null), ImmutableList.of("0")); - assertFilterMatches(new EqualityFilter("double-vl0-add-sub", ColumnType.STRING, "0", null), ImmutableList.of("0")); - } - } + assertFilterMatches(new EqualityFilter("double-vf0-add-sub", ColumnType.STRING, "0", null), ImmutableList.of("0")); + assertFilterMatches(new EqualityFilter("double-vd0-add-sub", ColumnType.STRING, "0", null), ImmutableList.of("0")); + assertFilterMatches(new EqualityFilter("double-vl0-add-sub", ColumnType.STRING, "0", null), ImmutableList.of("0")); } @Test @@ -810,7 +594,7 @@ public void testNumeric() // different type matcher assertFilterMatches( new EqualityFilter("d0", ColumnType.LONG, 0L, null), - canTestNumericNullsAsDefaultValues ? ImmutableList.of("0", "2") : ImmutableList.of("0") + ImmutableList.of("0") ); assertFilterMatches(new EqualityFilter("d0", ColumnType.LONG, 60L, null), ImmutableList.of("4")); @@ -887,9 +671,7 @@ public void testArrays() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("1", "4", "5") - : ImmutableList.of("1", "2", "4", "5") + ImmutableList.of("1", "4", "5") ); assertFilterMatches( new EqualityFilter( @@ -936,9 +718,7 @@ public void testArrays() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("0", "1", "3", "4", "5") - : ImmutableList.of("0", "1", "2", "3", "4", "5") + ImmutableList.of("0", "1", "3", "4", "5") ); @@ -960,9 +740,7 @@ public void testArrays() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("1", "4", "5") - : ImmutableList.of("1", "3", "4", "5") + ImmutableList.of("1", "4", "5") ); assertFilterMatches( new EqualityFilter( @@ -1009,9 +787,7 @@ public void testArrays() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("0", "1", "2", "4", "5") - : ImmutableList.of("0", "1", "2", "3", "4", "5") + ImmutableList.of("0", "1", "2", "4", "5") ); // test loss of precision matching long arrays with double array match values @@ -1062,9 +838,7 @@ public void testArrays() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("2", "3", "4") - : ImmutableList.of("2", "3", "4", "5") + ImmutableList.of("2", "3", "4") ); assertFilterMatches( new EqualityFilter( @@ -1111,9 +885,7 @@ public void testArrays() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("0", "1", "2", "3", "4") - : ImmutableList.of("0", "1", "2", "3", "4", "5") + ImmutableList.of("0", "1", "2", "3", "4") ); } @@ -1228,94 +1000,47 @@ public void testNestedColumnEquality() // nested column mirrors the top level columns, so these cases are copied from other tests Assume.assumeTrue(canTestArrayColumns()); - if (NullHandling.sqlCompatible()) { - assertFilterMatches( - new EqualityFilter("nested.s0", ColumnType.STRING, "", null), - ImmutableList.of("0") - ); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("nested.s0", ColumnType.STRING, "", null)), - ImmutableList.of("1", "2", "4", "5") - ); - } + assertFilterMatches( + new EqualityFilter("nested.s0", ColumnType.STRING, "", null), + ImmutableList.of("0") + ); + assertFilterMatches( + NotDimFilter.of(new EqualityFilter("nested.s0", ColumnType.STRING, "", null)), + ImmutableList.of("1", "2", "4", "5") + ); assertFilterMatches(new EqualityFilter("nested.s0", ColumnType.STRING, "a", null), ImmutableList.of("1", "5")); assertFilterMatches(new EqualityFilter("nested.s0", ColumnType.STRING, "b", null), ImmutableList.of("2")); assertFilterMatches(new EqualityFilter("nested.s0", ColumnType.STRING, "c", null), ImmutableList.of("4")); assertFilterMatches(new EqualityFilter("nested.s0", ColumnType.STRING, "noexist", null), ImmutableList.of()); - if (NullHandling.sqlCompatible()) { - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("nested.s0", ColumnType.STRING, "a", null)), - ImmutableList.of("0", "2", "4") - ); - // "(s0 = 'a') is not true", same rows as "s0 <> 'a'", but also with null rows - assertFilterMatches( - NotDimFilter.of(IsTrueDimFilter.of(new EqualityFilter("nested.s0", ColumnType.STRING, "a", null))), - ImmutableList.of("0", "2", "3", "4") - ); - // "(s0 = 'a') is true", equivalent to "s0 = 'a'" - assertFilterMatches( - IsTrueDimFilter.of(new EqualityFilter("nested.s0", ColumnType.STRING, "a", null)), - ImmutableList.of("1", "5") - ); - // "(s0 = 'a') is false", equivalent results to "s0 <> 'a'" - assertFilterMatches( - IsFalseDimFilter.of(new EqualityFilter("nested.s0", ColumnType.STRING, "a", null)), - ImmutableList.of("0", "2", "4") - ); - // "(s0 = 'a') is not false", same rows as "s0 = 'a'", but also with null rows - assertFilterMatches( - NotDimFilter.of(IsFalseDimFilter.of(new EqualityFilter("nested.s0", ColumnType.STRING, "a", null))), - ImmutableList.of("1", "3", "5") - ); - - try { - // make sure if 3vl is disabled with behave with 2vl - NullHandling.initializeForTestsWithValues(false, false, null); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("nested.s0", ColumnType.STRING, "a", null)), - ImmutableList.of("0", "2", "3", "4") - ); - } - finally { - NullHandling.initializeForTests(); - } - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("nested.s0", ColumnType.STRING, "noexist", null)), - ImmutableList.of("0", "1", "2", "4", "5") - ); - } else { - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("nested.s0", ColumnType.STRING, "a", null)), - ImmutableList.of("0", "2", "3", "4") - ); - assertFilterMatches( - NotDimFilter.of(new EqualityFilter("nested.s0", ColumnType.STRING, "noexist", null)), - ImmutableList.of("0", "1", "2", "3", "4", "5") - ); - - // in default value mode, is true/is false are basically pointless since they have the same behavior as = and <> - // "(s0 = 'a') is not true" equivalent to "s0 <> 'a'" - assertFilterMatches( - NotDimFilter.of(IsTrueDimFilter.of(new EqualityFilter("nested.s0", ColumnType.STRING, "a", null))), - ImmutableList.of("0", "2", "3", "4") - ); - // "(s0 = 'a') is true", equivalent to "s0 = 'a'" - assertFilterMatches( - IsTrueDimFilter.of(new EqualityFilter("nested.s0", ColumnType.STRING, "a", null)), - ImmutableList.of("1", "5") - ); - // "(s0 = 'a') is false" equivalent to "s0 <> 'a'" - assertFilterMatches( - IsFalseDimFilter.of(new EqualityFilter("nested.s0", ColumnType.STRING, "a", null)), - ImmutableList.of("0", "2", "3", "4") - ); - // "(s0 = 'a') is not false", equivalent to "s0 = 'a'" - assertFilterMatches( - NotDimFilter.of(IsFalseDimFilter.of(new EqualityFilter("nested.s0", ColumnType.STRING, "a", null))), - ImmutableList.of("1", "5") - ); - } + assertFilterMatches( + NotDimFilter.of(new EqualityFilter("nested.s0", ColumnType.STRING, "a", null)), + ImmutableList.of("0", "2", "4") + ); + // "(s0 = 'a') is not true", same rows as "s0 <> 'a'", but also with null rows + assertFilterMatches( + NotDimFilter.of(IsTrueDimFilter.of(new EqualityFilter("nested.s0", ColumnType.STRING, "a", null))), + ImmutableList.of("0", "2", "3", "4") + ); + // "(s0 = 'a') is true", equivalent to "s0 = 'a'" + assertFilterMatches( + IsTrueDimFilter.of(new EqualityFilter("nested.s0", ColumnType.STRING, "a", null)), + ImmutableList.of("1", "5") + ); + // "(s0 = 'a') is false", equivalent results to "s0 <> 'a'" + assertFilterMatches( + IsFalseDimFilter.of(new EqualityFilter("nested.s0", ColumnType.STRING, "a", null)), + ImmutableList.of("0", "2", "4") + ); + // "(s0 = 'a') is not false", same rows as "s0 = 'a'", but also with null rows + assertFilterMatches( + NotDimFilter.of(IsFalseDimFilter.of(new EqualityFilter("nested.s0", ColumnType.STRING, "a", null))), + ImmutableList.of("1", "3", "5") + ); + assertFilterMatches( + NotDimFilter.of(new EqualityFilter("nested.s0", ColumnType.STRING, "noexist", null)), + ImmutableList.of("0", "1", "2", "4", "5") + ); /* dim0 d0 l0 @@ -1332,16 +1057,12 @@ public void testNestedColumnEquality() assertFilterMatches(new EqualityFilter("nested.d0", ColumnType.DOUBLE, 0.0, null), ImmutableList.of("0")); assertFilterMatches( NotDimFilter.of(new EqualityFilter("nested.d0", ColumnType.DOUBLE, 0.0, null)), - NullHandling.sqlCompatible() - ? ImmutableList.of("1", "3", "4", "5") - : ImmutableList.of("1", "2", "3", "4", "5") + ImmutableList.of("1", "3", "4", "5") ); assertFilterMatches(new EqualityFilter("nested.l0", ColumnType.LONG, 0L, null), ImmutableList.of("0")); assertFilterMatches( NotDimFilter.of(new EqualityFilter("nested.l0", ColumnType.LONG, 0L, null)), - NullHandling.sqlCompatible() - ? ImmutableList.of("1", "2", "4", "5") - : ImmutableList.of("1", "2", "3", "4", "5") + ImmutableList.of("1", "2", "4", "5") ); assertFilterMatches(new EqualityFilter("nested.l0", ColumnType.STRING, "0", null), ImmutableList.of("0")); @@ -1400,9 +1121,7 @@ public void testNestedColumnEquality() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("1", "4", "5") - : ImmutableList.of("1", "2", "4", "5") + ImmutableList.of("1", "4", "5") ); assertFilterMatches( new EqualityFilter( @@ -1449,9 +1168,7 @@ public void testNestedColumnEquality() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("0", "1", "3", "4", "5") - : ImmutableList.of("0", "1", "2", "3", "4", "5") + ImmutableList.of("0", "1", "3", "4", "5") ); @@ -1473,9 +1190,7 @@ public void testNestedColumnEquality() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("1", "4", "5") - : ImmutableList.of("1", "3", "4", "5") + ImmutableList.of("1", "4", "5") ); assertFilterMatches( new EqualityFilter( @@ -1522,9 +1237,7 @@ public void testNestedColumnEquality() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("0", "1", "2", "4", "5") - : ImmutableList.of("0", "1", "2", "3", "4", "5") + ImmutableList.of("0", "1", "2", "4", "5") ); // test loss of precision matching long arrays with double array match values @@ -1575,9 +1288,7 @@ public void testNestedColumnEquality() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("2", "3", "4") - : ImmutableList.of("2", "3", "4", "5") + ImmutableList.of("2", "3", "4") ); assertFilterMatches( new EqualityFilter( @@ -1624,9 +1335,7 @@ public void testNestedColumnEquality() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("0", "1", "2", "3", "4") - : ImmutableList.of("0", "1", "2", "3", "4", "5") + ImmutableList.of("0", "1", "2", "3", "4") ); } @@ -1662,9 +1371,7 @@ public void testArraysAsMvds() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("1", "4") - : ImmutableList.of("1", "2", "4", "5") + ImmutableList.of("1", "4") ); assertFilterMatchesSkipVectorizeUnlessFallback( @@ -1685,9 +1392,7 @@ public void testArraysAsMvds() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("1", "5") - : ImmutableList.of("1", "3", "4", "5") + ImmutableList.of("1", "5") ); assertFilterMatchesSkipVectorizeUnlessFallback( @@ -1708,9 +1413,7 @@ public void testArraysAsMvds() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("3", "4") - : ImmutableList.of("2", "3", "4", "5") + ImmutableList.of("3", "4") ); assertFilterMatchesSkipVectorizeUnlessFallback( diff --git a/processing/src/test/java/org/apache/druid/segment/filter/ExpressionFilterTest.java b/processing/src/test/java/org/apache/druid/segment/filter/ExpressionFilterTest.java index 9311a90b4e47..5509af296941 100644 --- a/processing/src/test/java/org/apache/druid/segment/filter/ExpressionFilterTest.java +++ b/processing/src/test/java/org/apache/druid/segment/filter/ExpressionFilterTest.java @@ -24,7 +24,6 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import nl.jqno.equalsverifier.EqualsVerifier; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.data.input.impl.DimensionsSpec; import org.apache.druid.data.input.impl.FloatDimensionSchema; @@ -143,14 +142,10 @@ public void testOneSingleValuedStringColumn() assertFilterMatches(edf("dim3 == 1.0"), ImmutableList.of("3", "4", "6")); assertFilterMatches(edf("dim3 == 1.234"), ImmutableList.of("9")); assertFilterMatches(edf("dim3 < '2'"), ImmutableList.of("0", "1", "3", "4", "6", "9")); - if (NullHandling.replaceWithDefault()) { - assertFilterMatches(edf("dim3 < 2"), ImmutableList.of("0", "3", "4", "6", "7", "9")); - assertFilterMatches(edf("dim3 < 2.0"), ImmutableList.of("0", "3", "4", "6", "7", "9")); - } else { - // Empty String and "a" will not match - assertFilterMatches(edf("dim3 < 2"), ImmutableList.of("3", "4", "6", "9")); - assertFilterMatches(edf("dim3 < 2.0"), ImmutableList.of("3", "4", "6", "9")); - } + + // Empty String and "a" will not match + assertFilterMatches(edf("dim3 < 2"), ImmutableList.of("3", "4", "6", "9")); + assertFilterMatches(edf("dim3 < 2.0"), ImmutableList.of("3", "4", "6", "9")); assertFilterMatchesSkipVectorize(edf("like(dim3, '1%')"), ImmutableList.of("1", "3", "4", "6", "9")); assertFilterMatchesSkipVectorize(edf("array_contains(dim3, '1')"), ImmutableList.of("3", "4", "6")); } @@ -158,27 +153,17 @@ public void testOneSingleValuedStringColumn() @Test public void testComplement() { - if (NullHandling.sqlCompatible()) { - assertFilterMatches(edf("dim5 == 'a'"), ImmutableList.of("0")); - assertFilterMatches( - NotDimFilter.of(edf("dim5 == 'a'")), - ImmutableList.of("1", "3", "4", "5", "6", "7", "8") - ); - assertFilterMatches( - edf("dim5 == ''"), ImmutableList.of("4") - ); - assertFilterMatches( - NotDimFilter.of(edf("dim5 == ''")), ImmutableList.of("0", "1", "3", "5", "6", "7", "8") - ); - } else { - assertFilterMatches(edf("dim5 == 'a'"), ImmutableList.of("0")); - assertFilterMatches( - NotDimFilter.of(edf("dim5 == 'a'")), - NullHandling.sqlCompatible() - ? ImmutableList.of("1", "3", "5", "6", "7", "8") - : ImmutableList.of("1", "2", "3", "4", "5", "6", "7", "8", "9") - ); - } + assertFilterMatches(edf("dim5 == 'a'"), ImmutableList.of("0")); + assertFilterMatches( + NotDimFilter.of(edf("dim5 == 'a'")), + ImmutableList.of("1", "3", "4", "5", "6", "7", "8") + ); + assertFilterMatches( + edf("dim5 == ''"), ImmutableList.of("4") + ); + assertFilterMatches( + NotDimFilter.of(edf("dim5 == ''")), ImmutableList.of("0", "1", "3", "5", "6", "7", "8") + ); } @Test @@ -188,13 +173,9 @@ public void testOneMultiValuedStringColumn() if (isAutoSchema()) { return; } - if (NullHandling.replaceWithDefault()) { - assertFilterMatchesSkipVectorize(edf("dim4 == ''"), ImmutableList.of("1", "2", "6", "7", "8")); - } else { - assertFilterMatchesSkipVectorize(edf("dim4 == ''"), ImmutableList.of("2")); - // AS per SQL standard null == null returns false. - assertFilterMatchesSkipVectorize(edf("dim4 == null"), ImmutableList.of()); - } + assertFilterMatchesSkipVectorize(edf("dim4 == ''"), ImmutableList.of("2")); + // AS per SQL standard null == null returns false. + assertFilterMatchesSkipVectorize(edf("dim4 == null"), ImmutableList.of()); assertFilterMatchesSkipVectorize(edf("dim4 == '1'"), ImmutableList.of("0")); assertFilterMatchesSkipVectorize(edf("dim4 == '3'"), ImmutableList.of("3")); assertFilterMatchesSkipVectorize(edf("dim4 == '4'"), ImmutableList.of("4", "5")); @@ -213,12 +194,8 @@ public void testSingleAndMultiValuedStringColumn() @Test public void testOneLongColumn() { - if (NullHandling.replaceWithDefault()) { - assertFilterMatches(edf("dim1 == ''"), ImmutableList.of("0")); - } else { - // A long does not match empty string - assertFilterMatches(edf("dim1 == ''"), ImmutableList.of()); - } + // A long does not match empty string + assertFilterMatches(edf("dim1 == ''"), ImmutableList.of()); assertFilterMatches(edf("dim1 == '1'"), ImmutableList.of("1")); assertFilterMatches(edf("dim1 == 2"), ImmutableList.of("2")); assertFilterMatches(edf("dim1 < '2'"), ImmutableList.of("0", "1")); @@ -230,12 +207,8 @@ public void testOneLongColumn() @Test public void testOneFloatColumn() { - if (NullHandling.replaceWithDefault()) { - assertFilterMatches(edf("dim2 == ''"), ImmutableList.of("0")); - } else { - // A float does not match empty string - assertFilterMatches(edf("dim2 == ''"), ImmutableList.of()); - } + // A float does not match empty string + assertFilterMatches(edf("dim2 == ''"), ImmutableList.of()); assertFilterMatches(edf("dim2 == '1'"), ImmutableList.of("1")); assertFilterMatches(edf("dim2 == 2"), ImmutableList.of("2")); assertFilterMatches(edf("dim2 < '2'"), ImmutableList.of("0", "1")); @@ -260,19 +233,11 @@ public void testCompareColumns() // String vs string assertFilterMatches(edf("dim0 == dim3"), ImmutableList.of("2", "5", "8")); - if (NullHandling.replaceWithDefault()) { - // String vs long - assertFilterMatches(edf("dim1 == dim3"), ImmutableList.of("0", "2", "5", "8")); + // String vs long + assertFilterMatches(edf("dim1 == dim3"), ImmutableList.of("2", "5", "8")); - // String vs float - assertFilterMatches(edf("dim2 == dim3"), ImmutableList.of("0", "2", "5", "8")); - } else { - // String vs long - assertFilterMatches(edf("dim1 == dim3"), ImmutableList.of("2", "5", "8")); - - // String vs float - assertFilterMatches(edf("dim2 == dim3"), ImmutableList.of("2", "5", "8")); - } + // String vs float + assertFilterMatches(edf("dim2 == dim3"), ImmutableList.of("2", "5", "8")); // auto type columns ingest arrays instead of mvds if (isAutoSchema()) { @@ -287,15 +252,15 @@ public void testNullNotUnknown() { assertFilterMatchesSkipVectorize( edf("isfalse(dim5)"), - NullHandling.sqlCompatible() ? ImmutableList.of("0", "1", "3", "4", "5", "6", "7", "8") : ImmutableList.of("0", "1", "3", "5", "6", "7", "8") + ImmutableList.of("0", "1", "3", "4", "5", "6", "7", "8") ); assertFilterMatchesSkipVectorize( edf("!isfalse(dim5)"), - NullHandling.sqlCompatible() ? ImmutableList.of("2", "9") : ImmutableList.of("2", "4", "9") + ImmutableList.of("2", "9") ); assertFilterMatchesSkipVectorize( NotDimFilter.of(edf("isfalse(dim5)")), - NullHandling.sqlCompatible() ? ImmutableList.of("2", "9") : ImmutableList.of("2", "4", "9") + ImmutableList.of("2", "9") ); assertFilterMatchesSkipVectorize( @@ -313,52 +278,26 @@ public void testNullNotUnknown() @Test public void testMissingColumn() { - if (NullHandling.replaceWithDefault()) { - assertFilterMatches( - edf("missing == ''"), - ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7", "8", "9") - ); - assertFilterMatches( - edf("missing == otherMissing"), - ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7", "8", "9") - ); - } else { - // AS per SQL standard null == null returns false. - assertFilterMatches(edf("missing == null"), ImmutableList.of()); - // and inverted too - assertFilterMatches(NotDimFilter.of(edf("missing == null")), ImmutableList.of()); - // also this madness doesn't do madness - assertFilterMatches( - edf("missing == otherMissing"), - ImmutableList.of() - ); - assertFilterMatches( - NotDimFilter.of(edf("missing == otherMissing")), - ImmutableList.of() - ); - } + // AS per SQL standard null == null returns false. + assertFilterMatches(edf("missing == null"), ImmutableList.of()); + // and inverted too + assertFilterMatches(NotDimFilter.of(edf("missing == null")), ImmutableList.of()); + // also this madness doesn't do madness + assertFilterMatches( + edf("missing == otherMissing"), + ImmutableList.of() + ); + assertFilterMatches( + NotDimFilter.of(edf("missing == otherMissing")), + ImmutableList.of() + ); assertFilterMatches(edf("missing == '1'"), ImmutableList.of()); assertFilterMatches(edf("missing == 2"), ImmutableList.of()); - if (NullHandling.replaceWithDefault()) { - // missing equivaluent to 0 - assertFilterMatches( - edf("missing < '2'"), - ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7", "8", "9") - ); - assertFilterMatches( - edf("missing < 2"), - ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7", "8", "9") - ); - assertFilterMatches( - edf("missing < 2.0"), - ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7", "8", "9") - ); - } else { - // missing equivalent to null - assertFilterMatches(edf("missing < '2'"), ImmutableList.of()); - assertFilterMatches(edf("missing < 2"), ImmutableList.of()); - assertFilterMatches(edf("missing < 2.0"), ImmutableList.of()); - } + + // missing equivalent to null + assertFilterMatches(edf("missing < '2'"), ImmutableList.of()); + assertFilterMatches(edf("missing < 2"), ImmutableList.of()); + assertFilterMatches(edf("missing < 2.0"), ImmutableList.of()); assertFilterMatches(edf("missing > '2'"), ImmutableList.of()); assertFilterMatches(edf("missing > 2"), ImmutableList.of()); assertFilterMatches(edf("missing > 2.0"), ImmutableList.of()); diff --git a/processing/src/test/java/org/apache/druid/segment/filter/FilterPartitionTest.java b/processing/src/test/java/org/apache/druid/segment/filter/FilterPartitionTest.java index d0d2941277a6..05ad7a9221a7 100644 --- a/processing/src/test/java/org/apache/druid/segment/filter/FilterPartitionTest.java +++ b/processing/src/test/java/org/apache/druid/segment/filter/FilterPartitionTest.java @@ -21,7 +21,6 @@ import com.google.common.base.Function; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.java.util.common.Pair; import org.apache.druid.js.JavaScriptConfig; @@ -107,35 +106,34 @@ public Filter toFilter() { ExtractionFn extractionFn = getExtractionFn(); String dimension = getDimension(); - String value = getValue(); + final String value = getValue(); if (extractionFn == null) { return new NoBitmapSelectorFilter(dimension, value); } else { - final String valueOrNull = NullHandling.emptyToNullIfNeeded(value); final DruidPredicateFactory predicateFactory = new DruidPredicateFactory() { @Override public DruidObjectPredicate makeStringPredicate() { - return valueOrNull == null ? DruidObjectPredicate.isNull() : DruidObjectPredicate.equalTo(valueOrNull); + return value == null ? DruidObjectPredicate.isNull() : DruidObjectPredicate.equalTo(value); } @Override public DruidLongPredicate makeLongPredicate() { - return input -> DruidPredicateMatch.of(Objects.equals(valueOrNull, String.valueOf(input))); + return input -> DruidPredicateMatch.of(Objects.equals(value, String.valueOf(input))); } @Override public DruidFloatPredicate makeFloatPredicate() { - return input -> DruidPredicateMatch.of(Objects.equals(valueOrNull, String.valueOf(input))); + return input -> DruidPredicateMatch.of(Objects.equals(value, String.valueOf(input))); } @Override public DruidDoublePredicate makeDoublePredicate() { - return input -> DruidPredicateMatch.of(Objects.equals(valueOrNull, String.valueOf(input))); + return input -> DruidPredicateMatch.of(Objects.equals(value, String.valueOf(input))); } }; @@ -177,11 +175,7 @@ public static void tearDown() throws Exception @Test public void testSinglePreFilterWithNulls() { - if (NullHandling.replaceWithDefault()) { - assertFilterMatches(new SelectorDimFilter("dim1", null, null), ImmutableList.of("0")); - } else { - assertFilterMatches(new SelectorDimFilter("dim1", null, null), ImmutableList.of()); - } + assertFilterMatches(new SelectorDimFilter("dim1", null, null), ImmutableList.of()); assertFilterMatches(new SelectorDimFilter("dim1", "", null), ImmutableList.of("0")); assertFilterMatches(new SelectorDimFilter("dim1", "10", null), ImmutableList.of("1")); assertFilterMatches(new SelectorDimFilter("dim1", "2", null), ImmutableList.of("2")); @@ -194,11 +188,7 @@ public void testSinglePreFilterWithNulls() @Test public void testSinglePostFilterWithNulls() { - if (NullHandling.replaceWithDefault()) { - assertFilterMatches(new NoBitmapSelectorDimFilter("dim1", null, null), ImmutableList.of("0")); - } else { - assertFilterMatches(new NoBitmapSelectorDimFilter("dim1", null, null), ImmutableList.of()); - } + assertFilterMatches(new NoBitmapSelectorDimFilter("dim1", null, null), ImmutableList.of()); assertFilterMatches(new NoBitmapSelectorDimFilter("dim1", "", null), ImmutableList.of("0")); assertFilterMatches(new NoBitmapSelectorDimFilter("dim1", "10", null), ImmutableList.of("1")); assertFilterMatches(new NoBitmapSelectorDimFilter("dim1", "2", null), ImmutableList.of("2")); @@ -207,11 +197,7 @@ public void testSinglePostFilterWithNulls() assertFilterMatches(new NoBitmapSelectorDimFilter("dim1", "abc", null), ImmutableList.of("5", "8")); assertFilterMatches(new NoBitmapSelectorDimFilter("dim1", "ab", null), ImmutableList.of()); - if (NullHandling.replaceWithDefault()) { - assertFilterMatches(new NoBitmapSelectorDimFilter("dim1", "super-null", JS_EXTRACTION_FN), ImmutableList.of("0")); - } else { - assertFilterMatches(new NoBitmapSelectorDimFilter("dim1", "super-", JS_EXTRACTION_FN), ImmutableList.of("0")); - } + assertFilterMatches(new NoBitmapSelectorDimFilter("dim1", "super-", JS_EXTRACTION_FN), ImmutableList.of("0")); assertFilterMatches(new NoBitmapSelectorDimFilter("dim1", "super-10", JS_EXTRACTION_FN), ImmutableList.of("1")); assertFilterMatches(new NoBitmapSelectorDimFilter("dim1", "super-2", JS_EXTRACTION_FN), ImmutableList.of("2")); assertFilterMatches(new NoBitmapSelectorDimFilter("dim1", "super-1", JS_EXTRACTION_FN), ImmutableList.of("3", "9")); @@ -226,23 +212,13 @@ public void testBasicPreAndPostFilterWithNulls() if (isAutoSchema()) { return; } - if (NullHandling.replaceWithDefault()) { - assertFilterMatches( - new AndDimFilter(Arrays.asList( - new SelectorDimFilter("dim2", "a", null), - new NoBitmapSelectorDimFilter("dim1", null, null) - )), - ImmutableList.of("0") - ); - } else { - assertFilterMatches( - new AndDimFilter(Arrays.asList( - new SelectorDimFilter("dim2", "a", null), - new NoBitmapSelectorDimFilter("dim1", null, null) - )), - ImmutableList.of() - ); - } + assertFilterMatches( + new AndDimFilter(Arrays.asList( + new SelectorDimFilter("dim2", "a", null), + new NoBitmapSelectorDimFilter("dim1", null, null) + )), + ImmutableList.of() + ); assertFilterMatches( new AndDimFilter(Arrays.asList( @@ -276,51 +252,35 @@ public void testBasicPreAndPostFilterWithNulls() ImmutableList.of() ); - if (NullHandling.replaceWithDefault()) { - assertFilterMatches( - new AndDimFilter(Arrays.asList( - new SelectorDimFilter("dim2", "super-a", JS_EXTRACTION_FN), - new NoBitmapSelectorDimFilter("dim1", "super-null", JS_EXTRACTION_FN) - )), - ImmutableList.of("0") - ); - assertFilterMatches( - new AndDimFilter(Arrays.asList( - new SelectorDimFilter("dim1", "super-2", JS_EXTRACTION_FN), - new NoBitmapSelectorDimFilter("dim2", "super-null", JS_EXTRACTION_FN) - )), - ImmutableList.of("2") - ); - } else { - assertFilterMatches( - new AndDimFilter(Arrays.asList( - new SelectorDimFilter("dim2", "super-a", JS_EXTRACTION_FN), - new NoBitmapSelectorDimFilter("dim1", "super-", JS_EXTRACTION_FN) - )), - ImmutableList.of("0") - ); - assertFilterMatches( - new AndDimFilter(Arrays.asList( - new SelectorDimFilter("dim2", "super-a", JS_EXTRACTION_FN), - new NoBitmapSelectorDimFilter("dim1", "super-null", JS_EXTRACTION_FN) - )), - ImmutableList.of() - ); - assertFilterMatches( - new AndDimFilter(Arrays.asList( - new SelectorDimFilter("dim1", "super-2", JS_EXTRACTION_FN), - new NoBitmapSelectorDimFilter("dim2", "super-", JS_EXTRACTION_FN) - )), - ImmutableList.of("2") - ); - assertFilterMatches( - new AndDimFilter(Arrays.asList( - new SelectorDimFilter("dim1", "super-2", JS_EXTRACTION_FN), - new NoBitmapSelectorDimFilter("dim2", "super-null", JS_EXTRACTION_FN) - )), - ImmutableList.of() - ); - } + + assertFilterMatches( + new AndDimFilter(Arrays.asList( + new SelectorDimFilter("dim2", "super-a", JS_EXTRACTION_FN), + new NoBitmapSelectorDimFilter("dim1", "super-", JS_EXTRACTION_FN) + )), + ImmutableList.of("0") + ); + assertFilterMatches( + new AndDimFilter(Arrays.asList( + new SelectorDimFilter("dim2", "super-a", JS_EXTRACTION_FN), + new NoBitmapSelectorDimFilter("dim1", "super-null", JS_EXTRACTION_FN) + )), + ImmutableList.of() + ); + assertFilterMatches( + new AndDimFilter(Arrays.asList( + new SelectorDimFilter("dim1", "super-2", JS_EXTRACTION_FN), + new NoBitmapSelectorDimFilter("dim2", "super-", JS_EXTRACTION_FN) + )), + ImmutableList.of("2") + ); + assertFilterMatches( + new AndDimFilter(Arrays.asList( + new SelectorDimFilter("dim1", "super-2", JS_EXTRACTION_FN), + new NoBitmapSelectorDimFilter("dim2", "super-null", JS_EXTRACTION_FN) + )), + ImmutableList.of() + ); assertFilterMatches( new AndDimFilter(Arrays.asList( @@ -361,23 +321,13 @@ public void testOrPostFilterWithNulls() ImmutableList.of("0", "3") ); - if (NullHandling.replaceWithDefault()) { - assertFilterMatches( - new OrDimFilter(Arrays.asList( - new SelectorDimFilter("dim1", "abc", null), - new NoBitmapSelectorDimFilter("dim2", null, null) - )), - ImmutableList.of("1", "2", "5", "8") - ); - } else { - assertFilterMatches( - new OrDimFilter(Arrays.asList( - new SelectorDimFilter("dim1", "abc", null), - new NoBitmapSelectorDimFilter("dim2", null, null) - )), - ImmutableList.of("1", "5", "8") - ); - } + assertFilterMatches( + new OrDimFilter(Arrays.asList( + new SelectorDimFilter("dim1", "abc", null), + new NoBitmapSelectorDimFilter("dim2", null, null) + )), + ImmutableList.of("1", "5", "8") + ); assertFilterMatches( new OrDimFilter(Arrays.asList( @@ -427,30 +377,20 @@ public void testOrPostFilterWithNulls() ImmutableList.of("0", "3") ); - if (NullHandling.replaceWithDefault()) { - assertFilterMatches( - new OrDimFilter(Arrays.asList( - new SelectorDimFilter("dim1", "super-abc", JS_EXTRACTION_FN), - new NoBitmapSelectorDimFilter("dim2", "super-null", JS_EXTRACTION_FN) - )), - ImmutableList.of("1", "2", "5", "8") - ); - } else { - assertFilterMatches( - new OrDimFilter(Arrays.asList( - new SelectorDimFilter("dim1", "super-abc", JS_EXTRACTION_FN), - new NoBitmapSelectorDimFilter("dim2", "super-null", JS_EXTRACTION_FN) - )), - ImmutableList.of("1", "5", "8") - ); - assertFilterMatches( - new OrDimFilter(Arrays.asList( - new SelectorDimFilter("dim1", "super-abc", JS_EXTRACTION_FN), - new NoBitmapSelectorDimFilter("dim2", "super-", JS_EXTRACTION_FN) - )), - ImmutableList.of("2", "5", "8") - ); - } + assertFilterMatches( + new OrDimFilter(Arrays.asList( + new SelectorDimFilter("dim1", "super-abc", JS_EXTRACTION_FN), + new NoBitmapSelectorDimFilter("dim2", "super-null", JS_EXTRACTION_FN) + )), + ImmutableList.of("1", "5", "8") + ); + assertFilterMatches( + new OrDimFilter(Arrays.asList( + new SelectorDimFilter("dim1", "super-abc", JS_EXTRACTION_FN), + new NoBitmapSelectorDimFilter("dim2", "super-", JS_EXTRACTION_FN) + )), + ImmutableList.of("2", "5", "8") + ); assertFilterMatches( new OrDimFilter(Arrays.asList( @@ -495,14 +435,8 @@ public void testOrPostFilterWithNulls() public void testMissingColumnSpecifiedInDimensionList() { assertFilterMatches(new NoBitmapSelectorDimFilter("dim3", null, null), ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7", "8", "9")); - if (NullHandling.replaceWithDefault()) { - assertFilterMatches( - new NoBitmapSelectorDimFilter("dim3", "", null), - ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7", "8", "9") - ); - } else { - assertFilterMatches(new NoBitmapSelectorDimFilter("dim3", "", null), ImmutableList.of()); - } + + assertFilterMatches(new NoBitmapSelectorDimFilter("dim3", "", null), ImmutableList.of()); assertFilterMatches(new NoBitmapSelectorDimFilter("dim3", "a", null), ImmutableList.of()); assertFilterMatches(new NoBitmapSelectorDimFilter("dim3", "b", null), ImmutableList.of()); assertFilterMatches(new NoBitmapSelectorDimFilter("dim3", "c", null), ImmutableList.of()); @@ -552,17 +486,11 @@ public void testMissingColumnSpecifiedInDimensionList() public void testMissingColumnNotSpecifiedInDimensionList() { assertFilterMatches(new NoBitmapSelectorDimFilter("dim4", null, null), ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7", "8", "9")); - if (NullHandling.replaceWithDefault()) { - assertFilterMatches( - new NoBitmapSelectorDimFilter("dim4", "", null), - ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7", "8", "9") - ); - } else { - assertFilterMatches( - new NoBitmapSelectorDimFilter("dim4", "", null), - ImmutableList.of() - ); - } + + assertFilterMatches( + new NoBitmapSelectorDimFilter("dim4", "", null), + ImmutableList.of() + ); assertFilterMatches(new NoBitmapSelectorDimFilter("dim4", "a", null), ImmutableList.of()); assertFilterMatches(new NoBitmapSelectorDimFilter("dim4", "b", null), ImmutableList.of()); assertFilterMatches(new NoBitmapSelectorDimFilter("dim4", "c", null), ImmutableList.of()); diff --git a/processing/src/test/java/org/apache/druid/segment/filter/InFilterTests.java b/processing/src/test/java/org/apache/druid/segment/filter/InFilterTests.java index fb0ebbfb031f..67dcdde27afe 100644 --- a/processing/src/test/java/org/apache/druid/segment/filter/InFilterTests.java +++ b/processing/src/test/java/org/apache/druid/segment/filter/InFilterTests.java @@ -30,7 +30,6 @@ import com.google.common.collect.RangeSet; import com.google.common.collect.Sets; import nl.jqno.equalsverifier.EqualsVerifier; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.error.DruidException; import org.apache.druid.jackson.DefaultObjectMapper; @@ -139,28 +138,15 @@ public void testSingleValueStringColumnWithoutNulls() ImmutableList.of("a", "b", "c", "d", "f") ); - if (NullHandling.sqlCompatible()) { - assertTypedFilterMatches( - inFilter("dim1", ColumnType.LONG, Arrays.asList(2L, 10L)), - ImmutableList.of("b", "c") - ); - - assertTypedFilterMatches( - inFilter("dim1", ColumnType.DOUBLE, Arrays.asList(2.0, 10.0)), - ImmutableList.of("b", "c") - ); - } else { - // in default value mode, we actually end up using a classic InDimFilter, it does not match numbers well - assertTypedFilterMatches( - inFilter("dim1", ColumnType.LONG, Arrays.asList(2L, 10L)), - ImmutableList.of("b", "c") - ); + assertTypedFilterMatches( + inFilter("dim1", ColumnType.LONG, Arrays.asList(2L, 10L)), + ImmutableList.of("b", "c") + ); - assertTypedFilterMatches( - inFilter("dim1", ColumnType.DOUBLE, Arrays.asList(2.0, 10.0)), - ImmutableList.of() - ); - } + assertTypedFilterMatches( + inFilter("dim1", ColumnType.DOUBLE, Arrays.asList(2.0, 10.0)), + ImmutableList.of("b", "c") + ); } @Test public void testSingleValueStringColumnWithNulls() @@ -190,46 +176,22 @@ public void testSingleValueStringColumnWithNulls() ImmutableList.of() ); - if (NullHandling.sqlCompatible()) { - assertFilterMatches( - inFilter("dim1", ColumnType.STRING, Arrays.asList(null, "10", "abc")), - ImmutableList.of("b", "f") - ); - assertFilterMatches( - NotDimFilter.of(inFilter("dim1", ColumnType.STRING, Arrays.asList("-1", "ab", "de"))), - ImmutableList.of("a", "b", "c", "d", "e", "f") - ); - assertFilterMatches( - NotDimFilter.of(inFilter("s0", ColumnType.STRING, Arrays.asList("a", "b"))), - ImmutableList.of("a", "e") - ); - assertFilterMatches( - NotDimFilter.of(inFilter("s0", ColumnType.STRING, Collections.singletonList("noexist"))), - ImmutableList.of("a", "b", "d", "e", "f") - ); - } else { - // typed in filter doesn't support default value mode, so use classic filter only - assertLegacyFilterMatches( - legacyInFilter("dim1", null, "10", "abc"), - ImmutableList.of("a", "b", "f") - ); - assertLegacyFilterMatches( - legacyInFilter("dim1", null, "10", "abc"), - ImmutableList.of("a", "b", "f") - ); - assertLegacyFilterMatches( - NotDimFilter.of(legacyInFilter("dim1", "-1", "ab", "de")), - ImmutableList.of("a", "b", "c", "d", "e", "f") - ); - assertLegacyFilterMatches( - NotDimFilter.of(legacyInFilter("s0", "a", "b")), - ImmutableList.of("a", "c", "e") - ); - assertLegacyFilterMatches( - NotDimFilter.of(legacyInFilter("s0", "noexist")), - ImmutableList.of("a", "b", "c", "d", "e", "f") - ); - } + assertFilterMatches( + inFilter("dim1", ColumnType.STRING, Arrays.asList(null, "10", "abc")), + ImmutableList.of("b", "f") + ); + assertFilterMatches( + NotDimFilter.of(inFilter("dim1", ColumnType.STRING, Arrays.asList("-1", "ab", "de"))), + ImmutableList.of("a", "b", "c", "d", "e", "f") + ); + assertFilterMatches( + NotDimFilter.of(inFilter("s0", ColumnType.STRING, Arrays.asList("a", "b"))), + ImmutableList.of("a", "e") + ); + assertFilterMatches( + NotDimFilter.of(inFilter("s0", ColumnType.STRING, Collections.singletonList("noexist"))), + ImmutableList.of("a", "b", "d", "e", "f") + ); } @Test @@ -237,45 +199,22 @@ public void testMultiValueStringColumn() { Assume.assumeFalse(isAutoSchema()); - if (NullHandling.sqlCompatible()) { - assertFilterMatches( - inFilter("dim2", ColumnType.STRING, Collections.singletonList(null)), - ImmutableList.of("b", "f") - ); - assertFilterMatches( - inFilter("dim2", ColumnType.STRING, Arrays.asList(null, "a")), - ImmutableList.of("a", "b", "d", "f") - ); - assertFilterMatches( - inFilter("dim2", ColumnType.STRING, Arrays.asList(null, "b")), - ImmutableList.of("a", "b", "f") - ); - assertFilterMatches( - inFilter("dim2", ColumnType.STRING, Collections.singletonList("")), - ImmutableList.of("c") - ); - } else { - assertLegacyFilterMatches( - legacyInFilter("dim2", "b", "d"), - ImmutableList.of("a") - ); - assertLegacyFilterMatches( - legacyInFilter("dim2", null), - ImmutableList.of("b", "c", "f") - ); - assertLegacyFilterMatches( - legacyInFilter("dim2", null, "a"), - ImmutableList.of("a", "b", "c", "d", "f") - ); - assertLegacyFilterMatches( - legacyInFilter("dim2", null, "b"), - ImmutableList.of("a", "b", "c", "f") - ); - assertLegacyFilterMatches( - legacyInFilter("dim2", ""), - ImmutableList.of("b", "c", "f") - ); - } + assertFilterMatches( + inFilter("dim2", ColumnType.STRING, Collections.singletonList(null)), + ImmutableList.of("b", "f") + ); + assertFilterMatches( + inFilter("dim2", ColumnType.STRING, Arrays.asList(null, "a")), + ImmutableList.of("a", "b", "d", "f") + ); + assertFilterMatches( + inFilter("dim2", ColumnType.STRING, Arrays.asList(null, "b")), + ImmutableList.of("a", "b", "f") + ); + assertFilterMatches( + inFilter("dim2", ColumnType.STRING, Collections.singletonList("")), + ImmutableList.of("c") + ); assertFilterMatches( inFilter("dim2", ColumnType.STRING, Arrays.asList("", null)), @@ -323,47 +262,27 @@ public void testMissingColumn() ); - if (NullHandling.sqlCompatible()) { - assertFilterMatches( - inFilter("dim3", ColumnType.STRING, Collections.singletonList("")), - ImmutableList.of() - ); - assertFilterMatches( - NotDimFilter.of(inFilter("dim3", ColumnType.STRING, Collections.singletonList(""))), - ImmutableList.of() - ); - assertFilterMatches( - NotDimFilter.of(inFilter("dim3", ColumnType.STRING, Collections.singletonList("a"))), - ImmutableList.of() - ); - assertFilterMatches( - NotDimFilter.of(inFilter("dim3", ColumnType.STRING, Arrays.asList(null, "a"))), - ImmutableList.of() - ); - } else { - assertLegacyFilterMatches( - legacyInFilter("dim3", ""), - ImmutableList.of("a", "b", "c", "d", "e", "f") - ); - assertLegacyFilterMatches( - NotDimFilter.of(legacyInFilter("dim3", "")), - ImmutableList.of() - ); - assertLegacyFilterMatches( - NotDimFilter.of(legacyInFilter("dim3", "a")), - ImmutableList.of("a", "b", "c", "d", "e", "f") - ); - assertLegacyFilterMatches( - NotDimFilter.of(legacyInFilter("dim3", null, "a")), - ImmutableList.of() - ); - } + assertFilterMatches( + inFilter("dim3", ColumnType.STRING, Collections.singletonList("")), + ImmutableList.of() + ); + assertFilterMatches( + NotDimFilter.of(inFilter("dim3", ColumnType.STRING, Collections.singletonList(""))), + ImmutableList.of() + ); + assertFilterMatches( + NotDimFilter.of(inFilter("dim3", ColumnType.STRING, Collections.singletonList("a"))), + ImmutableList.of() + ); + assertFilterMatches( + NotDimFilter.of(inFilter("dim3", ColumnType.STRING, Arrays.asList(null, "a"))), + ImmutableList.of() + ); } @Test public void testNumeric() { - Assume.assumeTrue(NullHandling.sqlCompatible()); assertFilterMatches( inFilter("f0", ColumnType.FLOAT, Collections.singletonList(0f)), ImmutableList.of("a") @@ -441,77 +360,43 @@ public void testNumeric() @Test public void testLegacyNumericDefaults() { - if (canTestNumericNullsAsDefaultValues) { - assertLegacyFilterMatches(new InDimFilter("f0", Sets.newHashSet("0"), null), ImmutableList.of("a", "e")); - assertLegacyFilterMatches(new InDimFilter("d0", Sets.newHashSet("0"), null), ImmutableList.of("a", "c")); - assertLegacyFilterMatches(new InDimFilter("l0", Sets.newHashSet("0"), null), ImmutableList.of("a", "d")); - assertLegacyFilterMatches( - NotDimFilter.of(new InDimFilter("f0", Sets.newHashSet("0"), null)), - ImmutableList.of("b", "c", "d", "f") - ); - assertLegacyFilterMatches( - NotDimFilter.of(new InDimFilter("d0", Sets.newHashSet("0"), null)), - ImmutableList.of("b", "d", "e", "f") - ); - assertLegacyFilterMatches( - NotDimFilter.of(new InDimFilter("l0", Sets.newHashSet("0"), null)), - ImmutableList.of("b", "c", "e", "f") - ); - assertLegacyFilterMatches(new InDimFilter("f0", Collections.singleton(null), null), ImmutableList.of()); - assertLegacyFilterMatches(new InDimFilter("d0", Collections.singleton(null), null), ImmutableList.of()); - assertLegacyFilterMatches(new InDimFilter("l0", Collections.singleton(null), null), ImmutableList.of()); - - assertLegacyFilterMatches(new InDimFilter("f0", Sets.newHashSet("0", "999"), null), ImmutableList.of("a", "e")); - assertLegacyFilterMatches(new InDimFilter("d0", Sets.newHashSet("0", "999"), null), ImmutableList.of("a", "c")); - assertLegacyFilterMatches(new InDimFilter("l0", Sets.newHashSet("0", "999"), null), ImmutableList.of("a", "d")); - assertLegacyFilterMatches(new InDimFilter("f0", Sets.newHashSet(null, "999"), null), ImmutableList.of()); - assertLegacyFilterMatches(new InDimFilter("d0", Sets.newHashSet(null, "999"), null), ImmutableList.of()); - assertLegacyFilterMatches(new InDimFilter("l0", Sets.newHashSet(null, "999"), null), ImmutableList.of()); - } else { - assertLegacyFilterMatches(new InDimFilter("f0", Sets.newHashSet("0"), null), ImmutableList.of("a")); - assertLegacyFilterMatches(new InDimFilter("d0", Sets.newHashSet("0"), null), ImmutableList.of("a")); - assertLegacyFilterMatches(new InDimFilter("l0", Sets.newHashSet("0"), null), ImmutableList.of("a")); - assertLegacyFilterMatches( - NotDimFilter.of(new InDimFilter("f0", Sets.newHashSet("0"), null)), - NullHandling.sqlCompatible() - ? ImmutableList.of("b", "c", "d", "f") - : ImmutableList.of("b", "c", "d", "e", "f") - ); - assertLegacyFilterMatches( - NotDimFilter.of(new InDimFilter("d0", Sets.newHashSet("0"), null)), - NullHandling.sqlCompatible() - ? ImmutableList.of("b", "d", "e", "f") - : ImmutableList.of("b", "c", "d", "e", "f") - ); - assertLegacyFilterMatches( - NotDimFilter.of(new InDimFilter("l0", Sets.newHashSet("0"), null)), - NullHandling.sqlCompatible() - ? ImmutableList.of("b", "c", "e", "f") - : ImmutableList.of("b", "c", "d", "e", "f") - ); - assertLegacyFilterMatches(new InDimFilter("f0", Collections.singleton(null), null), ImmutableList.of("e")); - assertLegacyFilterMatches(new InDimFilter("d0", Collections.singleton(null), null), ImmutableList.of("c")); - assertLegacyFilterMatches(new InDimFilter("l0", Collections.singleton(null), null), ImmutableList.of("d")); - assertLegacyFilterMatches( - NotDimFilter.of(new InDimFilter("f0", Collections.singleton(null), null)), - ImmutableList.of("a", "b", "c", "d", "f") - ); - assertLegacyFilterMatches( - NotDimFilter.of(new InDimFilter("d0", Collections.singleton(null), null)), - ImmutableList.of("a", "b", "d", "e", "f") - ); - assertLegacyFilterMatches( - NotDimFilter.of(new InDimFilter("l0", Collections.singleton(null), null)), - ImmutableList.of("a", "b", "c", "e", "f") - ); + assertLegacyFilterMatches(new InDimFilter("f0", Sets.newHashSet("0"), null), ImmutableList.of("a")); + assertLegacyFilterMatches(new InDimFilter("d0", Sets.newHashSet("0"), null), ImmutableList.of("a")); + assertLegacyFilterMatches(new InDimFilter("l0", Sets.newHashSet("0"), null), ImmutableList.of("a")); + assertLegacyFilterMatches( + NotDimFilter.of(new InDimFilter("f0", Sets.newHashSet("0"), null)), + ImmutableList.of("b", "c", "d", "f") + ); + assertLegacyFilterMatches( + NotDimFilter.of(new InDimFilter("d0", Sets.newHashSet("0"), null)), + ImmutableList.of("b", "d", "e", "f") + ); + assertLegacyFilterMatches( + NotDimFilter.of(new InDimFilter("l0", Sets.newHashSet("0"), null)), + ImmutableList.of("b", "c", "e", "f") + ); + assertLegacyFilterMatches(new InDimFilter("f0", Collections.singleton(null), null), ImmutableList.of("e")); + assertLegacyFilterMatches(new InDimFilter("d0", Collections.singleton(null), null), ImmutableList.of("c")); + assertLegacyFilterMatches(new InDimFilter("l0", Collections.singleton(null), null), ImmutableList.of("d")); + assertLegacyFilterMatches( + NotDimFilter.of(new InDimFilter("f0", Collections.singleton(null), null)), + ImmutableList.of("a", "b", "c", "d", "f") + ); + assertLegacyFilterMatches( + NotDimFilter.of(new InDimFilter("d0", Collections.singleton(null), null)), + ImmutableList.of("a", "b", "d", "e", "f") + ); + assertLegacyFilterMatches( + NotDimFilter.of(new InDimFilter("l0", Collections.singleton(null), null)), + ImmutableList.of("a", "b", "c", "e", "f") + ); - assertLegacyFilterMatches(new InDimFilter("f0", Sets.newHashSet("0", "999"), null), ImmutableList.of("a")); - assertLegacyFilterMatches(new InDimFilter("d0", Sets.newHashSet("0", "999"), null), ImmutableList.of("a")); - assertLegacyFilterMatches(new InDimFilter("l0", Sets.newHashSet("0", "999"), null), ImmutableList.of("a")); - assertLegacyFilterMatches(new InDimFilter("f0", Sets.newHashSet(null, "999"), null), ImmutableList.of("e")); - assertLegacyFilterMatches(new InDimFilter("d0", Sets.newHashSet(null, "999"), null), ImmutableList.of("c")); - assertLegacyFilterMatches(new InDimFilter("l0", Sets.newHashSet(null, "999"), null), ImmutableList.of("d")); - } + assertLegacyFilterMatches(new InDimFilter("f0", Sets.newHashSet("0", "999"), null), ImmutableList.of("a")); + assertLegacyFilterMatches(new InDimFilter("d0", Sets.newHashSet("0", "999"), null), ImmutableList.of("a")); + assertLegacyFilterMatches(new InDimFilter("l0", Sets.newHashSet("0", "999"), null), ImmutableList.of("a")); + assertLegacyFilterMatches(new InDimFilter("f0", Sets.newHashSet(null, "999"), null), ImmutableList.of("e")); + assertLegacyFilterMatches(new InDimFilter("d0", Sets.newHashSet(null, "999"), null), ImmutableList.of("c")); + assertLegacyFilterMatches(new InDimFilter("l0", Sets.newHashSet(null, "999"), null), ImmutableList.of("d")); } @Test public void testLegacyMatchWithExtractionFn() @@ -522,58 +407,31 @@ public void testLegacyMatchWithExtractionFn() String nullJsFn = "function(str) { if (str === null) { return 'YES'; } else { return 'NO';} }"; ExtractionFn yesNullFn = new JavaScriptExtractionFn(nullJsFn, false, JavaScriptConfig.getEnabledInstance()); - if (NullHandling.replaceWithDefault()) { - assertFilterMatchesSkipArrays( - legacyInFilterWithFn("dim2", superFn, "super-null", "super-a", "super-b"), - ImmutableList.of("a", "b", "c", "d", "f") - ); - assertFilterMatchesSkipArrays( - NotDimFilter.of(legacyInFilterWithFn("dim2", superFn, "super-null", "super-a", "super-b")), - ImmutableList.of("e") - ); - assertFilterMatchesSkipArrays( - legacyInFilterWithFn("dim2", yesNullFn, "YES"), - ImmutableList.of("b", "c", "f") - ); - assertFilterMatchesSkipArrays( - NotDimFilter.of(legacyInFilterWithFn("dim2", yesNullFn, "YES")), - ImmutableList.of("a", "d", "e") - ); - assertLegacyFilterMatches( - legacyInFilterWithFn("dim1", superFn, "super-null", "super-10", "super-def"), - ImmutableList.of("a", "b", "e") - ); - assertLegacyFilterMatches( - legacyInFilterWithFn("dim1", yesNullFn, "NO"), - ImmutableList.of("b", "c", "d", "e", "f") - ); - } else { - assertFilterMatchesSkipArrays( - legacyInFilterWithFn("dim2", superFn, "super-null", "super-a", "super-b"), - ImmutableList.of("a", "b", "d", "f") - ); - assertFilterMatchesSkipArrays( - NotDimFilter.of(legacyInFilterWithFn("dim2", superFn, "super-null", "super-a", "super-b")), - ImmutableList.of("c", "e") - ); - assertFilterMatchesSkipArrays( - legacyInFilterWithFn("dim2", yesNullFn, "YES"), - ImmutableList.of("b", "f") - ); - assertFilterMatchesSkipArrays( - NotDimFilter.of(legacyInFilterWithFn("dim2", yesNullFn, "YES")), - ImmutableList.of("a", "c", "d", "e") - ); - assertLegacyFilterMatches( - legacyInFilterWithFn("dim1", superFn, "super-null", "super-10", "super-def"), - ImmutableList.of("b", "e") - ); + assertFilterMatchesSkipArrays( + legacyInFilterWithFn("dim2", superFn, "super-null", "super-a", "super-b"), + ImmutableList.of("a", "b", "d", "f") + ); + assertFilterMatchesSkipArrays( + NotDimFilter.of(legacyInFilterWithFn("dim2", superFn, "super-null", "super-a", "super-b")), + ImmutableList.of("c", "e") + ); + assertFilterMatchesSkipArrays( + legacyInFilterWithFn("dim2", yesNullFn, "YES"), + ImmutableList.of("b", "f") + ); + assertFilterMatchesSkipArrays( + NotDimFilter.of(legacyInFilterWithFn("dim2", yesNullFn, "YES")), + ImmutableList.of("a", "c", "d", "e") + ); + assertLegacyFilterMatches( + legacyInFilterWithFn("dim1", superFn, "super-null", "super-10", "super-def"), + ImmutableList.of("b", "e") + ); - assertLegacyFilterMatches( - legacyInFilterWithFn("dim1", yesNullFn, "NO"), - ImmutableList.of("a", "b", "c", "d", "e", "f") - ); - } + assertLegacyFilterMatches( + legacyInFilterWithFn("dim1", yesNullFn, "NO"), + ImmutableList.of("a", "b", "c", "d", "e", "f") + ); assertLegacyFilterMatches( legacyInFilterWithFn("dim3", yesNullFn, "NO"), @@ -703,7 +561,6 @@ public static class TypedInFilterFilterNonParameterizedTests extends Initialized @Test public void testSerde() throws JsonProcessingException { - Assume.assumeTrue(NullHandling.sqlCompatible()); ObjectMapper mapper = new DefaultObjectMapper(); TypedInFilter filter = inFilter("column", ColumnType.STRING, Arrays.asList("a", "b", "c")); String s = mapper.writeValueAsString(filter); @@ -732,19 +589,9 @@ public void testSerde() throws JsonProcessingException Assert.assertEquals(filter, mapper.readValue(s, TypedInFilter.class)); } - @Test - public void testConvertToLegacy() - { - Assume.assumeTrue(NullHandling.replaceWithDefault()); - TypedInFilter aFilter = new TypedInFilter("column", ColumnType.STRING, Arrays.asList("a", "b", "c"), null, null); - Assert.assertTrue(aFilter.optimize(false) instanceof InDimFilter); - Assert.assertTrue(aFilter.toFilter() instanceof InDimFilter); - } - @Test public void testGetCacheKey() { - Assume.assumeTrue(NullHandling.sqlCompatible()); TypedInFilter filterUnsorted = inFilter("column", ColumnType.STRING, Arrays.asList("a", "b", null, "c")); TypedInFilter filterDifferent = inFilter("column", ColumnType.STRING, Arrays.asList("a", "c", "b")); TypedInFilter filterPresorted = new TypedInFilter( @@ -809,7 +656,6 @@ public void testGetCacheKey() @Test public void testInvalidParameters() { - Assume.assumeTrue(NullHandling.sqlCompatible()); Throwable t = Assert.assertThrows( DruidException.class, () -> new TypedInFilter(null, ColumnType.STRING, null, null, null) @@ -833,7 +679,6 @@ public void testInvalidParameters() @Test public void testGetDimensionRangeSet() { - Assume.assumeTrue(NullHandling.sqlCompatible()); TypedInFilter filter = inFilter("x", ColumnType.STRING, Arrays.asList(null, "a", "b", "c")); TypedInFilter filter2 = inFilter("x", ColumnType.STRING, Arrays.asList("a", "b", null, "c")); @@ -863,7 +708,6 @@ public void testGetDimensionRangeSet() @Test public void testRequiredColumnRewrite() { - Assume.assumeTrue(NullHandling.sqlCompatible()); TypedInFilter filter = inFilter("dim0", ColumnType.STRING, Arrays.asList("a", "c")); TypedInFilter filter2 = inFilter("dim1", ColumnType.STRING, Arrays.asList("a", "c")); @@ -886,7 +730,6 @@ public void testRequiredColumnRewrite() @Test public void testEquals() { - Assume.assumeTrue(NullHandling.sqlCompatible()); EqualsVerifier.forClass(TypedInFilter.class).usingGetClass() .withNonnullFields( "column", diff --git a/processing/src/test/java/org/apache/druid/segment/filter/JavaScriptFilterTest.java b/processing/src/test/java/org/apache/druid/segment/filter/JavaScriptFilterTest.java index 9e337fe6ece5..0959479ab245 100644 --- a/processing/src/test/java/org/apache/druid/segment/filter/JavaScriptFilterTest.java +++ b/processing/src/test/java/org/apache/druid/segment/filter/JavaScriptFilterTest.java @@ -23,7 +23,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import nl.jqno.equalsverifier.EqualsVerifier; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.Pair; import org.apache.druid.js.JavaScriptConfig; import org.apache.druid.query.extraction.ExtractionFn; @@ -94,12 +93,8 @@ public void testSingleValueStringColumnWithoutNulls() @Test public void testSingleValueStringColumnWithNulls() { - if (NullHandling.replaceWithDefault()) { - assertFilterMatchesSkipVectorize(newJavaScriptDimFilter("dim1", jsNullFilter, null), ImmutableList.of("0")); - } else { - assertFilterMatchesSkipVectorize(newJavaScriptDimFilter("dim1", jsNullFilter, null), ImmutableList.of()); - assertFilterMatchesSkipVectorize(newJavaScriptDimFilter("dim1", jsValueFilter(""), null), ImmutableList.of("0")); - } + assertFilterMatchesSkipVectorize(newJavaScriptDimFilter("dim1", jsNullFilter, null), ImmutableList.of()); + assertFilterMatchesSkipVectorize(newJavaScriptDimFilter("dim1", jsValueFilter(""), null), ImmutableList.of("0")); assertFilterMatchesSkipVectorize(newJavaScriptDimFilter("dim1", jsValueFilter("10"), null), ImmutableList.of("1")); assertFilterMatchesSkipVectorize(newJavaScriptDimFilter("dim1", jsValueFilter("2"), null), ImmutableList.of("2")); assertFilterMatchesSkipVectorize(newJavaScriptDimFilter("dim1", jsValueFilter("1"), null), ImmutableList.of("3")); @@ -115,15 +110,8 @@ public void testMultiValueStringColumn() return; } // multi-val null...... - if (NullHandling.replaceWithDefault()) { - assertFilterMatchesSkipVectorize( - newJavaScriptDimFilter("dim2", jsNullFilter, null), - ImmutableList.of("1", "2", "5") - ); - } else { - assertFilterMatchesSkipVectorize(newJavaScriptDimFilter("dim2", jsNullFilter, null), ImmutableList.of("1", "5")); - assertFilterMatchesSkipVectorize(newJavaScriptDimFilter("dim2", jsValueFilter(""), null), ImmutableList.of("2")); - } + assertFilterMatchesSkipVectorize(newJavaScriptDimFilter("dim2", jsNullFilter, null), ImmutableList.of("1", "5")); + assertFilterMatchesSkipVectorize(newJavaScriptDimFilter("dim2", jsValueFilter(""), null), ImmutableList.of("2")); assertFilterMatchesSkipVectorize( newJavaScriptDimFilter("dim2", jsValueFilter("a"), null), ImmutableList.of("0", "3") @@ -220,15 +208,9 @@ public void testJavascriptFilterWithLookupExtractionFn() @Test public void testNumericNull() { - if (canTestNumericNullsAsDefaultValues) { - assertFilterMatchesSkipVectorize(newJavaScriptDimFilter("f0", jsNullFilter, null), ImmutableList.of()); - assertFilterMatchesSkipVectorize(newJavaScriptDimFilter("d0", jsNullFilter, null), ImmutableList.of()); - assertFilterMatchesSkipVectorize(newJavaScriptDimFilter("l0", jsNullFilter, null), ImmutableList.of()); - } else { - assertFilterMatchesSkipVectorize(newJavaScriptDimFilter("f0", jsNullFilter, null), ImmutableList.of("4")); - assertFilterMatchesSkipVectorize(newJavaScriptDimFilter("d0", jsNullFilter, null), ImmutableList.of("2")); - assertFilterMatchesSkipVectorize(newJavaScriptDimFilter("l0", jsNullFilter, null), ImmutableList.of("3")); - } + assertFilterMatchesSkipVectorize(newJavaScriptDimFilter("f0", jsNullFilter, null), ImmutableList.of("4")); + assertFilterMatchesSkipVectorize(newJavaScriptDimFilter("d0", jsNullFilter, null), ImmutableList.of("2")); + assertFilterMatchesSkipVectorize(newJavaScriptDimFilter("l0", jsNullFilter, null), ImmutableList.of("3")); assertFilterMatchesSkipVectorize(newJavaScriptDimFilter("f0", jsNumericValueFilter("5.5"), null), ImmutableList.of("2")); assertFilterMatchesSkipVectorize(newJavaScriptDimFilter("d0", jsNumericValueFilter("120.0245"), null), ImmutableList.of("3")); assertFilterMatchesSkipVectorize(newJavaScriptDimFilter("l0", jsNumericValueFilter("9001"), null), ImmutableList.of("4")); diff --git a/processing/src/test/java/org/apache/druid/segment/filter/LikeFilterTest.java b/processing/src/test/java/org/apache/druid/segment/filter/LikeFilterTest.java index d3cc658d6ae1..e3a4a102e6bc 100644 --- a/processing/src/test/java/org/apache/druid/segment/filter/LikeFilterTest.java +++ b/processing/src/test/java/org/apache/druid/segment/filter/LikeFilterTest.java @@ -23,7 +23,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import nl.jqno.equalsverifier.EqualsVerifier; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.data.input.impl.DimensionsSpec; import org.apache.druid.data.input.impl.InputRowParser; @@ -117,9 +116,7 @@ public void testExactMatch() ); assertFilterMatches( NotDimFilter.of(new LikeDimFilter("dim2", "bbb", null, null)), - NullHandling.replaceWithDefault() - ? ImmutableList.of("0", "1", "2", "3", "4", "6") - : ImmutableList.of("0", "1", "2", "4", "6") + ImmutableList.of("0", "1", "2", "4", "6") ); } @@ -141,9 +138,7 @@ public void testExactMatchWithExtractionFn() ); assertFilterMatches( NotDimFilter.of(new LikeDimFilter("dim1", "bar", null, new SubstringDimExtractionFn(3, 3))), - NullHandling.replaceWithDefault() - ? ImmutableList.of("0", "1", "3", "5", "6") - : ImmutableList.of("5", "6") + ImmutableList.of("5", "6") ); assertFilterMatches( @@ -152,9 +147,7 @@ public void testExactMatchWithExtractionFn() ); assertFilterMatches( NotDimFilter.of(new LikeDimFilter("dim2", "bbb", null, new SubstringDimExtractionFn(0, 3))), - NullHandling.replaceWithDefault() - ? ImmutableList.of("0", "1", "2", "3", "4", "6") - : ImmutableList.of("1", "2", "4", "6") + ImmutableList.of("1", "2", "4", "6") ); } @@ -176,7 +169,7 @@ public void testPrefixMatch() ); assertFilterMatches( NotDimFilter.of(new LikeDimFilter("dim2", "aa%", null, null)), - NullHandling.replaceWithDefault() ? ImmutableList.of("0", "3", "4", "5", "6") : ImmutableList.of("0", "4", "5", "6") + ImmutableList.of("0", "4", "5", "6") ); } @@ -198,9 +191,7 @@ public void testPrefixMatchWithExtractionFn() ); assertFilterMatches( NotDimFilter.of(new LikeDimFilter("dim1", "a%", null, new SubstringDimExtractionFn(1, null))), - NullHandling.replaceWithDefault() - ? ImmutableList.of("0", "1", "2", "4", "5", "6") - : ImmutableList.of("1", "2", "4", "5", "6") + ImmutableList.of("1", "2", "4", "5", "6") ); assertFilterMatches( @@ -209,9 +200,7 @@ public void testPrefixMatchWithExtractionFn() ); assertFilterMatches( NotDimFilter.of(new LikeDimFilter("dim2", "a%", null, new SubstringDimExtractionFn(1, null))), - NullHandling.replaceWithDefault() - ? ImmutableList.of("0", "3", "4", "5", "6") - : ImmutableList.of("4", "5", "6") + ImmutableList.of("4", "5", "6") ); } @@ -233,7 +222,7 @@ public void testWildcardMatch() ); assertFilterMatches( NotDimFilter.of(new LikeDimFilter("dim2", "%b%", null, null)), - NullHandling.sqlCompatible() ? ImmutableList.of("0", "1") : ImmutableList.of("0", "1", "3") + ImmutableList.of("0", "1") ); } @@ -249,17 +238,10 @@ public void testMatchEmptyString() @Test public void testMatchEmptyStringWithExtractionFn() { - if (NullHandling.replaceWithDefault()) { - assertFilterMatches( - new LikeDimFilter("dim1", "", null, new SubstringDimExtractionFn(100, 1)), - ImmutableList.of("0", "1", "2", "3", "4", "5", "6") - ); - } else { - assertFilterMatches( - new LikeDimFilter("dim1", "", null, new SubstringDimExtractionFn(100, 1)), - ImmutableList.of() - ); - } + assertFilterMatches( + new LikeDimFilter("dim1", "", null, new SubstringDimExtractionFn(100, 1)), + ImmutableList.of() + ); } @Test @@ -307,9 +289,7 @@ public void testWildcardMatchEverything() // doesnt match null tho in sql compatible mode assertFilterMatches( new LikeDimFilter("dim2", "%", "@", null), - NullHandling.sqlCompatible() - ? ImmutableList.of("0", "1", "2", "4", "5", "6") - : ImmutableList.of("0", "1", "2", "3", "4", "5", "6") + ImmutableList.of("0", "1", "2", "4", "5", "6") ); assertFilterMatches( NotDimFilter.of(new LikeDimFilter("dim2", "%", "@", null)), diff --git a/processing/src/test/java/org/apache/druid/segment/filter/NullFilterTests.java b/processing/src/test/java/org/apache/druid/segment/filter/NullFilterTests.java index 26d0ca547f48..2dccd7b49544 100644 --- a/processing/src/test/java/org/apache/druid/segment/filter/NullFilterTests.java +++ b/processing/src/test/java/org/apache/druid/segment/filter/NullFilterTests.java @@ -26,7 +26,6 @@ import com.google.common.collect.Range; import com.google.common.collect.TreeRangeSet; import nl.jqno.equalsverifier.EqualsVerifier; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.java.util.common.Pair; import org.apache.druid.query.filter.FilterTuning; @@ -104,91 +103,54 @@ public void testListFilteredVirtualColumn() NotDimFilter.of(NullFilter.forColumn("allow-dim2")), ImmutableList.of("0", "3") ); - if (NullHandling.replaceWithDefault()) { - assertFilterMatchesSkipVectorize( - NullFilter.forColumn("deny-dim2"), - ImmutableList.of("1", "2", "3", "5") - ); - assertFilterMatchesSkipVectorize( - NotDimFilter.of(NullFilter.forColumn("deny-dim2")), - ImmutableList.of("0", "4") - ); - } else { - assertFilterMatchesSkipVectorize( - NullFilter.forColumn("deny-dim2"), - ImmutableList.of("1", "3", "5") - ); - assertFilterMatchesSkipVectorize( - NotDimFilter.of(NullFilter.forColumn("deny-dim2")), - ImmutableList.of("0", "2", "4") - ); - } + assertFilterMatchesSkipVectorize( + NullFilter.forColumn("deny-dim2"), + ImmutableList.of("1", "3", "5") + ); + assertFilterMatchesSkipVectorize( + NotDimFilter.of(NullFilter.forColumn("deny-dim2")), + ImmutableList.of("0", "2", "4") + ); } @Test public void testSingleValueStringColumnWithNulls() { // testSingleValueStringColumnWithoutNulls but with virtual column selector - if (NullHandling.replaceWithDefault()) { - assertFilterMatches(NullFilter.forColumn("dim1"), ImmutableList.of("0")); - assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("dim1")), ImmutableList.of("1", "2", "3", "4", "5")); - - assertFilterMatches(NullFilter.forColumn("s0"), ImmutableList.of("0", "3")); - assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("s0")), ImmutableList.of("1", "2", "4", "5")); - } else { - assertFilterMatches(NullFilter.forColumn("dim1"), ImmutableList.of()); - assertFilterMatches( - NotDimFilter.of(NullFilter.forColumn("dim1")), - ImmutableList.of("0", "1", "2", "3", "4", "5") - ); + assertFilterMatches(NullFilter.forColumn("dim1"), ImmutableList.of()); + assertFilterMatches( + NotDimFilter.of(NullFilter.forColumn("dim1")), + ImmutableList.of("0", "1", "2", "3", "4", "5") + ); - assertFilterMatches(NullFilter.forColumn("s0"), ImmutableList.of("3")); - assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("s0")), ImmutableList.of("0", "1", "2", "4", "5")); - } + assertFilterMatches(NullFilter.forColumn("s0"), ImmutableList.of("3")); + assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("s0")), ImmutableList.of("0", "1", "2", "4", "5")); } @Test public void testSingleValueVirtualStringColumnWithNulls() { // testSingleValueStringColumnWithNulls but with virtual column selector - if (NullHandling.replaceWithDefault()) { - assertFilterMatches(NullFilter.forColumn("vdim1"), ImmutableList.of("0")); - assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("vdim1")), ImmutableList.of("1", "2", "3", "4", "5")); - - assertFilterMatches(NullFilter.forColumn("vs0"), ImmutableList.of("0", "3")); - assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("vs0")), ImmutableList.of("1", "2", "4", "5")); - } else { - assertFilterMatches(NullFilter.forColumn("vdim1"), ImmutableList.of()); - assertFilterMatches( - NotDimFilter.of(NullFilter.forColumn("vdim1")), - ImmutableList.of("0", "1", "2", "3", "4", "5") - ); + assertFilterMatches(NullFilter.forColumn("vdim1"), ImmutableList.of()); + assertFilterMatches( + NotDimFilter.of(NullFilter.forColumn("vdim1")), + ImmutableList.of("0", "1", "2", "3", "4", "5") + ); - assertFilterMatches(NullFilter.forColumn("vs0"), ImmutableList.of("3")); - assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("vs0")), ImmutableList.of("0", "1", "2", "4", "5")); - } + assertFilterMatches(NullFilter.forColumn("vs0"), ImmutableList.of("3")); + assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("vs0")), ImmutableList.of("0", "1", "2", "4", "5")); } @Test public void testMultiValueStringColumn() { - if (NullHandling.replaceWithDefault()) { - if (isAutoSchema()) { - assertFilterMatches(NullFilter.forColumn("dim2"), ImmutableList.of("5")); - assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("dim2")), ImmutableList.of("0", "1", "2", "3", "4")); - } else { - assertFilterMatches(NullFilter.forColumn("dim2"), ImmutableList.of("1", "2", "5")); - assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("dim2")), ImmutableList.of("0", "3", "4")); - } + // only one array row is totally null + if (isAutoSchema()) { + assertFilterMatches(NullFilter.forColumn("dim2"), ImmutableList.of("5")); + assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("dim2")), ImmutableList.of("0", "1", "2", "3", "4")); } else { - // only one array row is totally null - if (isAutoSchema()) { - assertFilterMatches(NullFilter.forColumn("dim2"), ImmutableList.of("5")); - assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("dim2")), ImmutableList.of("0", "1", "2", "3", "4")); - } else { - assertFilterMatches(NullFilter.forColumn("dim2"), ImmutableList.of("1", "5")); - assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("dim2")), ImmutableList.of("0", "2", "3", "4")); - } + assertFilterMatches(NullFilter.forColumn("dim2"), ImmutableList.of("1", "5")); + assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("dim2")), ImmutableList.of("0", "2", "3", "4")); } } @@ -210,138 +172,51 @@ public void testMissingColumnNotSpecifiedInDimensionList() @Test public void testVirtualNumericColumnNullsAndDefaults() { - if (canTestNumericNullsAsDefaultValues) { - assertFilterMatches(NullFilter.forColumn("vf0"), ImmutableList.of()); - assertFilterMatches( - NotDimFilter.of(NullFilter.forColumn("vf0")), - ImmutableList.of("0", "1", "2", "3", "4", "5") - ); - - assertFilterMatches(NullFilter.forColumn("vd0"), ImmutableList.of()); - assertFilterMatches( - NotDimFilter.of(NullFilter.forColumn("vd0")), - ImmutableList.of("0", "1", "2", "3", "4", "5") - ); - - assertFilterMatches(NullFilter.forColumn("vl0"), ImmutableList.of()); - assertFilterMatches( - NotDimFilter.of(NullFilter.forColumn("vl0")), - ImmutableList.of("0", "1", "2", "3", "4", "5") - ); - - assertFilterMatches(NullFilter.forColumn("vd0-nvl-2"), ImmutableList.of()); - assertFilterMatches( - NotDimFilter.of(NullFilter.forColumn("vd0-nvl-2")), - ImmutableList.of("0", "1", "2", "3", "4", "5") - ); - - assertFilterMatches(NullFilter.forColumn("vf0-add-sub"), ImmutableList.of()); - assertFilterMatches( - NotDimFilter.of(NullFilter.forColumn("vf0-add-sub")), - ImmutableList.of("0", "1", "2", "3", "4", "5") - ); - - assertFilterMatches(NullFilter.forColumn("vd0-add-sub"), ImmutableList.of()); - assertFilterMatches( - NotDimFilter.of(NullFilter.forColumn("vd0-add-sub")), - ImmutableList.of("0", "1", "2", "3", "4", "5") - ); - - assertFilterMatches(NullFilter.forColumn("vl0-add-sub"), ImmutableList.of()); - assertFilterMatches( - NotDimFilter.of(NullFilter.forColumn("vl0-add-sub")), - ImmutableList.of("0", "1", "2", "3", "4", "5") - ); + assertFilterMatches(NullFilter.forColumn("vf0"), ImmutableList.of("4")); + assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("vf0")), ImmutableList.of("0", "1", "2", "3", "5")); - assertFilterMatches(NullFilter.forColumn("double-vf0-add-sub"), ImmutableList.of()); - assertFilterMatches( - NotDimFilter.of(NullFilter.forColumn("double-vf0-add-sub")), - ImmutableList.of("0", "1", "2", "3", "4", "5") - ); - - assertFilterMatches(NullFilter.forColumn("double-vd0-add-sub"), ImmutableList.of()); - assertFilterMatches( - NotDimFilter.of(NullFilter.forColumn("double-vd0-add-sub")), - ImmutableList.of("0", "1", "2", "3", "4", "5") - ); - - assertFilterMatches(NullFilter.forColumn("double-vl0-add-sub"), ImmutableList.of()); - assertFilterMatches( - NotDimFilter.of(NullFilter.forColumn("double-vl0-add-sub")), - ImmutableList.of("0", "1", "2", "3", "4", "5") - ); - } else { - assertFilterMatches(NullFilter.forColumn("vf0"), ImmutableList.of("4")); - assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("vf0")), ImmutableList.of("0", "1", "2", "3", "5")); + assertFilterMatches(NullFilter.forColumn("vd0"), ImmutableList.of("2")); + assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("vd0")), ImmutableList.of("0", "1", "3", "4", "5")); - assertFilterMatches(NullFilter.forColumn("vd0"), ImmutableList.of("2")); - assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("vd0")), ImmutableList.of("0", "1", "3", "4", "5")); + assertFilterMatches(NullFilter.forColumn("vl0"), ImmutableList.of("3")); + assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("vl0")), ImmutableList.of("0", "1", "2", "4", "5")); - assertFilterMatches(NullFilter.forColumn("vl0"), ImmutableList.of("3")); - assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("vl0")), ImmutableList.of("0", "1", "2", "4", "5")); - - assertFilterMatches(NullFilter.forColumn("vd0-nvl-2"), ImmutableList.of()); - assertFilterMatches( - NotDimFilter.of(NullFilter.forColumn("vd0-nvl-2")), - ImmutableList.of("0", "1", "2", "3", "4", "5") - ); + assertFilterMatches(NullFilter.forColumn("vd0-nvl-2"), ImmutableList.of()); + assertFilterMatches( + NotDimFilter.of(NullFilter.forColumn("vd0-nvl-2")), + ImmutableList.of("0", "1", "2", "3", "4", "5") + ); - if (NullHandling.sqlCompatible()) { - // these fail in default value mode that cannot be tested as numeric default values becuase of type - // mismatch for subtract operation - assertFilterMatches(NullFilter.forColumn("vf0-add-sub"), ImmutableList.of("4")); - assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("vf0-add-sub")), ImmutableList.of("0", "1", "2", "3", "5")); + assertFilterMatches(NullFilter.forColumn("vf0-add-sub"), ImmutableList.of("4")); + assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("vf0-add-sub")), ImmutableList.of("0", "1", "2", "3", "5")); - assertFilterMatches(NullFilter.forColumn("vd0-add-sub"), ImmutableList.of("2")); - assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("vd0-add-sub")), ImmutableList.of("0", "1", "3", "4", "5")); + assertFilterMatches(NullFilter.forColumn("vd0-add-sub"), ImmutableList.of("2")); + assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("vd0-add-sub")), ImmutableList.of("0", "1", "3", "4", "5")); - assertFilterMatches(NullFilter.forColumn("vl0-add-sub"), ImmutableList.of("3")); - assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("vl0-add-sub")), ImmutableList.of("0", "1", "2", "4", "5")); + assertFilterMatches(NullFilter.forColumn("vl0-add-sub"), ImmutableList.of("3")); + assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("vl0-add-sub")), ImmutableList.of("0", "1", "2", "4", "5")); - assertFilterMatches(NullFilter.forColumn("double-vf0-add-sub"), ImmutableList.of("4")); - assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("double-vf0-add-sub")), ImmutableList.of("0", "1", "2", "3", "5")); + assertFilterMatches(NullFilter.forColumn("double-vf0-add-sub"), ImmutableList.of("4")); + assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("double-vf0-add-sub")), ImmutableList.of("0", "1", "2", "3", "5")); - assertFilterMatches(NullFilter.forColumn("double-vd0-add-sub"), ImmutableList.of("2")); - assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("double-vd0-add-sub")), ImmutableList.of("0", "1", "3", "4", "5")); + assertFilterMatches(NullFilter.forColumn("double-vd0-add-sub"), ImmutableList.of("2")); + assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("double-vd0-add-sub")), ImmutableList.of("0", "1", "3", "4", "5")); - assertFilterMatches(NullFilter.forColumn("vl0-add-sub"), ImmutableList.of("3")); - assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("double-vl0-add-sub")), ImmutableList.of("0", "1", "2", "4", "5")); - } - } + assertFilterMatches(NullFilter.forColumn("vl0-add-sub"), ImmutableList.of("3")); + assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("double-vl0-add-sub")), ImmutableList.of("0", "1", "2", "4", "5")); } @Test public void testNumericColumnNullsAndDefaults() { - if (canTestNumericNullsAsDefaultValues) { - assertFilterMatches(NullFilter.forColumn("f0"), ImmutableList.of()); - assertFilterMatches( - NotDimFilter.of(NullFilter.forColumn("f0")), - ImmutableList.of("0", "1", "2", "3", "4", "5") - ); + assertFilterMatches(NullFilter.forColumn("f0"), ImmutableList.of("4")); + assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("f0")), ImmutableList.of("0", "1", "2", "3", "5")); - assertFilterMatches(NullFilter.forColumn("d0"), ImmutableList.of()); - assertFilterMatches( - NotDimFilter.of(NullFilter.forColumn("d0")), - ImmutableList.of("0", "1", "2", "3", "4", "5") - ); - - assertFilterMatches(NullFilter.forColumn("l0"), ImmutableList.of()); - assertFilterMatches( - NotDimFilter.of(NullFilter.forColumn("l0")), - ImmutableList.of("0", "1", "2", "3", "4", "5") - ); + assertFilterMatches(NullFilter.forColumn("d0"), ImmutableList.of("2")); + assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("d0")), ImmutableList.of("0", "1", "3", "4", "5")); - } else { - assertFilterMatches(NullFilter.forColumn("f0"), ImmutableList.of("4")); - assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("f0")), ImmutableList.of("0", "1", "2", "3", "5")); - - assertFilterMatches(NullFilter.forColumn("d0"), ImmutableList.of("2")); - assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("d0")), ImmutableList.of("0", "1", "3", "4", "5")); - - assertFilterMatches(NullFilter.forColumn("l0"), ImmutableList.of("3")); - assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("l0")), ImmutableList.of("0", "1", "2", "4", "5")); - } + assertFilterMatches(NullFilter.forColumn("l0"), ImmutableList.of("3")); + assertFilterMatches(NotDimFilter.of(NullFilter.forColumn("l0")), ImmutableList.of("0", "1", "2", "4", "5")); } @Test diff --git a/processing/src/test/java/org/apache/druid/segment/filter/PredicateValueMatcherFactoryTest.java b/processing/src/test/java/org/apache/druid/segment/filter/PredicateValueMatcherFactoryTest.java index 0a79b97f523e..c9fe1681262a 100644 --- a/processing/src/test/java/org/apache/druid/segment/filter/PredicateValueMatcherFactoryTest.java +++ b/processing/src/test/java/org/apache/druid/segment/filter/PredicateValueMatcherFactoryTest.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableList; import org.apache.druid.collections.bitmap.RoaringBitmapFactory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.query.filter.SelectorPredicateFactory; import org.apache.druid.query.filter.ValueMatcher; @@ -274,11 +273,7 @@ public void testComplexProcessorEmptyString() ); columnValueSelector.advance(); final ValueMatcher matcher = forSelector(null).makeComplexProcessor(columnValueSelector); - if (NullHandling.sqlCompatible()) { - Assert.assertFalse(matcher.matches(false)); - } else { - Assert.assertTrue(matcher.matches(false)); - } + Assert.assertFalse(matcher.matches(false)); } @Test diff --git a/processing/src/test/java/org/apache/druid/segment/filter/RangeFilterTests.java b/processing/src/test/java/org/apache/druid/segment/filter/RangeFilterTests.java index d55d71b792d8..a02d3ce6e002 100644 --- a/processing/src/test/java/org/apache/druid/segment/filter/RangeFilterTests.java +++ b/processing/src/test/java/org/apache/druid/segment/filter/RangeFilterTests.java @@ -29,7 +29,6 @@ import com.google.common.collect.RangeSet; import com.google.common.collect.TreeRangeSet; import nl.jqno.equalsverifier.EqualsVerifier; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.error.DruidException; import org.apache.druid.jackson.DefaultObjectMapper; @@ -144,86 +143,45 @@ public void testLexicographicalMatch() ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7") ); - if (NullHandling.sqlCompatible()) { - assertFilterMatches( - new RangeFilter("dim1", ColumnType.STRING, null, "z", false, false, null), - ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7") - ); - assertFilterMatches( - new RangeFilter("vdim0", ColumnType.STRING, null, "z", false, false, null), - ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7") - ); - assertFilterMatches( - NotDimFilter.of(new RangeFilter("dim1", ColumnType.STRING, null, "z", false, false, null)), - ImmutableList.of() - ); - assertFilterMatches( - NotDimFilter.of(new RangeFilter("vdim0", ColumnType.STRING, null, "z", false, false, null)), - ImmutableList.of() - ); - assertFilterMatches( - new RangeFilter("s0", ColumnType.STRING, null, "b", false, false, null), - ImmutableList.of("0", "1", "2", "5") - ); - assertFilterMatches( - new RangeFilter("vs0", ColumnType.STRING, null, "b", false, false, null), - ImmutableList.of("0", "1", "2", "5") - ); - assertFilterMatches( - NotDimFilter.of(new RangeFilter("s0", ColumnType.STRING, null, "b", false, false, null)), - ImmutableList.of("4", "6", "7") - ); - assertFilterMatches( - NotDimFilter.of(new RangeFilter("vs0", ColumnType.STRING, null, "b", false, false, null)), - ImmutableList.of("4", "6", "7") - ); - } else { - assertFilterMatches( - new RangeFilter("dim1", ColumnType.STRING, null, "z", false, false, null), - ImmutableList.of("1", "2", "3", "4", "5", "6", "7") - ); - assertFilterMatches( - new RangeFilter("vdim0", ColumnType.STRING, null, "z", false, false, null), - ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7") - ); - assertFilterMatches( - NotDimFilter.of(new RangeFilter("dim1", ColumnType.STRING, null, "z", false, false, null)), - NullHandling.sqlCompatible() ? ImmutableList.of() : ImmutableList.of("0") - ); - assertFilterMatches( - NotDimFilter.of(new RangeFilter("vdim0", ColumnType.STRING, null, "z", false, false, null)), - NullHandling.sqlCompatible() ? ImmutableList.of("0") : ImmutableList.of() - ); - assertFilterMatches( - new RangeFilter("s0", ColumnType.STRING, null, "b", false, false, null), - ImmutableList.of("1", "2", "5") - ); - assertFilterMatches( - new RangeFilter("vs0", ColumnType.STRING, null, "b", false, false, null), - ImmutableList.of("1", "2", "5") - ); - assertFilterMatches( - NotDimFilter.of(new RangeFilter("s0", ColumnType.STRING, null, "b", false, false, null)), - NullHandling.sqlCompatible() - ? ImmutableList.of("4", "6", "7") - : ImmutableList.of("0", "3", "4", "6", "7") - ); - assertFilterMatches( - NotDimFilter.of(new RangeFilter("vs0", ColumnType.STRING, null, "b", false, false, null)), - NullHandling.sqlCompatible() - ? ImmutableList.of("4", "6", "7") - : ImmutableList.of("0", "3", "4", "6", "7") - ); - } + assertFilterMatches( + new RangeFilter("dim1", ColumnType.STRING, null, "z", false, false, null), + ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7") + ); + assertFilterMatches( + new RangeFilter("vdim0", ColumnType.STRING, null, "z", false, false, null), + ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7") + ); + assertFilterMatches( + NotDimFilter.of(new RangeFilter("dim1", ColumnType.STRING, null, "z", false, false, null)), + ImmutableList.of() + ); + assertFilterMatches( + NotDimFilter.of(new RangeFilter("vdim0", ColumnType.STRING, null, "z", false, false, null)), + ImmutableList.of() + ); + assertFilterMatches( + new RangeFilter("s0", ColumnType.STRING, null, "b", false, false, null), + ImmutableList.of("0", "1", "2", "5") + ); + assertFilterMatches( + new RangeFilter("vs0", ColumnType.STRING, null, "b", false, false, null), + ImmutableList.of("0", "1", "2", "5") + ); + assertFilterMatches( + NotDimFilter.of(new RangeFilter("s0", ColumnType.STRING, null, "b", false, false, null)), + ImmutableList.of("4", "6", "7") + ); + assertFilterMatches( + NotDimFilter.of(new RangeFilter("vs0", ColumnType.STRING, null, "b", false, false, null)), + ImmutableList.of("4", "6", "7") + ); if (isAutoSchema()) { // auto schema ingests arrays instead of mvds.. this is covered in array tests } else { assertFilterMatches( new RangeFilter("dim2", ColumnType.STRING, null, "z", false, false, null), - NullHandling.sqlCompatible() - ? ImmutableList.of("0", "2", "3", "4", "6", "7") - : ImmutableList.of("0", "3", "4", "6", "7") + ImmutableList.of("0", "2", "3", "4", "6", "7") ); // vdim2 does not exist... assertFilterMatches( @@ -236,81 +194,43 @@ public void testLexicographicalMatch() @Test public void testLexicographicMatchWithEmptyString() { - if (NullHandling.sqlCompatible()) { - assertFilterMatches( - new RangeFilter("dim0", ColumnType.STRING, "", "z", false, false, null), - ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7") - ); - assertFilterMatches( - new RangeFilter("dim1", ColumnType.STRING, "", "z", false, false, null), - ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7") - ); - if (!isAutoSchema()) { - // auto schema ingests arrays which are currently incompatible with the range filter - assertFilterMatches( - new RangeFilter("dim2", ColumnType.STRING, "", "z", false, false, null), - ImmutableList.of("0", "2", "3", "4", "6", "7") - ); - } - assertFilterMatches( - new RangeFilter("dim3", ColumnType.STRING, "", "z", false, false, null), - ImmutableList.of() - ); - } else { - assertFilterMatches( - new RangeFilter("dim0", ColumnType.STRING, "", "z", false, false, null), - ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7") - ); - assertFilterMatches( - new RangeFilter("dim1", ColumnType.STRING, "", "z", false, false, null), - ImmutableList.of("1", "2", "3", "4", "5", "6", "7") - ); - if (!isAutoSchema()) { - // auto schema ingests arrays which are currently incompatible with the range filter - assertFilterMatches( - new RangeFilter("dim2", ColumnType.STRING, "", "z", false, false, null), - ImmutableList.of("0", "3", "4", "6", "7") - ); - } + assertFilterMatches( + new RangeFilter("dim0", ColumnType.STRING, "", "z", false, false, null), + ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7") + ); + assertFilterMatches( + new RangeFilter("dim1", ColumnType.STRING, "", "z", false, false, null), + ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7") + ); + if (!isAutoSchema()) { + // auto schema ingests arrays which are currently incompatible with the range filter assertFilterMatches( - new RangeFilter("dim3", ColumnType.STRING, "", "z", false, false, null), - ImmutableList.of() + new RangeFilter("dim2", ColumnType.STRING, "", "z", false, false, null), + ImmutableList.of("0", "2", "3", "4", "6", "7") ); } + assertFilterMatches( + new RangeFilter("dim3", ColumnType.STRING, "", "z", false, false, null), + ImmutableList.of() + ); } @Test public void testLexicographicMatchNull() { - - if (NullHandling.replaceWithDefault()) { - // in default value mode this is null on both ends... - Throwable t = Assert.assertThrows( - DruidException.class, - () -> assertFilterMatches( - new RangeFilter("dim0", ColumnType.STRING, "", "", false, false, null), - ImmutableList.of() - ) - ); - Assert.assertEquals( - "Invalid range filter on column [dim0], lower and upper cannot be null at the same time", - t.getMessage() - ); - } else { - assertFilterMatches( - new RangeFilter("dim0", ColumnType.STRING, "", "", false, false, null), - ImmutableList.of() - ); - assertFilterMatches( - new RangeFilter("dim1", ColumnType.STRING, "", "", false, false, null), - ImmutableList.of("0") - ); - // still matches even with auto-schema because match-values are upcast to array types - assertFilterMatches( - new RangeFilter("dim2", ColumnType.STRING, "", "", false, false, null), - ImmutableList.of("2") - ); - } + assertFilterMatches( + new RangeFilter("dim0", ColumnType.STRING, "", "", false, false, null), + ImmutableList.of() + ); + assertFilterMatches( + new RangeFilter("dim1", ColumnType.STRING, "", "", false, false, null), + ImmutableList.of("0") + ); + // still matches even with auto-schema because match-values are upcast to array types + assertFilterMatches( + new RangeFilter("dim2", ColumnType.STRING, "", "", false, false, null), + ImmutableList.of("2") + ); } @Test @@ -346,7 +266,7 @@ public void testLexicographicMatchMissingColumn() ); assertFilterMatches( NotDimFilter.of(new RangeFilter("dim3", ColumnType.STRING, null, "z", false, true, null)), - NullHandling.sqlCompatible() ? ImmutableList.of() : ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7") + ImmutableList.of() ); } @@ -408,9 +328,7 @@ public void testLexicographicMatchNoLowerLimit() { assertFilterMatches( new RangeFilter("dim1", ColumnType.STRING, null, "abd", true, true, null), - NullHandling.replaceWithDefault() - ? ImmutableList.of("1", "2", "3", "5", "6", "7") - : ImmutableList.of("0", "1", "2", "3", "5", "6", "7") + ImmutableList.of("0", "1", "2", "3", "5", "6", "7") ); } @@ -456,9 +374,7 @@ public void testNumericMatchTooStrict() ); assertFilterMatches( NotDimFilter.of(new RangeFilter("d0", ColumnType.DOUBLE, 2L, 3L, false, true, null)), - NullHandling.replaceWithDefault() - ? ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7") - : ImmutableList.of("0", "1", "3", "4", "5", "6") + ImmutableList.of("0", "1", "3", "4", "5", "6") ); assertFilterMatches( new RangeFilter("f0", ColumnType.LONG, 2L, 3L, false, true, null), @@ -470,9 +386,7 @@ public void testNumericMatchTooStrict() ); assertFilterMatches( NotDimFilter.of(new RangeFilter("f0", ColumnType.DOUBLE, 2L, 3L, false, true, null)), - NullHandling.replaceWithDefault() - ? ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7") - : ImmutableList.of("0", "1", "2", "3", "5", "7") + ImmutableList.of("0", "1", "2", "3", "5", "7") ); assertFilterMatches( new RangeFilter("l0", ColumnType.LONG, 2L, 3L, false, true, null), @@ -484,9 +398,7 @@ public void testNumericMatchTooStrict() ); assertFilterMatches( NotDimFilter.of(new RangeFilter("l0", ColumnType.DOUBLE, 2L, 3L, false, true, null)), - NullHandling.replaceWithDefault() - ? ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7") - : ImmutableList.of("0", "1", "2", "4", "5", "6") + ImmutableList.of("0", "1", "2", "4", "5", "6") ); } @@ -538,9 +450,7 @@ public void testNumericMatchExactlySingleValue() ); assertFilterMatches( NotDimFilter.of(new RangeFilter("d0", ColumnType.DOUBLE, 120.0245, 120.0245, false, false, null)), - NullHandling.sqlCompatible() - ? ImmutableList.of("0", "1", "4", "5", "6") - : ImmutableList.of("0", "1", "2", "4", "5", "6", "7") + ImmutableList.of("0", "1", "4", "5", "6") ); assertFilterMatches( new RangeFilter("d0", ColumnType.FLOAT, 120.0245f, 120.0245f, false, false, null), @@ -560,9 +470,7 @@ public void testNumericMatchExactlySingleValue() ); assertFilterMatches( NotDimFilter.of(new RangeFilter("f0", ColumnType.FLOAT, 10.1f, 10.1f, false, false, null)), - NullHandling.sqlCompatible() - ? ImmutableList.of("0", "2", "3", "5", "7") - : ImmutableList.of("0", "2", "3", "4", "5", "6", "7") + ImmutableList.of("0", "2", "3", "5", "7") ); assertFilterMatches( new RangeFilter("l0", ColumnType.LONG, 12345L, 12345L, false, false, null), @@ -570,9 +478,7 @@ public void testNumericMatchExactlySingleValue() ); assertFilterMatches( NotDimFilter.of(new RangeFilter("l0", ColumnType.LONG, 12345L, 12345L, false, false, null)), - NullHandling.sqlCompatible() - ? ImmutableList.of("0", "1", "2", "4", "6") - : ImmutableList.of("0", "1", "2", "3", "4", "6", "7") + ImmutableList.of("0", "1", "2", "4", "6") ); assertFilterMatches( new RangeFilter("l0", ColumnType.DOUBLE, 12345.0, 12345.0, false, false, null), @@ -657,26 +563,20 @@ public void testNumericMatchNoLowerLimit() // strings are wierd... assertFilterMatches( new RangeFilter("dim1", ColumnType.LONG, null, 2L, false, true, null), - NullHandling.replaceWithDefault() - ? ImmutableList.of("3", "4", "5", "6", "7") - : ImmutableList.of("0", "3", "4", "5", "6", "7") + ImmutableList.of("0", "3", "4", "5", "6", "7") ); // numbers are sane though assertFilterMatches( new RangeFilter("d0", ColumnType.DOUBLE, null, 10.0, false, true, null), - canTestNumericNullsAsDefaultValues ? ImmutableList.of("0", "2", "6", "7") : ImmutableList.of("0", "6") + ImmutableList.of("0", "6") ); assertFilterMatches( new RangeFilter("f0", ColumnType.FLOAT, null, 50.5, false, true, null), - canTestNumericNullsAsDefaultValues - ? ImmutableList.of("0", "1", "2", "4", "6", "7") - : ImmutableList.of("0", "1", "2", "7") + ImmutableList.of("0", "1", "2", "7") ); assertFilterMatches( new RangeFilter("l0", ColumnType.LONG, null, 100L, false, true, null), - canTestNumericNullsAsDefaultValues - ? ImmutableList.of("0", "2", "3", "6", "7") - : ImmutableList.of("0", "2", "6") + ImmutableList.of("0", "2", "6") ); } @@ -702,9 +602,7 @@ public void testNumericMatchStringyBounds() ); assertFilterMatches( new RangeFilter("l0", ColumnType.STRING, null, "abc", true, true, null), - canTestNumericNullsAsDefaultValues - ? ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7") - : ImmutableList.of("0", "1", "2", "4", "5", "6") + ImmutableList.of("0", "1", "2", "4", "5", "6") ); } @@ -766,44 +664,23 @@ public void testNumericMatchPrecisionLoss() new RangeFilter("l0", ColumnType.DOUBLE, 12345.5, null, false, true, null), ImmutableList.of() ); + assertFilterMatches( + new RangeFilter("l0", ColumnType.DOUBLE, null, 12344.5, true, true, null), + ImmutableList.of("0", "1", "2", "4", "6") + ); + assertFilterMatches( + new RangeFilter("l0", ColumnType.DOUBLE, null, 12344.5, false, true, null), + ImmutableList.of("0", "1", "2", "4", "6") + ); - if (canTestNumericNullsAsDefaultValues) { - assertFilterMatches( - new RangeFilter("l0", ColumnType.DOUBLE, null, 12344.5, true, true, null), - ImmutableList.of("0", "1", "2", "3", "4", "6", "7") - ); - assertFilterMatches( - new RangeFilter("l0", ColumnType.DOUBLE, null, 12344.5, false, true, null), - ImmutableList.of("0", "1", "2", "3", "4", "6", "7") - ); - - assertFilterMatches( - new RangeFilter("l0", ColumnType.DOUBLE, null, 12345.5, true, true, null), - ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7") - ); - assertFilterMatches( - new RangeFilter("l0", ColumnType.DOUBLE, null, 12345.5, false, true, null), - ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7") - ); - } else { - assertFilterMatches( - new RangeFilter("l0", ColumnType.DOUBLE, null, 12344.5, true, true, null), - ImmutableList.of("0", "1", "2", "4", "6") - ); - assertFilterMatches( - new RangeFilter("l0", ColumnType.DOUBLE, null, 12344.5, false, true, null), - ImmutableList.of("0", "1", "2", "4", "6") - ); - - assertFilterMatches( - new RangeFilter("l0", ColumnType.DOUBLE, null, 12345.5, true, true, null), - ImmutableList.of("0", "1", "2", "4", "5", "6") - ); - assertFilterMatches( - new RangeFilter("l0", ColumnType.DOUBLE, null, 12345.5, false, true, null), - ImmutableList.of("0", "1", "2", "4", "5", "6") - ); - } + assertFilterMatches( + new RangeFilter("l0", ColumnType.DOUBLE, null, 12345.5, true, true, null), + ImmutableList.of("0", "1", "2", "4", "5", "6") + ); + assertFilterMatches( + new RangeFilter("l0", ColumnType.DOUBLE, null, 12345.5, false, true, null), + ImmutableList.of("0", "1", "2", "4", "5", "6") + ); } @Test @@ -819,7 +696,7 @@ public void testNumericNullsAndZeros() false, null ), - canTestNumericNullsAsDefaultValues ? ImmutableList.of("0", "2", "7") : ImmutableList.of("0") + ImmutableList.of("0") ); assertFilterMatches( @@ -832,7 +709,7 @@ public void testNumericNullsAndZeros() false, null ), - canTestNumericNullsAsDefaultValues ? ImmutableList.of("0", "4", "6") : ImmutableList.of("0") + ImmutableList.of("0") ); assertFilterMatches( @@ -845,9 +722,7 @@ public void testNumericNullsAndZeros() false, null ), - NullHandling.replaceWithDefault() && canTestNumericNullsAsDefaultValues - ? ImmutableList.of("0", "3", "7") - : ImmutableList.of("0") + ImmutableList.of("0") ); } @@ -864,7 +739,7 @@ public void testVirtualNumericNullsAndZeros() false, null ), - canTestNumericNullsAsDefaultValues ? ImmutableList.of("0", "2", "7") : ImmutableList.of("0") + ImmutableList.of("0") ); assertFilterMatches( @@ -877,7 +752,7 @@ public void testVirtualNumericNullsAndZeros() false, null ), - canTestNumericNullsAsDefaultValues ? ImmutableList.of("0", "4", "6") : ImmutableList.of("0") + ImmutableList.of("0") ); assertFilterMatches( @@ -890,9 +765,7 @@ public void testVirtualNumericNullsAndZeros() false, null ), - NullHandling.replaceWithDefault() && canTestNumericNullsAsDefaultValues - ? ImmutableList.of("0", "3", "7") - : ImmutableList.of("0") + ImmutableList.of("0") ); assertFilterMatches( @@ -905,59 +778,47 @@ public void testVirtualNumericNullsAndZeros() false, null ), - NullHandling.replaceWithDefault() - ? ImmutableList.of("1", "3", "4", "5", "6") - : ImmutableList.of("1", "2", "3", "4", "5", "6", "7") + ImmutableList.of("1", "2", "3", "4", "5", "6", "7") ); - if (NullHandling.sqlCompatible() || canTestNumericNullsAsDefaultValues) { - // these fail in default value mode that cannot be tested as numeric default values becuase of type - // mismatch for subtract operation - assertFilterMatches( - new RangeFilter( - "vd0-add-sub", - ColumnType.DOUBLE, - 0.0, - 1.0, - false, - false, - null - ), - NullHandling.replaceWithDefault() && canTestNumericNullsAsDefaultValues - ? ImmutableList.of("0", "2", "7") - : ImmutableList.of("0") - ); + assertFilterMatches( + new RangeFilter( + "vd0-add-sub", + ColumnType.DOUBLE, + 0.0, + 1.0, + false, + false, + null + ), + ImmutableList.of("0") + ); - assertFilterMatches( - new RangeFilter( - "vf0-add-sub", - ColumnType.FLOAT, - 0.0, - 1.0, - false, - false, - null - ), - NullHandling.replaceWithDefault() && canTestNumericNullsAsDefaultValues - ? ImmutableList.of("0", "4", "6") - : ImmutableList.of("0") - ); + assertFilterMatches( + new RangeFilter( + "vf0-add-sub", + ColumnType.FLOAT, + 0.0, + 1.0, + false, + false, + null + ), + ImmutableList.of("0") + ); - assertFilterMatches( - new RangeFilter( - "vl0-add-sub", - ColumnType.LONG, - 0L, - 1L, - false, - false, - null - ), - NullHandling.replaceWithDefault() && canTestNumericNullsAsDefaultValues - ? ImmutableList.of("0", "3", "7") - : ImmutableList.of("0") - ); - } + assertFilterMatches( + new RangeFilter( + "vl0-add-sub", + ColumnType.LONG, + 0L, + 1L, + false, + false, + null + ), + ImmutableList.of("0") + ); } @Test @@ -1057,7 +918,7 @@ public void testListFilteredVirtualColumn() assertFilterMatchesSkipVectorize( new RangeFilter("deny-dim2", ColumnType.STRING, null, "z", false, false, null), - NullHandling.replaceWithDefault() ? ImmutableList.of("0", "4", "7") : ImmutableList.of("0", "2", "4", "7") + ImmutableList.of("0", "2", "4", "7") ); } @@ -1103,9 +964,7 @@ public void testArrayRanges() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("1", "4", "5", "6", "7") - : ImmutableList.of("1", "2", "4", "5", "6", "7") + ImmutableList.of("1", "4", "5", "6", "7") ); assertFilterMatches( new RangeFilter( @@ -1222,9 +1081,7 @@ public void testArrayRanges() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("0", "2", "4", "5", "6", "7") - : ImmutableList.of("0", "2", "3", "4", "5", "6", "7") + ImmutableList.of("0", "2", "4", "5", "6", "7") ); assertFilterMatches( @@ -1331,9 +1188,7 @@ public void testArrayRanges() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("0", "1", "2", "4", "6", "7") - : ImmutableList.of("0", "1", "2", "4", "5", "6", "7") + ImmutableList.of("0", "1", "2", "4", "6", "7") ); assertFilterMatches( @@ -1632,9 +1487,7 @@ public void testVariant() null ) ), - NullHandling.sqlCompatible() - ? ImmutableList.of("0", "3", "4") - : ImmutableList.of("0", "3", "4", "6", "7") + ImmutableList.of("0", "3", "4") ); // lexicographical comparison assertFilterMatches( diff --git a/processing/src/test/java/org/apache/druid/segment/filter/RegexFilterTest.java b/processing/src/test/java/org/apache/druid/segment/filter/RegexFilterTest.java index 744232ad6fcd..bbe2808afbba 100644 --- a/processing/src/test/java/org/apache/druid/segment/filter/RegexFilterTest.java +++ b/processing/src/test/java/org/apache/druid/segment/filter/RegexFilterTest.java @@ -23,7 +23,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import nl.jqno.equalsverifier.EqualsVerifier; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.IAE; import org.apache.druid.java.util.common.Pair; import org.apache.druid.js.JavaScriptConfig; @@ -77,12 +76,7 @@ public void testSingleValueStringColumnWithoutNulls() @Test public void testSingleValueStringColumnWithNulls() { - // RegexFilter always returns false for null row values. - if (NullHandling.replaceWithDefault()) { - assertFilterMatches(new RegexDimFilter("dim1", ".*", null), ImmutableList.of("1", "2", "3", "4", "5")); - } else { - assertFilterMatches(new RegexDimFilter("dim1", ".*", null), ImmutableList.of("0", "1", "2", "3", "4", "5")); - } + assertFilterMatches(new RegexDimFilter("dim1", ".*", null), ImmutableList.of("0", "1", "2", "3", "4", "5")); assertFilterMatches(new RegexDimFilter("dim1", "10", null), ImmutableList.of("1")); assertFilterMatches(new RegexDimFilter("dim1", "2", null), ImmutableList.of("2")); assertFilterMatches(new RegexDimFilter("dim1", "1", null), ImmutableList.of("1", "3")); @@ -97,11 +91,7 @@ public void testMultiValueStringColumn() if (isAutoSchema()) { return; } - if (NullHandling.replaceWithDefault()) { - assertFilterMatches(new RegexDimFilter("dim2", ".*", null), ImmutableList.of("0", "3", "4")); - } else { - assertFilterMatches(new RegexDimFilter("dim2", ".*", null), ImmutableList.of("0", "2", "3", "4")); - } + assertFilterMatches(new RegexDimFilter("dim2", ".*", null), ImmutableList.of("0", "2", "3", "4")); assertFilterMatches(new RegexDimFilter("dim2", "a", null), ImmutableList.of("0", "3")); assertFilterMatches(new RegexDimFilter("dim2", "b", null), ImmutableList.of("0")); assertFilterMatches(new RegexDimFilter("dim2", "c", null), ImmutableList.of("4")); @@ -131,16 +121,9 @@ public void testRegexWithExtractionFn() { String nullJsFn = "function(str) { if (str === null) { return 'NOT_NULL_ANYMORE'; } else { return str;} }"; ExtractionFn changeNullFn = new JavaScriptExtractionFn(nullJsFn, false, JavaScriptConfig.getEnabledInstance()); - if (NullHandling.replaceWithDefault()) { - assertFilterMatches(new RegexDimFilter("dim1", ".*ANYMORE", changeNullFn), ImmutableList.of("0")); - assertFilterMatchesSkipArrays( - new RegexDimFilter("dim2", ".*ANYMORE", changeNullFn), - ImmutableList.of("1", "2", "5") - ); - } else { - assertFilterMatches(new RegexDimFilter("dim1", ".*ANYMORE", changeNullFn), ImmutableList.of()); - assertFilterMatchesSkipArrays(new RegexDimFilter("dim2", ".*ANYMORE", changeNullFn), ImmutableList.of("1", "5")); - } + + assertFilterMatches(new RegexDimFilter("dim1", ".*ANYMORE", changeNullFn), ImmutableList.of()); + assertFilterMatchesSkipArrays(new RegexDimFilter("dim2", ".*ANYMORE", changeNullFn), ImmutableList.of("1", "5")); assertFilterMatches(new RegexDimFilter("dim1", "ab.*", changeNullFn), ImmutableList.of("4", "5")); assertFilterMatchesSkipArrays(new RegexDimFilter("dim2", "a.*", changeNullFn), ImmutableList.of("0", "3")); diff --git a/processing/src/test/java/org/apache/druid/segment/filter/SearchQueryFilterTest.java b/processing/src/test/java/org/apache/druid/segment/filter/SearchQueryFilterTest.java index 4c620eec8d88..9f17fe02bcc0 100644 --- a/processing/src/test/java/org/apache/druid/segment/filter/SearchQueryFilterTest.java +++ b/processing/src/test/java/org/apache/druid/segment/filter/SearchQueryFilterTest.java @@ -23,7 +23,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import nl.jqno.equalsverifier.EqualsVerifier; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.IAE; import org.apache.druid.java.util.common.Pair; import org.apache.druid.js.JavaScriptConfig; @@ -84,18 +83,10 @@ public void testSingleValueStringColumnWithoutNulls() @Test public void testSingleValueStringColumnWithNulls() { - if (NullHandling.replaceWithDefault()) { - // SearchQueryFilter always returns false for null row values. - assertFilterMatches( - new SearchQueryDimFilter("dim1", specForValue(""), null), - ImmutableList.of("1", "2", "3", "4", "5") - ); - } else { - assertFilterMatches( - new SearchQueryDimFilter("dim1", specForValue(""), null), - ImmutableList.of("0", "1", "2", "3", "4", "5") - ); - } + assertFilterMatches( + new SearchQueryDimFilter("dim1", specForValue(""), null), + ImmutableList.of("0", "1", "2", "3", "4", "5") + ); assertFilterMatches(new SearchQueryDimFilter("dim1", specForValue("10"), null), ImmutableList.of("1")); assertFilterMatches(new SearchQueryDimFilter("dim1", specForValue("2"), null), ImmutableList.of("2")); assertFilterMatches(new SearchQueryDimFilter("dim1", specForValue("1"), null), ImmutableList.of("1", "3")); @@ -110,14 +101,10 @@ public void testMultiValueStringColumn() if (isAutoSchema()) { return; } - if (NullHandling.replaceWithDefault()) { - assertFilterMatches(new SearchQueryDimFilter("dim2", specForValue(""), null), ImmutableList.of("0", "3", "4")); - } else { - assertFilterMatches( - new SearchQueryDimFilter("dim2", specForValue(""), null), - ImmutableList.of("0", "2", "3", "4") - ); - } + assertFilterMatches( + new SearchQueryDimFilter("dim2", specForValue(""), null), + ImmutableList.of("0", "2", "3", "4") + ); assertFilterMatches(new SearchQueryDimFilter("dim2", specForValue("a"), null), ImmutableList.of("0", "3")); assertFilterMatches(new SearchQueryDimFilter("dim2", specForValue("b"), null), ImmutableList.of("0")); assertFilterMatches(new SearchQueryDimFilter("dim2", specForValue("c"), null), ImmutableList.of("4")); @@ -150,26 +137,14 @@ public void testSearchQueryWithExtractionFn() String nullJsFn = "function(str) { if (str === null) { return 'NOT_NULL_ANYMORE'; } else { return str;} }"; ExtractionFn changeNullFn = new JavaScriptExtractionFn(nullJsFn, false, JavaScriptConfig.getEnabledInstance()); - if (NullHandling.replaceWithDefault()) { - assertFilterMatches( - new SearchQueryDimFilter("dim1", specForValue("ANYMORE"), changeNullFn), - ImmutableList.of("0") - ); - assertFilterMatchesSkipArrays( - new SearchQueryDimFilter("dim2", specForValue("ANYMORE"), changeNullFn), - ImmutableList.of("1", "2", "5") - ); - - } else { - assertFilterMatches( - new SearchQueryDimFilter("dim1", specForValue("ANYMORE"), changeNullFn), - ImmutableList.of() - ); - assertFilterMatchesSkipArrays( - new SearchQueryDimFilter("dim2", specForValue("ANYMORE"), changeNullFn), - ImmutableList.of("1", "5") - ); - } + assertFilterMatches( + new SearchQueryDimFilter("dim1", specForValue("ANYMORE"), changeNullFn), + ImmutableList.of() + ); + assertFilterMatchesSkipArrays( + new SearchQueryDimFilter("dim2", specForValue("ANYMORE"), changeNullFn), + ImmutableList.of("1", "5") + ); assertFilterMatches( new SearchQueryDimFilter("dim1", specForValue("ab"), changeNullFn), diff --git a/processing/src/test/java/org/apache/druid/segment/filter/SelectorFilterTest.java b/processing/src/test/java/org/apache/druid/segment/filter/SelectorFilterTest.java index ed082c4598e0..998cfce0858e 100644 --- a/processing/src/test/java/org/apache/druid/segment/filter/SelectorFilterTest.java +++ b/processing/src/test/java/org/apache/druid/segment/filter/SelectorFilterTest.java @@ -23,7 +23,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import nl.jqno.equalsverifier.EqualsVerifier; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.Pair; import org.apache.druid.query.extraction.MapLookupExtractor; import org.apache.druid.query.extraction.TimeDimExtractionFn; @@ -143,28 +142,18 @@ public void testListFilteredVirtualColumn() ); assertFilterMatchesSkipVectorize(new SelectorDimFilter("deny-dim2", "b", null), ImmutableList.of("0")); assertFilterMatchesSkipVectorize(new SelectorDimFilter("deny-dim2", "a", null), ImmutableList.of()); - if (NullHandling.replaceWithDefault()) { - assertFilterMatchesSkipVectorize( - new SelectorDimFilter("deny-dim2", null, null), - ImmutableList.of("1", "2", "3", "5") - ); - } else { - assertFilterMatchesSkipVectorize( - new SelectorDimFilter("deny-dim2", null, null), - ImmutableList.of("1", "3", "5") - ); - } + + assertFilterMatchesSkipVectorize( + new SelectorDimFilter("deny-dim2", null, null), + ImmutableList.of("1", "3", "5") + ); } @Test public void testSingleValueStringColumnWithNulls() { // testSingleValueStringColumnWithoutNulls but with virtual column selector - if (NullHandling.replaceWithDefault()) { - assertFilterMatches(new SelectorDimFilter("dim1", null, null), ImmutableList.of("0")); - } else { - assertFilterMatches(new SelectorDimFilter("dim1", null, null), ImmutableList.of()); - } + assertFilterMatches(new SelectorDimFilter("dim1", null, null), ImmutableList.of()); assertFilterMatches(new SelectorDimFilter("dim1", "", null), ImmutableList.of("0")); assertFilterMatches(new SelectorDimFilter("dim1", "10", null), ImmutableList.of("1")); assertFilterMatches(new SelectorDimFilter("dim1", "2", null), ImmutableList.of("2")); @@ -178,11 +167,7 @@ public void testSingleValueStringColumnWithNulls() public void testSingleValueVirtualStringColumnWithNulls() { // testSingleValueStringColumnWithNulls but with virtual column selector - if (NullHandling.replaceWithDefault()) { - assertFilterMatches(new SelectorDimFilter("vdim1", null, null), ImmutableList.of("0")); - } else { - assertFilterMatches(new SelectorDimFilter("vdim1", null, null), ImmutableList.of()); - } + assertFilterMatches(new SelectorDimFilter("vdim1", null, null), ImmutableList.of()); assertFilterMatches(new SelectorDimFilter("vdim1", "", null), ImmutableList.of("0")); assertFilterMatches(new SelectorDimFilter("vdim1", "10", null), ImmutableList.of("1")); assertFilterMatches(new SelectorDimFilter("vdim1", "2", null), ImmutableList.of("2")); @@ -198,13 +183,8 @@ public void testMultiValueStringColumn() if (isAutoSchema()) { return; } - if (NullHandling.replaceWithDefault()) { - assertFilterMatches(new SelectorDimFilter("dim2", null, null), ImmutableList.of("1", "2", "5")); - assertFilterMatches(new SelectorDimFilter("dim2", "", null), ImmutableList.of("1", "2", "5")); - } else { - assertFilterMatches(new SelectorDimFilter("dim2", null, null), ImmutableList.of("1", "5")); - assertFilterMatches(new SelectorDimFilter("dim2", "", null), ImmutableList.of("2")); - } + assertFilterMatches(new SelectorDimFilter("dim2", null, null), ImmutableList.of("1", "5")); + assertFilterMatches(new SelectorDimFilter("dim2", "", null), ImmutableList.of("2")); assertFilterMatches(new SelectorDimFilter("dim2", "a", null), ImmutableList.of("0", "3")); assertFilterMatches(new SelectorDimFilter("dim2", "b", null), ImmutableList.of("0")); assertFilterMatches(new SelectorDimFilter("dim2", "c", null), ImmutableList.of("4")); @@ -215,11 +195,7 @@ public void testMultiValueStringColumn() public void testMissingColumnSpecifiedInDimensionList() { assertFilterMatches(new SelectorDimFilter("dim3", null, null), ImmutableList.of("0", "1", "2", "3", "4", "5")); - if (NullHandling.replaceWithDefault()) { - assertFilterMatches(new SelectorDimFilter("dim3", "", null), ImmutableList.of("0", "1", "2", "3", "4", "5")); - } else { - assertFilterMatches(new SelectorDimFilter("dim3", "", null), ImmutableList.of()); - } + assertFilterMatches(new SelectorDimFilter("dim3", "", null), ImmutableList.of()); assertFilterMatches(new SelectorDimFilter("dim3", "a", null), ImmutableList.of()); assertFilterMatches(new SelectorDimFilter("dim3", "b", null), ImmutableList.of()); assertFilterMatches(new SelectorDimFilter("dim3", "c", null), ImmutableList.of()); @@ -229,11 +205,7 @@ public void testMissingColumnSpecifiedInDimensionList() public void testMissingColumnNotSpecifiedInDimensionList() { assertFilterMatches(new SelectorDimFilter("dim4", null, null), ImmutableList.of("0", "1", "2", "3", "4", "5")); - if (NullHandling.replaceWithDefault()) { - assertFilterMatches(new SelectorDimFilter("dim4", "", null), ImmutableList.of("0", "1", "2", "3", "4", "5")); - } else { - assertFilterMatches(new SelectorDimFilter("dim4", "", null), ImmutableList.of()); - } + assertFilterMatches(new SelectorDimFilter("dim4", "", null), ImmutableList.of()); assertFilterMatches(new SelectorDimFilter("dim4", "a", null), ImmutableList.of()); assertFilterMatches(new SelectorDimFilter("dim4", "b", null), ImmutableList.of()); assertFilterMatches(new SelectorDimFilter("dim4", "c", null), ImmutableList.of()); @@ -297,22 +269,14 @@ public void testSelectorWithLookupExtractionFn() ); LookupExtractor mapExtractor3 = new MapLookupExtractor(stringMap3, false); LookupExtractionFn lookupFn3 = new LookupExtractionFn(mapExtractor3, false, null, false, true); - if (NullHandling.replaceWithDefault()) { - // Nulls and empty strings are considered equivalent - assertFilterMatches( - new SelectorDimFilter("dim0", null, lookupFn3), - ImmutableList.of("0", "1", "2", "3", "4", "5") - ); - } else { - assertFilterMatches( - new SelectorDimFilter("dim0", null, lookupFn3), - ImmutableList.of("0", "2", "3", "4", "5") - ); - assertFilterMatches( - new SelectorDimFilter("dim0", "", lookupFn3), - ImmutableList.of("1") - ); - } + assertFilterMatches( + new SelectorDimFilter("dim0", null, lookupFn3), + ImmutableList.of("0", "2", "3", "4", "5") + ); + assertFilterMatches( + new SelectorDimFilter("dim0", "", lookupFn3), + ImmutableList.of("1") + ); final Map stringMap4 = ImmutableMap.of( @@ -354,12 +318,7 @@ public void testSelectorWithLookupExtractionFn() assertFilterMatches(optFilter1, ImmutableList.of("0", "1", "2", "5")); assertFilterMatches(optFilter2, ImmutableList.of("2", "5")); - if (NullHandling.replaceWithDefault()) { - // Null and Empty strings are same - assertFilterMatches(optFilter3, ImmutableList.of("0", "1", "2", "3", "4", "5")); - } else { - assertFilterMatches(optFilter3, ImmutableList.of("0", "2", "3", "4", "5")); - } + assertFilterMatches(optFilter3, ImmutableList.of("0", "2", "3", "4", "5")); assertFilterMatches(optFilter4, ImmutableList.of("5")); assertFilterMatches(optFilter5, ImmutableList.of()); assertFilterMatches(optFilter6, ImmutableList.of("5")); @@ -371,61 +330,37 @@ public void testSelectorWithLookupExtractionFn() ImmutableList.of("0", "1", "2", "5") ); assertFilterMatches(new ExtractionDimFilter("dim0", "5", lookupFn2, null), ImmutableList.of("2", "5")); - if (NullHandling.replaceWithDefault()) { - assertFilterMatches( - new ExtractionDimFilter("dim0", null, lookupFn3, null), - ImmutableList.of("0", "1", "2", "3", "4", "5") - ); - } else { - assertFilterMatches( - new ExtractionDimFilter("dim0", null, lookupFn3, null), - ImmutableList.of("0", "2", "3", "4", "5") - ); - assertFilterMatches( - new ExtractionDimFilter("dim0", "", lookupFn3, null), - ImmutableList.of("1") - ); - } + + assertFilterMatches( + new ExtractionDimFilter("dim0", null, lookupFn3, null), + ImmutableList.of("0", "2", "3", "4", "5") + ); + assertFilterMatches( + new ExtractionDimFilter("dim0", "", lookupFn3, null), + ImmutableList.of("1") + ); } @Test public void testNumericColumnNullsAndDefaults() { - if (canTestNumericNullsAsDefaultValues) { - assertFilterMatches(new SelectorDimFilter("f0", "0", null), ImmutableList.of("0", "4")); - assertFilterMatches(new SelectorDimFilter("d0", "0", null), ImmutableList.of("0", "2")); - assertFilterMatches(new SelectorDimFilter("l0", "0", null), ImmutableList.of("0", "3")); - assertFilterMatches(new SelectorDimFilter("f0", null, null), ImmutableList.of()); - assertFilterMatches(new SelectorDimFilter("d0", null, null), ImmutableList.of()); - assertFilterMatches(new SelectorDimFilter("l0", null, null), ImmutableList.of()); - } else { - assertFilterMatches(new SelectorDimFilter("f0", "0", null), ImmutableList.of("0")); - assertFilterMatches(new SelectorDimFilter("d0", "0", null), ImmutableList.of("0")); - assertFilterMatches(new SelectorDimFilter("l0", "0", null), ImmutableList.of("0")); - assertFilterMatches(new SelectorDimFilter("f0", null, null), ImmutableList.of("4")); - assertFilterMatches(new SelectorDimFilter("d0", null, null), ImmutableList.of("2")); - assertFilterMatches(new SelectorDimFilter("l0", null, null), ImmutableList.of("3")); - } + assertFilterMatches(new SelectorDimFilter("f0", "0", null), ImmutableList.of("0")); + assertFilterMatches(new SelectorDimFilter("d0", "0", null), ImmutableList.of("0")); + assertFilterMatches(new SelectorDimFilter("l0", "0", null), ImmutableList.of("0")); + assertFilterMatches(new SelectorDimFilter("f0", null, null), ImmutableList.of("4")); + assertFilterMatches(new SelectorDimFilter("d0", null, null), ImmutableList.of("2")); + assertFilterMatches(new SelectorDimFilter("l0", null, null), ImmutableList.of("3")); } @Test public void testVirtualNumericColumnNullsAndDefaults() { - if (canTestNumericNullsAsDefaultValues) { - assertFilterMatches(new SelectorDimFilter("vf0", "0", null), ImmutableList.of("0", "4")); - assertFilterMatches(new SelectorDimFilter("vd0", "0", null), ImmutableList.of("0", "2")); - assertFilterMatches(new SelectorDimFilter("vl0", "0", null), ImmutableList.of("0", "3")); - assertFilterMatches(new SelectorDimFilter("vf0", null, null), ImmutableList.of()); - assertFilterMatches(new SelectorDimFilter("vd0", null, null), ImmutableList.of()); - assertFilterMatches(new SelectorDimFilter("vl0", null, null), ImmutableList.of()); - } else { - assertFilterMatches(new SelectorDimFilter("vf0", "0", null), ImmutableList.of("0")); - assertFilterMatches(new SelectorDimFilter("vd0", "0", null), ImmutableList.of("0")); - assertFilterMatches(new SelectorDimFilter("vl0", "0", null), ImmutableList.of("0")); - assertFilterMatches(new SelectorDimFilter("vf0", null, null), ImmutableList.of("4")); - assertFilterMatches(new SelectorDimFilter("vd0", null, null), ImmutableList.of("2")); - assertFilterMatches(new SelectorDimFilter("vl0", null, null), ImmutableList.of("3")); - } + assertFilterMatches(new SelectorDimFilter("vf0", "0", null), ImmutableList.of("0")); + assertFilterMatches(new SelectorDimFilter("vd0", "0", null), ImmutableList.of("0")); + assertFilterMatches(new SelectorDimFilter("vl0", "0", null), ImmutableList.of("0")); + assertFilterMatches(new SelectorDimFilter("vf0", null, null), ImmutableList.of("4")); + assertFilterMatches(new SelectorDimFilter("vd0", null, null), ImmutableList.of("2")); + assertFilterMatches(new SelectorDimFilter("vl0", null, null), ImmutableList.of("3")); } @Test diff --git a/processing/src/test/java/org/apache/druid/segment/generator/SegmentGenerator.java b/processing/src/test/java/org/apache/druid/segment/generator/SegmentGenerator.java index 7f04463f73e3..dec956b281d5 100644 --- a/processing/src/test/java/org/apache/druid/segment/generator/SegmentGenerator.java +++ b/processing/src/test/java/org/apache/druid/segment/generator/SegmentGenerator.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.hash.Hashing; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.data.input.InputRowSchema; import org.apache.druid.data.input.impl.AggregateProjectionSpec; @@ -72,10 +71,6 @@ public class SegmentGenerator implements Closeable private static final String CACHE_DIR_PROPERTY = "druid.benchmark.cacheDir"; private static final String CACHE_DIR_ENV_VAR = "DRUID_BENCHMARK_CACHE_DIR"; - static { - NullHandling.initializeForTests(); - } - private final File cacheDir; private final boolean cleanupCacheDir; diff --git a/processing/src/test/java/org/apache/druid/segment/incremental/IncrementalIndexCursorFactoryTest.java b/processing/src/test/java/org/apache/druid/segment/incremental/IncrementalIndexCursorFactoryTest.java index e4c6396c0a00..bc0eab833dbb 100644 --- a/processing/src/test/java/org/apache/druid/segment/incremental/IncrementalIndexCursorFactoryTest.java +++ b/processing/src/test/java/org/apache/druid/segment/incremental/IncrementalIndexCursorFactoryTest.java @@ -27,7 +27,6 @@ import org.apache.druid.collections.CloseableDefaultBlockingPool; import org.apache.druid.collections.CloseableStupidPool; import org.apache.druid.collections.NonBlockingPool; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.data.input.MapBasedInputRow; import org.apache.druid.data.input.impl.DimensionsSpec; @@ -632,13 +631,8 @@ public void testCursoringAndSnapshot() throws Exception Assert.assertEquals(1, rowD.size()); Assert.assertEquals(1, rowD.get(0)); IndexedInts rowE = dimSelector3E.getRow(); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(1, rowE.size()); - Assert.assertEquals(0, rowE.get(0)); - } else { - Assert.assertEquals(1, rowE.size()); - Assert.assertEquals(1, rowE.get(0)); - } + Assert.assertEquals(1, rowE.size()); + Assert.assertEquals(1, rowE.get(0)); cursor.advance(); rowNumInCursor++; } diff --git a/processing/src/test/java/org/apache/druid/segment/incremental/IncrementalIndexRowSizeTest.java b/processing/src/test/java/org/apache/druid/segment/incremental/IncrementalIndexRowSizeTest.java index 27ccf182e096..fcf8c280e178 100644 --- a/processing/src/test/java/org/apache/druid/segment/incremental/IncrementalIndexRowSizeTest.java +++ b/processing/src/test/java/org/apache/druid/segment/incremental/IncrementalIndexRowSizeTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.google.common.collect.Lists; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.MapBasedInputRow; import org.apache.druid.query.aggregation.CountAggregatorFactory; import org.apache.druid.segment.CloserRule; @@ -128,7 +127,7 @@ public void testIncrementalIndexRowSizeEmptyString() )); IncrementalIndexRow td1 = tndResult.getIncrementalIndexRow(); // 28 (timestamp + dims array + dimensionDescList) + 4 OR 48 depending on NullHandling.sqlCompatible() - Assert.assertEquals(NullHandling.sqlCompatible() ? 76 : 32, td1.estimateBytesInMemory()); + Assert.assertEquals(76, td1.estimateBytesInMemory()); } private MapBasedInputRow toMapRow(long time, Object... dimAndVal) diff --git a/processing/src/test/java/org/apache/druid/segment/join/BaseHashJoinSegmentCursorFactoryTest.java b/processing/src/test/java/org/apache/druid/segment/join/BaseHashJoinSegmentCursorFactoryTest.java index 105b2ae7e3c1..b0a694e37405 100644 --- a/processing/src/test/java/org/apache/druid/segment/join/BaseHashJoinSegmentCursorFactoryTest.java +++ b/processing/src/test/java/org/apache/druid/segment/join/BaseHashJoinSegmentCursorFactoryTest.java @@ -20,7 +20,6 @@ package org.apache.druid.segment.join; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.math.expr.ExprMacroTable; import org.apache.druid.query.QueryContexts; @@ -86,8 +85,7 @@ public class BaseHashJoinSegmentCursorFactoryTest extends InitializedNullHandlin @BeforeClass public static void setUpStatic() { - NullHandling.initializeForTests(); - NULL_COUNTRY = NullHandling.sqlCompatible() ? null : 0L; + NULL_COUNTRY = null; } @Before diff --git a/processing/src/test/java/org/apache/druid/segment/join/HashJoinSegmentCursorFactoryTest.java b/processing/src/test/java/org/apache/druid/segment/join/HashJoinSegmentCursorFactoryTest.java index 1aedc1cd3c37..c3bec0e591a4 100644 --- a/processing/src/test/java/org/apache/druid/segment/join/HashJoinSegmentCursorFactoryTest.java +++ b/processing/src/test/java/org/apache/druid/segment/join/HashJoinSegmentCursorFactoryTest.java @@ -22,7 +22,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.math.expr.ExprMacroTable; @@ -402,7 +401,6 @@ public void test_makeCursor_factToCountryInnerUsingCountryNumber() FACT_TO_COUNTRY_ON_NUMBER_PREFIX + "countryName", FACT_TO_COUNTRY_ON_NUMBER_PREFIX + "countryNumber" ), - NullHandling.sqlCompatible() ? ImmutableList.of( new Object[]{"Peremptory norm", "AU", "AU", "Australia", 0L}, new Object[]{"President of India", "US", "US", "United States", 13L}, @@ -416,21 +414,6 @@ public void test_makeCursor_factToCountryInnerUsingCountryNumber() new Object[]{"Old Anatolian Turkish", "US", "US", "United States", 13L}, new Object[]{"Cream Soda", "SU", "SU", "States United", 15L}, new Object[]{"History of Fourems", "MMMM", "MMMM", "Fourems", 205L} - ) : - ImmutableList.of( - new Object[]{"Talk:Oswald Tilghman", null, "AU", "Australia", 0L}, - new Object[]{"Peremptory norm", "AU", "AU", "Australia", 0L}, - new Object[]{"President of India", "US", "US", "United States", 13L}, - new Object[]{"Glasgow", "GB", "GB", "United Kingdom", 6L}, - new Object[]{"Otjiwarongo Airport", "US", "US", "United States", 13L}, - new Object[]{"Sarah Michelle Gellar", "CA", "CA", "Canada", 1L}, - new Object[]{"DirecTV", "US", "US", "United States", 13L}, - new Object[]{"Carlo Curti", "US", "US", "United States", 13L}, - new Object[]{"Giusy Ferreri discography", "IT", "IT", "Italy", 7L}, - new Object[]{"Roma-Bangkok", "IT", "IT", "Italy", 7L}, - new Object[]{"Old Anatolian Turkish", "US", "US", "United States", 13L}, - new Object[]{"Cream Soda", "SU", "SU", "States United", 15L}, - new Object[][]{new Object[]{"History of Fourems", "MMMM", "MMMM", "Fourems", 205L}} ) ); } @@ -461,7 +444,6 @@ public void test_makeCursor_factToCountryInnerUsingCountryNumberUsingLookup() "countryIsoCode", FACT_TO_COUNTRY_ON_NUMBER_PREFIX + "v" ), - NullHandling.sqlCompatible() ? ImmutableList.of( new Object[]{"Peremptory norm", "AU", "Australia"}, new Object[]{"President of India", "US", "United States"}, @@ -475,21 +457,6 @@ public void test_makeCursor_factToCountryInnerUsingCountryNumberUsingLookup() new Object[]{"Old Anatolian Turkish", "US", "United States"}, new Object[]{"Cream Soda", "SU", "States United"}, new Object[]{"History of Fourems", "MMMM", "Fourems"} - ) : - ImmutableList.of( - new Object[]{"Talk:Oswald Tilghman", null, "Australia"}, - new Object[]{"Peremptory norm", "AU", "Australia"}, - new Object[]{"President of India", "US", "United States"}, - new Object[]{"Glasgow", "GB", "United Kingdom"}, - new Object[]{"Otjiwarongo Airport", "US", "United States"}, - new Object[]{"Sarah Michelle Gellar", "CA", "Canada"}, - new Object[]{"DirecTV", "US", "United States"}, - new Object[]{"Carlo Curti", "US", "United States"}, - new Object[]{"Giusy Ferreri discography", "IT", "Italy"}, - new Object[]{"Roma-Bangkok", "IT", "Italy"}, - new Object[]{"Old Anatolian Turkish", "US", "United States"}, - new Object[]{"Cream Soda", "SU", "States United"}, - new Object[][]{new Object[]{"History of Fourems", "MMMM", "Fourems"}} ) ); } @@ -586,8 +553,8 @@ public void test_makeCursor_factToCountryRightWithFilterOnLeftIsNull() cursorFactory.makeCursorHolder(buildSpec), columns, ImmutableList.of( - new Object[]{null, null, NullHandling.sqlCompatible() ? null : 0L, "AX", "Atlantis", 14L}, - new Object[]{null, null, NullHandling.sqlCompatible() ? null : 0L, "USCA", "Usca", 16L} + new Object[]{null, null, null, "AX", "Atlantis", 14L}, + new Object[]{null, null, null, "USCA", "Usca", 16L} ) ); } @@ -620,8 +587,8 @@ public void test_makeCursor_factToCountryRightWithFilterOnLeftIsNullUsingLookup( cursorFactory.makeCursorHolder(buildSpec), columns, ImmutableList.of( - new Object[]{null, null, NullHandling.sqlCompatible() ? null : 0L, "AX", "Atlantis"}, - new Object[]{null, null, NullHandling.sqlCompatible() ? null : 0L, "USCA", "Usca"} + new Object[]{null, null, null, "AX", "Atlantis"}, + new Object[]{null, null, null, "USCA", "Usca"} ) ); } @@ -655,8 +622,8 @@ public void test_makeCursor_factToCountryFullWithFilterOnLeftIsNull() cursorFactory.makeCursorHolder(buildSpec), columns, ImmutableList.of( - new Object[]{null, null, NullHandling.sqlCompatible() ? null : 0L, "AX", "Atlantis", 14L}, - new Object[]{null, null, NullHandling.sqlCompatible() ? null : 0L, "USCA", "Usca", 16L} + new Object[]{null, null, null, "AX", "Atlantis", 14L}, + new Object[]{null, null, null, "USCA", "Usca", 16L} ) ); } @@ -689,8 +656,8 @@ public void test_makeCursor_factToCountryFullWithFilterOnLeftIsNullUsingLookup() cursorFactory.makeCursorHolder(buildSpec), columns, ImmutableList.of( - new Object[]{null, null, NullHandling.sqlCompatible() ? null : 0L, "AX", "Atlantis"}, - new Object[]{null, null, NullHandling.sqlCompatible() ? null : 0L, "USCA", "Usca"} + new Object[]{null, null, null, "AX", "Atlantis"}, + new Object[]{null, null, null, "USCA", "Usca"} ) ); } @@ -1948,7 +1915,7 @@ public void test_makeCursor_factToCountryFullWithBaseFilter() new Object[]{"Didier Leclair", "CA", "CA", "Canada", 1L}, new Object[]{"Les Argonautes", "CA", "CA", "Canada", 1L}, new Object[]{"Sarah Michelle Gellar", "CA", "CA", "Canada", 1L}, - new Object[]{"Orange Soda", "MatchNothing", null, null, NullHandling.sqlCompatible() ? null : 0L}, + new Object[]{"Orange Soda", "MatchNothing", null, null, null}, new Object[]{null, null, "AU", "Australia", 0L}, new Object[]{null, null, "CL", "Chile", 2L}, new Object[]{null, null, "DE", "Germany", 3L}, diff --git a/processing/src/test/java/org/apache/druid/segment/join/JoinConditionAnalysisTest.java b/processing/src/test/java/org/apache/druid/segment/join/JoinConditionAnalysisTest.java index 1ab6c0922994..7c77612a9ae5 100644 --- a/processing/src/test/java/org/apache/druid/segment/join/JoinConditionAnalysisTest.java +++ b/processing/src/test/java/org/apache/druid/segment/join/JoinConditionAnalysisTest.java @@ -22,12 +22,10 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import nl.jqno.equalsverifier.EqualsVerifier; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.Pair; import org.apache.druid.math.expr.Expr; import org.apache.druid.math.expr.ExprMacroTable; import org.junit.Assert; -import org.junit.BeforeClass; import org.junit.Test; import java.util.List; @@ -37,12 +35,6 @@ public class JoinConditionAnalysisTest { private static final String PREFIX = "j."; - @BeforeClass - public static void setUpStatic() - { - NullHandling.initializeForTests(); - } - @Test public void test_forExpression_simple() { diff --git a/processing/src/test/java/org/apache/druid/segment/join/JoinFilterAnalyzerTest.java b/processing/src/test/java/org/apache/druid/segment/join/JoinFilterAnalyzerTest.java index e043e40fa48d..b59f422bd9af 100644 --- a/processing/src/test/java/org/apache/druid/segment/join/JoinFilterAnalyzerTest.java +++ b/processing/src/test/java/org/apache/druid/segment/join/JoinFilterAnalyzerTest.java @@ -22,7 +22,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import nl.jqno.equalsverifier.EqualsVerifier; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.IAE; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.math.expr.ExprMacroTable; @@ -279,15 +278,13 @@ public void test_filterPushDown_factToRegionToCountryLeftFilterOnNullColumns() FACT_TO_REGION_PREFIX + "regionName", REGION_TO_COUNTRY_PREFIX + "countryName" ), - NullHandling.sqlCompatible() ? ImmutableList.of( new Object[]{"Talk:Oswald Tilghman", null, null}, new Object[]{"Rallicula", null, null}, new Object[]{"Apamea abruzzorum", null, null}, new Object[]{"Atractus flammigerus", null, null}, new Object[]{"Agama mossambica", null, null} - ) : - ImmutableList.of() // when not running in SQL compatible mode, countryNumber does not have nulls + ) ); JoinFilterSplit expectedFilterSplit = new JoinFilterSplit( @@ -1368,12 +1365,7 @@ public void test_filterPushDown_factToCountryInnerUsingCountryNumberFilterOnChan FACT_TO_COUNTRY_ON_NUMBER_PREFIX + "countryName", FACT_TO_COUNTRY_ON_NUMBER_PREFIX + "countryNumber" ), - NullHandling.sqlCompatible() ? - ImmutableList.of( - new Object[]{"Peremptory norm", "AU", "AU", "Australia", 0L} - ) : ImmutableList.of( - new Object[]{"Talk:Oswald Tilghman", null, "AU", "Australia", 0L}, new Object[]{"Peremptory norm", "AU", "AU", "Australia", 0L} ) ); @@ -1427,12 +1419,7 @@ public void test_filterPushDown_factToCountryInnerUsingCountryNumberFilterOnChan FACT_TO_COUNTRY_ON_NUMBER_PREFIX + "k", FACT_TO_COUNTRY_ON_NUMBER_PREFIX + "v" ), - NullHandling.sqlCompatible() ? - ImmutableList.of( - new Object[]{"Peremptory norm", "AU", "0", "Australia"} - ) : ImmutableList.of( - new Object[]{"Talk:Oswald Tilghman", null, "0", "Australia"}, new Object[]{"Peremptory norm", "AU", "0", "Australia"} ) ); diff --git a/processing/src/test/java/org/apache/druid/segment/join/JoinTestHelper.java b/processing/src/test/java/org/apache/druid/segment/join/JoinTestHelper.java index 7536c74c4a3f..4b191bac3204 100644 --- a/processing/src/test/java/org/apache/druid/segment/join/JoinTestHelper.java +++ b/processing/src/test/java/org/apache/druid/segment/join/JoinTestHelper.java @@ -24,7 +24,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.data.input.MapBasedInputRow; import org.apache.druid.data.input.impl.DimensionSchema; @@ -138,19 +137,19 @@ public Supplier makeDimensionProcessor(DimensionSelector selector, boole @Override public Supplier makeFloatProcessor(BaseFloatColumnValueSelector selector) { - return () -> NullHandling.sqlCompatible() && selector.isNull() ? null : selector.getFloat(); + return () -> selector.isNull() ? null : selector.getFloat(); } @Override public Supplier makeDoubleProcessor(BaseDoubleColumnValueSelector selector) { - return () -> NullHandling.sqlCompatible() && selector.isNull() ? null : selector.getDouble(); + return () -> selector.isNull() ? null : selector.getDouble(); } @Override public Supplier makeLongProcessor(BaseLongColumnValueSelector selector) { - return () -> NullHandling.sqlCompatible() && selector.isNull() ? null : selector.getLong(); + return () -> selector.isNull() ? null : selector.getLong(); } @Override diff --git a/processing/src/test/java/org/apache/druid/segment/join/JoinableFactoryWrapperTest.java b/processing/src/test/java/org/apache/druid/segment/join/JoinableFactoryWrapperTest.java index 0516287d33a3..7703b9e1ac9f 100644 --- a/processing/src/test/java/org/apache/druid/segment/join/JoinableFactoryWrapperTest.java +++ b/processing/src/test/java/org/apache/druid/segment/join/JoinableFactoryWrapperTest.java @@ -22,8 +22,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Sets; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.IAE; import org.apache.druid.java.util.common.Pair; @@ -48,7 +46,6 @@ import org.junit.rules.TemporaryFolder; import java.util.Arrays; -import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Set; @@ -70,9 +67,7 @@ public class JoinableFactoryWrapperTest extends InitializedNullHandlingTest .build(); private static final Set TEST_LOOKUP_KEYS = - NullHandling.sqlCompatible() - ? TEST_LOOKUP.keySet() - : Sets.difference(TEST_LOOKUP.keySet(), Collections.singleton("")); + TEST_LOOKUP.keySet(); private static final InlineDataSource INDEXED_TABLE_DS = InlineDataSource.fromIterable( ImmutableList.of( diff --git a/processing/src/test/java/org/apache/druid/segment/join/PossiblyNullDimensionSelectorTest.java b/processing/src/test/java/org/apache/druid/segment/join/PossiblyNullDimensionSelectorTest.java index 123d1c351658..21f81b5671f3 100644 --- a/processing/src/test/java/org/apache/druid/segment/join/PossiblyNullDimensionSelectorTest.java +++ b/processing/src/test/java/org/apache/druid/segment/join/PossiblyNullDimensionSelectorTest.java @@ -21,11 +21,9 @@ import it.unimi.dsi.fastutil.ints.IntArrayList; import it.unimi.dsi.fastutil.ints.IntList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.segment.DimensionSelector; import org.apache.druid.segment.data.IndexedInts; import org.junit.Assert; -import org.junit.BeforeClass; import org.junit.Test; public class PossiblyNullDimensionSelectorTest @@ -35,12 +33,6 @@ public class PossiblyNullDimensionSelectorTest private final DimensionSelector onNullSelector = makeSelector(DimensionSelector.constant(null)); private final DimensionSelector onNonnullSelector = makeSelector(DimensionSelector.constant("foo")); - @BeforeClass - public static void setUpClass() - { - NullHandling.initializeForTests(); - } - @Test public void test_getRow_normalOnNullSelector() { diff --git a/processing/src/test/java/org/apache/druid/segment/join/lookup/LookupJoinableTest.java b/processing/src/test/java/org/apache/druid/segment/join/lookup/LookupJoinableTest.java index ca993fe1ae02..f2b613e45a1b 100644 --- a/processing/src/test/java/org/apache/druid/segment/join/lookup/LookupJoinableTest.java +++ b/processing/src/test/java/org/apache/druid/segment/join/lookup/LookupJoinableTest.java @@ -22,7 +22,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Sets; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.filter.InDimFilter; import org.apache.druid.query.lookup.ImmutableLookupMap; import org.apache.druid.query.lookup.LookupExtractor; @@ -288,9 +287,7 @@ public void getMatchableColumnValuesIfAllUniqueForKeyColumnShouldReturnValues() ); Assert.assertEquals( - NullHandling.sqlCompatible() - ? ImmutableSet.of(SEARCH_KEY_VALUE, "foo", "bar", "") - : ImmutableSet.of(SEARCH_KEY_VALUE, "foo", "bar"), + ImmutableSet.of(SEARCH_KEY_VALUE, "foo", "bar", ""), values.getColumnValues() ); } diff --git a/processing/src/test/java/org/apache/druid/segment/join/table/BroadcastSegmentIndexedTableTest.java b/processing/src/test/java/org/apache/druid/segment/join/table/BroadcastSegmentIndexedTableTest.java index 8946db13cc8e..80374df12954 100644 --- a/processing/src/test/java/org/apache/druid/segment/join/table/BroadcastSegmentIndexedTableTest.java +++ b/processing/src/test/java/org/apache/druid/segment/join/table/BroadcastSegmentIndexedTableTest.java @@ -26,7 +26,6 @@ import com.google.common.collect.ImmutableSet; import it.unimi.dsi.fastutil.ints.IntBidirectionalIterator; import it.unimi.dsi.fastutil.ints.IntSortedSet; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.jackson.SegmentizerModule; import org.apache.druid.java.util.common.DateTimes; @@ -180,21 +179,21 @@ public void testMultiValueStringKeyColumn() @Test public void testLongKeyColumn() { - final Long[] vals = new Long[] {NullHandling.replaceWithDefault() ? 0L : null, 10L, 20L}; + final Long[] vals = new Long[] {null, 10L, 20L}; checkIndexAndReader(LONG_COL_1, vals); } @Test public void testFloatKeyColumn() { - final Float[] vals = new Float[] {NullHandling.replaceWithDefault() ? 0.0f : null, 10.0f, 20.0f}; + final Float[] vals = new Float[] {null, 10.0f, 20.0f}; checkIndexAndReader(FLOAT_COL_1, vals); } @Test public void testDoubleKeyColumn() { - final Double[] vals = new Double[] {NullHandling.replaceWithDefault() ? 0.0 : null, 10.0, 20.0}; + final Double[] vals = new Double[] {null, 10.0, 20.0}; checkIndexAndReader(DOUBLE_COL_1, vals); } diff --git a/processing/src/test/java/org/apache/druid/segment/join/table/FrameBasedIndexedTableTest.java b/processing/src/test/java/org/apache/druid/segment/join/table/FrameBasedIndexedTableTest.java index 64c815f55d4a..2b85775e603c 100644 --- a/processing/src/test/java/org/apache/druid/segment/join/table/FrameBasedIndexedTableTest.java +++ b/processing/src/test/java/org/apache/druid/segment/join/table/FrameBasedIndexedTableTest.java @@ -24,7 +24,6 @@ import com.google.common.collect.Iterables; import it.unimi.dsi.fastutil.ints.IntBidirectionalIterator; import it.unimi.dsi.fastutil.ints.IntSortedSet; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.frame.Frame; import org.apache.druid.frame.allocation.HeapMemoryAllocator; import org.apache.druid.frame.allocation.SingleMemoryAllocatorFactory; @@ -267,14 +266,14 @@ public void testMultiValueStringKeyColumn() @Test public void testLongKeyColumn() { - final Long[] vals = new Long[]{NullHandling.replaceWithDefault() ? 0L : null, 1L, 2L, 4L, 5L}; + final Long[] vals = new Long[]{null, 1L, 2L, 4L, 5L}; checkIndexAndReader(LONG_COL_1, vals); } @Test public void testFloatKeyColumn() { - final Float[] vals = new Float[]{NullHandling.replaceWithDefault() ? 0.0f : null, 3.1f, 3.2f, 3.5f, 3.8f, 3.9f}; + final Float[] vals = new Float[]{null, 3.1f, 3.2f, 3.5f, 3.8f, 3.9f}; checkIndexAndReader(FLOAT_COL_1, vals); } @@ -282,7 +281,7 @@ public void testFloatKeyColumn() public void testDoubleKeyColumn() { final Double[] vals = new Double[]{ - NullHandling.replaceWithDefault() ? 0.0 : null, 1.1d, 1.2d, 1.3d, 1.5d, 1.7d, 1.8d + null, 1.1d, 1.2d, 1.3d, 1.5d, 1.7d, 1.8d }; checkIndexAndReader(DOUBLE_COL_1, vals); } diff --git a/processing/src/test/java/org/apache/druid/segment/join/table/IndexedTableJoinMatcherTest.java b/processing/src/test/java/org/apache/druid/segment/join/table/IndexedTableJoinMatcherTest.java index 6222d50d4468..5ddd8258626f 100644 --- a/processing/src/test/java/org/apache/druid/segment/join/table/IndexedTableJoinMatcherTest.java +++ b/processing/src/test/java/org/apache/druid/segment/join/table/IndexedTableJoinMatcherTest.java @@ -25,7 +25,6 @@ import it.unimi.dsi.fastutil.ints.IntArrayList; import it.unimi.dsi.fastutil.ints.IntSortedSet; import it.unimi.dsi.fastutil.ints.IntSortedSets; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.QueryUnsupportedException; import org.apache.druid.segment.BaseLongColumnValueSelector; import org.apache.druid.segment.BaseObjectColumnValueSelector; @@ -67,10 +66,7 @@ public void setUp() { mocks = MockitoAnnotations.openMocks(this); - if (NullHandling.sqlCompatible()) { - Mockito.doReturn(false).when(selector).isNull(); - } - + Mockito.doReturn(false).when(selector).isNull(); Mockito.doReturn(1L).when(selector).getLong(); } @@ -573,7 +569,7 @@ public IntSortedSet find(Object key) { final Long l = DimensionHandlerUtils.convertObjectToLong(key); - if (l == null && NullHandling.sqlCompatible()) { + if (l == null) { return IntSortedSets.EMPTY_SET; } else { return IntSortedSets.singleton(Ints.checkedCast((l == null ? 0L : l) + 1)); diff --git a/processing/src/test/java/org/apache/druid/segment/join/table/IndexedTableJoinableTest.java b/processing/src/test/java/org/apache/druid/segment/join/table/IndexedTableJoinableTest.java index b08249f2a4d5..ad3c54718af1 100644 --- a/processing/src/test/java/org/apache/druid/segment/join/table/IndexedTableJoinableTest.java +++ b/processing/src/test/java/org/apache/druid/segment/join/table/IndexedTableJoinableTest.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.io.Closer; import org.apache.druid.math.expr.ExprMacroTable; @@ -61,10 +60,6 @@ public class IndexedTableJoinableTest private static final String SEARCH_VALUE_UNKNOWN = "10"; private static final long MAX_CORRELATION_SET_SIZE = 10_000L; - static { - NullHandling.initializeForTests(); - } - private final ColumnSelectorFactory dummyColumnSelectorFactory = new ColumnSelectorFactory() { @Override diff --git a/processing/src/test/java/org/apache/druid/segment/join/table/RowBasedIndexedTableTest.java b/processing/src/test/java/org/apache/druid/segment/join/table/RowBasedIndexedTableTest.java index aef371bcf556..c7dd25887a0d 100644 --- a/processing/src/test/java/org/apache/druid/segment/join/table/RowBasedIndexedTableTest.java +++ b/processing/src/test/java/org/apache/druid/segment/join/table/RowBasedIndexedTableTest.java @@ -20,13 +20,11 @@ package org.apache.druid.segment.join.table; import com.google.common.collect.ImmutableSet; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.segment.column.ColumnType; import org.apache.druid.segment.column.RowSignature; import org.apache.druid.segment.join.JoinTestHelper; import org.junit.Assert; import org.junit.Before; -import org.junit.BeforeClass; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; @@ -48,12 +46,6 @@ public class RowBasedIndexedTableTest public RowBasedIndexedTable> countriesTable; public RowBasedIndexedTable> regionsTable; - @BeforeClass - public static void setUpStatic() - { - NullHandling.initializeForTests(); - } - @Before public void setUp() throws IOException { diff --git a/processing/src/test/java/org/apache/druid/segment/nested/DictionaryIdLookupTest.java b/processing/src/test/java/org/apache/druid/segment/nested/DictionaryIdLookupTest.java index d12ffc07f740..2e46dc2c4db3 100644 --- a/processing/src/test/java/org/apache/druid/segment/nested/DictionaryIdLookupTest.java +++ b/processing/src/test/java/org/apache/druid/segment/nested/DictionaryIdLookupTest.java @@ -19,7 +19,6 @@ package org.apache.druid.segment.nested; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.segment.AutoTypeColumnMerger; import org.apache.druid.segment.column.StringEncodingStrategies; import org.apache.druid.segment.column.StringEncodingStrategy; @@ -144,30 +143,16 @@ public void testIdLookup() throws IOException } Assert.assertEquals(3, tempDir.listFiles().length); - if (NullHandling.sqlCompatible()) { - Assert.assertEquals(8, idLookup.lookupDouble(-1.234)); - Assert.assertEquals(11, idLookup.lookupDouble(1.234)); - - Assert.assertEquals(3, tempDir.listFiles().length); - - // looking up arrays pulls in array file - Assert.assertEquals(12, idLookup.lookupArray(new int[]{1, 2})); - Assert.assertEquals(13, idLookup.lookupArray(new int[]{4, 5, 6})); - Assert.assertEquals(14, idLookup.lookupArray(new int[]{10, 8, 9, 11})); - Assert.assertEquals(4, tempDir.listFiles().length); - } else { - // default value mode sticks zeros in dictionary even if not present in column because of .. reasons - Assert.assertEquals(9, idLookup.lookupDouble(-1.234)); - Assert.assertEquals(13, idLookup.lookupDouble(1.234)); - - Assert.assertEquals(3, tempDir.listFiles().length); - - // looking up arrays pulls in array file - Assert.assertEquals(14, idLookup.lookupArray(new int[]{1, 2})); - Assert.assertEquals(15, idLookup.lookupArray(new int[]{5, 6, 7})); - Assert.assertEquals(16, idLookup.lookupArray(new int[]{12, 9, 11, 13})); - Assert.assertEquals(4, tempDir.listFiles().length); - } + Assert.assertEquals(8, idLookup.lookupDouble(-1.234)); + Assert.assertEquals(11, idLookup.lookupDouble(1.234)); + + Assert.assertEquals(3, tempDir.listFiles().length); + + // looking up arrays pulls in array file + Assert.assertEquals(12, idLookup.lookupArray(new int[]{1, 2})); + Assert.assertEquals(13, idLookup.lookupArray(new int[]{4, 5, 6})); + Assert.assertEquals(14, idLookup.lookupArray(new int[]{10, 8, 9, 11})); + Assert.assertEquals(4, tempDir.listFiles().length); // close it removes all the temp files idLookup.close(); diff --git a/processing/src/test/java/org/apache/druid/segment/nested/NestedDataColumnSupplierTest.java b/processing/src/test/java/org/apache/druid/segment/nested/NestedDataColumnSupplierTest.java index 6bb9c5ae9fff..991456aa9c56 100644 --- a/processing/src/test/java/org/apache/druid/segment/nested/NestedDataColumnSupplierTest.java +++ b/processing/src/test/java/org/apache/druid/segment/nested/NestedDataColumnSupplierTest.java @@ -28,7 +28,6 @@ import com.google.common.util.concurrent.MoreExecutors; import org.apache.druid.collections.bitmap.ImmutableBitmap; import org.apache.druid.collections.bitmap.WrappedRoaringBitmap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.guice.BuiltInTypesModule; import org.apache.druid.java.util.common.concurrent.Execs; import org.apache.druid.java.util.common.io.Closer; @@ -678,12 +677,7 @@ private void testPath( ) { final Object inputValue = row.get(path); - // in default value mode, even though the input row had an empty string, the selector spits out null, so we want - // to take the null checking path - final boolean isStringAndNullEquivalent = - inputValue instanceof String && NullHandling.isNullOrEquivalent((String) inputValue); - - if (row.containsKey(path) && inputValue != null && !isStringAndNullEquivalent) { + if (row.containsKey(path) && inputValue != null) { Assert.assertEquals(inputValue, valueSelector.getObject()); if (ColumnType.LONG.equals(singleType)) { Assert.assertEquals(inputValue, valueSelector.getLong()); diff --git a/processing/src/test/java/org/apache/druid/segment/nested/NestedDataColumnSupplierV4Test.java b/processing/src/test/java/org/apache/druid/segment/nested/NestedDataColumnSupplierV4Test.java index 315077b4160e..77568f0355ff 100644 --- a/processing/src/test/java/org/apache/druid/segment/nested/NestedDataColumnSupplierV4Test.java +++ b/processing/src/test/java/org/apache/druid/segment/nested/NestedDataColumnSupplierV4Test.java @@ -27,7 +27,6 @@ import com.google.common.util.concurrent.ListeningExecutorService; import com.google.common.util.concurrent.MoreExecutors; import org.apache.druid.collections.bitmap.RoaringBitmapFactory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.guice.BuiltInTypesModule; import org.apache.druid.java.util.common.concurrent.Execs; import org.apache.druid.java.util.common.io.Closer; @@ -454,11 +453,7 @@ private void testPath( ) { final Object inputValue = row.get(path); - // in default value mode, even though the input row had an empty string, the selector spits out null, so we want - // to take the null checking path - final boolean isStringAndNullEquivalent = - inputValue instanceof String && NullHandling.isNullOrEquivalent((String) inputValue); - if (row.containsKey(path) && inputValue != null && !isStringAndNullEquivalent) { + if (row.containsKey(path) && inputValue != null) { Assert.assertEquals(inputValue, valueSelector.getObject()); if (ColumnType.LONG.equals(singleType)) { Assert.assertEquals(inputValue, valueSelector.getLong()); diff --git a/processing/src/test/java/org/apache/druid/segment/nested/ScalarDoubleColumnSupplierTest.java b/processing/src/test/java/org/apache/druid/segment/nested/ScalarDoubleColumnSupplierTest.java index c902aa52988d..f615cb3c050b 100644 --- a/processing/src/test/java/org/apache/druid/segment/nested/ScalarDoubleColumnSupplierTest.java +++ b/processing/src/test/java/org/apache/druid/segment/nested/ScalarDoubleColumnSupplierTest.java @@ -25,7 +25,6 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningExecutorService; import com.google.common.util.concurrent.MoreExecutors; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.guice.BuiltInTypesModule; import org.apache.druid.java.util.common.concurrent.Execs; import org.apache.druid.java.util.common.io.Closer; @@ -282,7 +281,7 @@ private void smokeTest(ScalarDoubleColumnAndIndexSupplier supplier, ScalarDouble Assert.assertEquals(row.longValue(), vectorValueSelector.getLongVector()[0]); Assert.assertEquals(row.floatValue(), vectorValueSelector.getFloatVector()[0], 0.0); boolean[] nullVector = vectorValueSelector.getNullVector(); - if (NullHandling.sqlCompatible() && nullVector != null) { + if (nullVector != null) { Assert.assertFalse(nullVector[0]); } else { Assert.assertNull(nullVector); @@ -306,34 +305,14 @@ private void smokeTest(ScalarDoubleColumnAndIndexSupplier supplier, ScalarDouble Assert.assertFalse(nullValueIndex.get().computeBitmapResult(resultFactory, false).get(i)); } else { - if (NullHandling.sqlCompatible()) { - Assert.assertNull(valueSelector.getObject()); - Assert.assertTrue(valueSelector.isNull()); - Assert.assertTrue(vectorValueSelector.getNullVector()[0]); - Assert.assertTrue(valueSetIndex.forValue(null).computeBitmapResult(resultFactory, false).get(i)); - Assert.assertTrue(nullValueIndex.get().computeBitmapResult(resultFactory, false).get(i)); - Assert.assertTrue(predicateIndex.forPredicate(new SelectorPredicateFactory(null)) - .computeBitmapResult(resultFactory, false) - .get(i)); - } else { - Assert.assertEquals(NullHandling.defaultDoubleValue(), valueSelector.getObject()); - Assert.assertFalse(valueSelector.isNull()); - Assert.assertEquals(NullHandling.defaultDoubleValue(), vectorValueSelector.getDoubleVector()[0], 0.0); - Assert.assertNull(vectorValueSelector.getNullVector()); - - Assert.assertFalse(valueSetIndex.forValue(null).computeBitmapResult(resultFactory, false).get(i)); - Assert.assertFalse(nullValueIndex.get().computeBitmapResult(resultFactory, false).get(i)); - Assert.assertFalse(predicateIndex.forPredicate(new SelectorPredicateFactory(null)) - .computeBitmapResult(resultFactory, false) - .get(i)); - final String defaultString = String.valueOf(NullHandling.defaultDoubleValue()); - Assert.assertTrue(valueSetIndex.forValue(defaultString).computeBitmapResult(resultFactory, false).get(i)); - Assert.assertTrue(predicateIndex.forPredicate(new SelectorPredicateFactory(defaultString)) - .computeBitmapResult(resultFactory, false) - .get(i)); - } - - + Assert.assertNull(valueSelector.getObject()); + Assert.assertTrue(valueSelector.isNull()); + Assert.assertTrue(vectorValueSelector.getNullVector()[0]); + Assert.assertTrue(valueSetIndex.forValue(null).computeBitmapResult(resultFactory, false).get(i)); + Assert.assertTrue(nullValueIndex.get().computeBitmapResult(resultFactory, false).get(i)); + Assert.assertTrue(predicateIndex.forPredicate(new SelectorPredicateFactory(null)) + .computeBitmapResult(resultFactory, false) + .get(i)); Assert.assertFalse(valueSetIndex.forValue(NO_MATCH).computeBitmapResult(resultFactory, false).get(i)); Assert.assertFalse(valueSetIndex.forValue(NO_MATCH).computeBitmapResult(resultFactory, false).get(i)); diff --git a/processing/src/test/java/org/apache/druid/segment/nested/ScalarLongColumnSupplierTest.java b/processing/src/test/java/org/apache/druid/segment/nested/ScalarLongColumnSupplierTest.java index 353da172928b..3a851c47ebfb 100644 --- a/processing/src/test/java/org/apache/druid/segment/nested/ScalarLongColumnSupplierTest.java +++ b/processing/src/test/java/org/apache/druid/segment/nested/ScalarLongColumnSupplierTest.java @@ -25,7 +25,6 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningExecutorService; import com.google.common.util.concurrent.MoreExecutors; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.guice.BuiltInTypesModule; import org.apache.druid.java.util.common.concurrent.Execs; import org.apache.druid.java.util.common.io.Closer; @@ -282,7 +281,7 @@ private void smokeTest(ScalarLongColumnAndIndexSupplier supplier, ScalarLongColu Assert.assertEquals(row.doubleValue(), vectorValueSelector.getDoubleVector()[0], 0.0); Assert.assertEquals(row.floatValue(), vectorValueSelector.getFloatVector()[0], 0.0); boolean[] nullVector = vectorValueSelector.getNullVector(); - if (NullHandling.sqlCompatible() && nullVector != null) { + if (nullVector != null) { Assert.assertFalse(nullVector[0]); } else { Assert.assertNull(nullVector); @@ -306,30 +305,14 @@ private void smokeTest(ScalarLongColumnAndIndexSupplier supplier, ScalarLongColu Assert.assertFalse(nullValueIndex.get().computeBitmapResult(resultFactory, false).get(i)); } else { - if (NullHandling.sqlCompatible()) { - Assert.assertNull(valueSelector.getObject()); - Assert.assertTrue(valueSelector.isNull()); - Assert.assertTrue(vectorValueSelector.getNullVector()[0]); - Assert.assertTrue(valueSetIndex.forValue(null).computeBitmapResult(resultFactory, false).get(i)); - Assert.assertTrue(nullValueIndex.get().computeBitmapResult(resultFactory, false).get(i)); - Assert.assertTrue(predicateIndex.forPredicate(new SelectorPredicateFactory(null)) - .computeBitmapResult(resultFactory, false) - .get(i)); - } else { - Assert.assertEquals(NullHandling.defaultLongValue(), valueSelector.getObject()); - Assert.assertFalse(valueSelector.isNull()); - Assert.assertNull(vectorValueSelector.getNullVector()); - Assert.assertFalse(valueSetIndex.forValue(null).computeBitmapResult(resultFactory, false).get(i)); - Assert.assertFalse(nullValueIndex.get().computeBitmapResult(resultFactory, false).get(i)); - Assert.assertFalse(predicateIndex.forPredicate(new SelectorPredicateFactory(null)) - .computeBitmapResult(resultFactory, false) - .get(i)); - final String defaultString = String.valueOf(NullHandling.defaultLongValue()); - Assert.assertTrue(valueSetIndex.forValue(defaultString).computeBitmapResult(resultFactory, false).get(i)); - Assert.assertTrue(predicateIndex.forPredicate(new SelectorPredicateFactory(defaultString)) - .computeBitmapResult(resultFactory, false) - .get(i)); - } + Assert.assertNull(valueSelector.getObject()); + Assert.assertTrue(valueSelector.isNull()); + Assert.assertTrue(vectorValueSelector.getNullVector()[0]); + Assert.assertTrue(valueSetIndex.forValue(null).computeBitmapResult(resultFactory, false).get(i)); + Assert.assertTrue(nullValueIndex.get().computeBitmapResult(resultFactory, false).get(i)); + Assert.assertTrue(predicateIndex.forPredicate(new SelectorPredicateFactory(null)) + .computeBitmapResult(resultFactory, false) + .get(i)); Assert.assertFalse(valueSetIndex.forValue(NO_MATCH).computeBitmapResult(resultFactory, false).get(i)); Assert.assertFalse(valueSetIndex.forValue(NO_MATCH).computeBitmapResult(resultFactory, false).get(i)); diff --git a/processing/src/test/java/org/apache/druid/segment/nested/ScalarStringColumnSupplierTest.java b/processing/src/test/java/org/apache/druid/segment/nested/ScalarStringColumnSupplierTest.java index 7ffa4df2e755..d71508203bc7 100644 --- a/processing/src/test/java/org/apache/druid/segment/nested/ScalarStringColumnSupplierTest.java +++ b/processing/src/test/java/org/apache/druid/segment/nested/ScalarStringColumnSupplierTest.java @@ -25,7 +25,6 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningExecutorService; import com.google.common.util.concurrent.MoreExecutors; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.guice.BuiltInTypesModule; import org.apache.druid.java.util.common.concurrent.Execs; import org.apache.druid.java.util.common.io.Closer; @@ -265,11 +264,7 @@ private void smokeTest(ScalarStringColumnAndIndexSupplier supplier, StringUtf8Di for (int i = 0; i < data.size(); i++) { String row = data.get(i); - // in default value mode, even though the input row had an empty string, the selector spits out null, so we want - // to take the null checking path - final boolean isStringAndNullEquivalent = NullHandling.isNullOrEquivalent(row); - - if (row != null && !isStringAndNullEquivalent) { + if (row != null) { Assert.assertEquals(row, valueSelector.getObject()); Assert.assertEquals(row, dimSelector.getObject()); String dimSelectorLookupVal = dimSelector.lookupName(dimSelector.getRow().get(0)); diff --git a/processing/src/test/java/org/apache/druid/segment/serde/CombineFirstTwoEntriesIndexedTest.java b/processing/src/test/java/org/apache/druid/segment/serde/CombineFirstTwoEntriesIndexedTest.java deleted file mode 100644 index 0b8886e04a8b..000000000000 --- a/processing/src/test/java/org/apache/druid/segment/serde/CombineFirstTwoEntriesIndexedTest.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.druid.segment.serde; - -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; -import org.apache.druid.segment.data.GenericIndexed; -import org.apache.druid.segment.data.Indexed; -import org.apache.druid.segment.data.ListIndexed; -import org.apache.druid.testing.InitializedNullHandlingTest; -import org.hamcrest.CoreMatchers; -import org.hamcrest.MatcherAssert; -import org.junit.Assert; -import org.junit.Test; -import org.junit.internal.matchers.ThrowableMessageMatcher; - -import javax.annotation.Nullable; -import java.util.Collections; - -/** - * Test for {@link CombineFirstTwoEntriesIndexed}. - */ -public class CombineFirstTwoEntriesIndexedTest extends InitializedNullHandlingTest -{ - @Test - public void testSizeZero() - { - final IllegalStateException e = Assert.assertThrows( - IllegalStateException.class, - () -> wrap(Indexed.empty(), "xyz") - ); - - MatcherAssert.assertThat( - e, - ThrowableMessageMatcher.hasMessage(CoreMatchers.containsString("Size[0] must be >= 2")) - ); - } - - @Test - public void testSizeOne() - { - final IllegalStateException e = Assert.assertThrows( - IllegalStateException.class, - () -> wrap(new ListIndexed<>("foo"), "xyz") - ); - - MatcherAssert.assertThat( - e, - ThrowableMessageMatcher.hasMessage(CoreMatchers.containsString("Size[1] must be >= 2")) - ); - } - - @Test - public void testSizeTwo() - { - final CombineFirstTwoEntriesIndexed indexed = wrap(new ListIndexed<>("bar", "foo"), "xyz"); - Assert.assertEquals(0, indexed.indexOf("xyz")); - Assert.assertEquals(-2, indexed.indexOf("foo")); - Assert.assertEquals(-2, indexed.indexOf("bar")); - Assert.assertEquals(-2, indexed.indexOf("baz")); - Assert.assertEquals(-2, indexed.indexOf("qux")); - Assert.assertEquals(-2, indexed.indexOf("")); - Assert.assertEquals(-2, indexed.indexOf(null)); - Assert.assertEquals(1, indexed.size()); - Assert.assertEquals("xyz", indexed.get(0)); - Assert.assertFalse(indexed.isSorted()); // Matches delegate. See class-level note in CombineFirstTwoEntriesIndexed. - Assert.assertEquals(ImmutableList.of("xyz"), ImmutableList.copyOf(indexed)); - } - - @Test - public void testSizeThree() - { - final CombineFirstTwoEntriesIndexed indexed = wrap(new ListIndexed<>("bar", "baz", "foo"), "xyz"); - Assert.assertEquals(0, indexed.indexOf("xyz")); - Assert.assertEquals(1, indexed.indexOf("foo")); - Assert.assertEquals(-2, indexed.indexOf("bar")); - Assert.assertEquals(-2, indexed.indexOf("baz")); - Assert.assertEquals(-2, indexed.indexOf("qux")); - Assert.assertEquals(-2, indexed.indexOf("")); - Assert.assertEquals(-2, indexed.indexOf(null)); - Assert.assertEquals("xyz", indexed.get(0)); - Assert.assertEquals("foo", indexed.get(1)); - Assert.assertFalse(indexed.isSorted()); // Matches delegate. See class-level note in CombineFirstTwoEntriesIndexed. - Assert.assertEquals(ImmutableList.of("xyz", "foo"), ImmutableList.copyOf(indexed)); - } - - @Test - public void testSizeTwoSorted() - { - final CombineFirstTwoEntriesIndexed indexed = wrap( - GenericIndexed.fromArray( - new String[]{"bar", "foo"}, - GenericIndexed.STRING_STRATEGY - ), - null - ); - - Assert.assertEquals(0, indexed.indexOf(null)); - Assert.assertEquals(-2, indexed.indexOf("foo")); - Assert.assertEquals(-2, indexed.indexOf("bar")); - Assert.assertEquals(-2, indexed.indexOf("baz")); - Assert.assertEquals(-2, indexed.indexOf("qux")); - Assert.assertEquals(-2, indexed.indexOf("")); - Assert.assertEquals(1, indexed.size()); - Assert.assertNull(indexed.get(0)); - Assert.assertTrue(indexed.isSorted()); // Matches delegate. See class-level note in CombineFirstTwoEntriesIndexed. - Assert.assertEquals(Collections.singletonList(null), Lists.newArrayList(indexed)); - } - - @Test - public void testSizeThreeSorted() - { - final CombineFirstTwoEntriesIndexed indexed = wrap( - GenericIndexed.fromArray( - new String[]{"bar", "baz", "foo"}, - GenericIndexed.STRING_STRATEGY - ), - null - ); - - Assert.assertEquals(0, indexed.indexOf(null)); - Assert.assertEquals(1, indexed.indexOf("foo")); - Assert.assertEquals(-2, indexed.indexOf("bar")); - Assert.assertEquals(-2, indexed.indexOf("baz")); - Assert.assertEquals(-3, indexed.indexOf("qux")); - Assert.assertEquals(-2, indexed.indexOf("")); - Assert.assertEquals(2, indexed.size()); - Assert.assertNull(indexed.get(0)); - Assert.assertEquals("foo", indexed.get(1)); - Assert.assertTrue(indexed.isSorted()); // Matches delegate. See class-level note in CombineFirstTwoEntriesIndexed. - Assert.assertEquals(Lists.newArrayList(null, "foo"), Lists.newArrayList(indexed)); - } - - private CombineFirstTwoEntriesIndexed wrap(final Indexed indexed, @Nullable final T newFirstValue) - { - return new CombineFirstTwoEntriesIndexed<>(indexed) - { - @Override - protected T newFirstValue() - { - return newFirstValue; - } - }; - } -} diff --git a/processing/src/test/java/org/apache/druid/segment/serde/CombineFirstTwoValuesColumnarIntsTest.java b/processing/src/test/java/org/apache/druid/segment/serde/CombineFirstTwoValuesColumnarIntsTest.java deleted file mode 100644 index fee6a8395011..000000000000 --- a/processing/src/test/java/org/apache/druid/segment/serde/CombineFirstTwoValuesColumnarIntsTest.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.druid.segment.serde; - -import org.apache.druid.segment.data.ArrayBasedIndexedInts; -import org.junit.Test; - -/** - * Test for {@link CombineFirstTwoValuesColumnarInts}. - */ -public class CombineFirstTwoValuesColumnarIntsTest -{ - @Test - public void testCombineFirstTwoValues() - { - // (expectedCombined, original) - assertCombine(new int[]{0, 1, 2}, new int[]{1, 2, 3}); - assertCombine(new int[]{0, 0, 1, 2}, new int[]{0, 1, 2, 3}); - assertCombine(new int[]{2, 0, 1, 0, 4, 0}, new int[]{3, 0, 2, 1, 5, 0}); - } - - private static void assertCombine(final int[] expectedCombined, final int[] original) - { - CombineFirstTwoValuesIndexedIntsTest.assertCombine( - expectedCombined, - original, - arr -> new CombineFirstTwoValuesIndexedInts(new ArrayBasedIndexedInts(arr)) - ); - } -} diff --git a/processing/src/test/java/org/apache/druid/segment/serde/CombineFirstTwoValuesColumnarMultiIntsTest.java b/processing/src/test/java/org/apache/druid/segment/serde/CombineFirstTwoValuesColumnarMultiIntsTest.java deleted file mode 100644 index de8edf171bff..000000000000 --- a/processing/src/test/java/org/apache/druid/segment/serde/CombineFirstTwoValuesColumnarMultiIntsTest.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.druid.segment.serde; - -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; -import org.apache.druid.segment.data.ColumnarMultiInts; -import org.apache.druid.segment.data.IndexedInts; -import org.apache.druid.segment.data.VSizeColumnarInts; -import org.apache.druid.segment.data.VSizeColumnarMultiInts; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -import java.util.List; - -/** - * Test for {@link CombineFirstTwoValuesColumnarMultiInts}. - */ -public class CombineFirstTwoValuesColumnarMultiIntsTest -{ - private ColumnarMultiInts original; - private CombineFirstTwoValuesColumnarMultiInts combined; - - @Before - public void setUp() - { - original = VSizeColumnarMultiInts.fromIterable( - ImmutableList.of( - VSizeColumnarInts.fromArray(new int[]{1, 2, 3}), - VSizeColumnarInts.fromArray(new int[]{0, 1, 2, 3}), - VSizeColumnarInts.fromArray(new int[]{3, 0, 2, 1, 5, 0}) - ) - ); - - combined = new CombineFirstTwoValuesColumnarMultiInts(original); - } - - @Test - public void testSize() - { - Assert.assertEquals(original.size(), combined.size()); - } - - @Test - public void testGet() - { - assertEquals(new int[]{0, 1, 2}, combined.get(0)); - assertEquals(new int[]{0, 0, 1, 2}, combined.get(1)); - assertEquals(new int[]{2, 0, 1, 0, 4, 0}, combined.get(2)); - - // "get" reuses a holder - Assert.assertSame(combined.get(1), combined.get(0)); - } - - @Test - public void testGetUnshared() - { - assertEquals(new int[]{0, 1, 2}, combined.getUnshared(0)); - assertEquals(new int[]{0, 0, 1, 2}, combined.getUnshared(1)); - assertEquals(new int[]{2, 0, 1, 0, 4, 0}, combined.getUnshared(2)); - - // Unlike "get", "getUnshared" does not reuse a holder - Assert.assertNotSame(combined.getUnshared(1), combined.getUnshared(0)); - } - - @Test - public void testIndexOf() - { - Assert.assertThrows( - UnsupportedOperationException.class, - () -> combined.indexOf(original.get(0)) - ); - } - - @Test - public void testIsSorted() - { - Assert.assertFalse(combined.isSorted()); - } - - @Test - public void testIterator() - { - final List fromIterator = Lists.newArrayList(combined.iterator()); - Assert.assertEquals(3, fromIterator.size()); - assertEquals(new int[]{0, 1, 2}, fromIterator.get(0)); - assertEquals(new int[]{0, 0, 1, 2}, fromIterator.get(1)); - assertEquals(new int[]{2, 0, 1, 0, 4, 0}, fromIterator.get(2)); - } - - public void assertEquals(final int[] expected, final IndexedInts actual) - { - final int sz = actual.size(); - final int[] actualArray = new int[sz]; - for (int i = 0; i < sz; i++) { - actualArray[i] = actual.get(i); - } - - Assert.assertArrayEquals(expected, actualArray); - } -} diff --git a/processing/src/test/java/org/apache/druid/segment/serde/CombineFirstTwoValuesIndexedIntsTest.java b/processing/src/test/java/org/apache/druid/segment/serde/CombineFirstTwoValuesIndexedIntsTest.java deleted file mode 100644 index 26a444735993..000000000000 --- a/processing/src/test/java/org/apache/druid/segment/serde/CombineFirstTwoValuesIndexedIntsTest.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.druid.segment.serde; - -import it.unimi.dsi.fastutil.ints.IntArrays; -import org.apache.druid.java.util.common.StringUtils; -import org.apache.druid.segment.data.ArrayBasedIndexedInts; -import org.apache.druid.segment.data.IndexedInts; -import org.junit.Assert; -import org.junit.Test; - -import java.util.Arrays; -import java.util.function.Function; - -/** - * Test for {@link CombineFirstTwoValuesIndexedInts}. - */ -public class CombineFirstTwoValuesIndexedIntsTest -{ - @Test - public void testCombineFirstTwoValues() - { - // (expectedCombined, original) - assertCombine(new int[]{0, 1, 2}, new int[]{1, 2, 3}); - assertCombine(new int[]{0, 0, 1, 2}, new int[]{0, 1, 2, 3}); - assertCombine(new int[]{2, 0, 1, 0, 4, 0}, new int[]{3, 0, 2, 1, 5, 0}); - } - - private static void assertCombine(final int[] expectedCombined, final int[] original) - { - assertCombine( - expectedCombined, - original, - arr -> new CombineFirstTwoValuesIndexedInts(new ArrayBasedIndexedInts(arr)) - ); - } - - static void assertCombine( - final int[] expectedCombined, - final int[] original, - final Function combineFn - ) - { - final IndexedInts combined = combineFn.apply(original); - - // Check size. - Assert.assertEquals( - StringUtils.format("%s (size)", Arrays.toString(original)), - expectedCombined.length, - combined.size() - ); - - // Check regular get. - final int[] arr = new int[expectedCombined.length]; - for (int i = 0; i < expectedCombined.length; i++) { - arr[i] = combined.get(i); - } - Assert.assertArrayEquals(StringUtils.format("%s (get)", Arrays.toString(original)), expectedCombined, arr); - - // Check contiguous vector get. - Arrays.fill(arr, Integer.MIN_VALUE); - combined.get(arr, 0, arr.length); - Assert.assertArrayEquals( - StringUtils.format("%s (contiguous vector get)", Arrays.toString(original)), - expectedCombined, - arr - ); - - // Check noncontiguous vector get. - final int[] indexes = new int[expectedCombined.length]; - for (int i = 0; i < expectedCombined.length; i++) { - indexes[indexes.length - 1 - i] = i; // Fetch backwards. - } - - Arrays.fill(arr, Integer.MIN_VALUE); - combined.get(arr, indexes, arr.length); - final int[] expectedCombinedReversed = IntArrays.reverse(IntArrays.copy(expectedCombined)); - Assert.assertArrayEquals( - StringUtils.format("%s (noncontiguous vector get, reversed)", Arrays.toString(original)), - expectedCombinedReversed, - arr - ); - } -} diff --git a/processing/src/test/java/org/apache/druid/segment/serde/NullColumnPartSerdeTest.java b/processing/src/test/java/org/apache/druid/segment/serde/NullColumnPartSerdeTest.java index 30aa6468dd7c..a2b8c37effc2 100644 --- a/processing/src/test/java/org/apache/druid/segment/serde/NullColumnPartSerdeTest.java +++ b/processing/src/test/java/org/apache/druid/segment/serde/NullColumnPartSerdeTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.segment.ColumnValueSelector; import org.apache.druid.segment.DimensionSelector; @@ -159,11 +158,7 @@ public void testColumnValueSelector() ReadableOffset offset = new SimpleAscendingOffset(10); ColumnValueSelector valueSelector = theColumn.makeColumnValueSelector(offset); - if (NullHandling.sqlCompatible()) { - Assert.assertTrue(valueSelector.isNull()); - } else { - Assert.assertFalse(valueSelector.isNull()); - } + Assert.assertTrue(valueSelector.isNull()); Assert.assertEquals(0.0, valueSelector.getDouble(), 0.0); } @@ -183,11 +178,7 @@ public void testVectorValueSelector() boolean[] nulls = selector.getNullVector(); for (int i = 0; i < vectorOffset.getCurrentVectorSize(); i++) { Assert.assertEquals(0.0, vector[i], 0.0); - if (NullHandling.sqlCompatible()) { - Assert.assertTrue(nulls[i]); - } else { - Assert.assertFalse(nulls[i]); - } + Assert.assertTrue(nulls[i]); } } diff --git a/processing/src/test/java/org/apache/druid/segment/serde/ReplaceFirstValueWithNullIndexedTest.java b/processing/src/test/java/org/apache/druid/segment/serde/ReplaceFirstValueWithNullIndexedTest.java deleted file mode 100644 index cc01ac6589dc..000000000000 --- a/processing/src/test/java/org/apache/druid/segment/serde/ReplaceFirstValueWithNullIndexedTest.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.druid.segment.serde; - -import com.google.common.collect.Lists; -import org.apache.druid.segment.data.GenericIndexed; -import org.apache.druid.segment.data.Indexed; -import org.apache.druid.segment.data.ListIndexed; -import org.apache.druid.testing.InitializedNullHandlingTest; -import org.hamcrest.CoreMatchers; -import org.hamcrest.MatcherAssert; -import org.junit.Assert; -import org.junit.Test; -import org.junit.internal.matchers.ThrowableMessageMatcher; - -import java.util.Collections; - -/** - * Test for {@link ReplaceFirstValueWithNullIndexed}. - */ -public class ReplaceFirstValueWithNullIndexedTest extends InitializedNullHandlingTest -{ - @Test - public void testSizeZero() - { - final IllegalStateException e = Assert.assertThrows( - IllegalStateException.class, - () -> new ReplaceFirstValueWithNullIndexed<>(Indexed.empty()) - ); - - MatcherAssert.assertThat( - e, - ThrowableMessageMatcher.hasMessage(CoreMatchers.containsString("Size[0] must be >= 1")) - ); - } - - @Test - public void testSizeOne() - { - final ReplaceFirstValueWithNullIndexed indexed = - new ReplaceFirstValueWithNullIndexed<>(new ListIndexed<>("bar")); - - Assert.assertEquals(0, indexed.indexOf(null)); - Assert.assertEquals(-2, indexed.indexOf("")); - Assert.assertEquals(-2, indexed.indexOf("foo")); - Assert.assertEquals(-2, indexed.indexOf("bar")); - Assert.assertEquals(-2, indexed.indexOf("baz")); - Assert.assertEquals(-2, indexed.indexOf("qux")); - Assert.assertEquals(1, indexed.size()); - Assert.assertNull(indexed.get(0)); - Assert.assertFalse(indexed.isSorted()); // Matches delegate. See class doc for ReplaceFirstValueWithNullIndexed. - Assert.assertEquals(Collections.singletonList(null), Lists.newArrayList(indexed)); - } - - @Test - public void testSizeTwo() - { - final ReplaceFirstValueWithNullIndexed indexed = - new ReplaceFirstValueWithNullIndexed<>(new ListIndexed<>("bar", "foo")); - - Assert.assertEquals(0, indexed.indexOf(null)); - Assert.assertEquals(1, indexed.indexOf("foo")); - Assert.assertEquals(-2, indexed.indexOf("")); - Assert.assertEquals(-2, indexed.indexOf("bar")); - Assert.assertEquals(-2, indexed.indexOf("baz")); - Assert.assertEquals(-2, indexed.indexOf("qux")); - Assert.assertEquals(2, indexed.size()); - Assert.assertNull(indexed.get(0)); - Assert.assertEquals("foo", indexed.get(1)); - Assert.assertFalse(indexed.isSorted()); // Matches delegate. See class doc for ReplaceFirstValueWithNullIndexed. - Assert.assertEquals(Lists.newArrayList(null, "foo"), Lists.newArrayList(indexed)); - } - - @Test - public void testSizeOneSorted() - { - final ReplaceFirstValueWithNullIndexed indexed = - new ReplaceFirstValueWithNullIndexed<>( - GenericIndexed.fromArray( - new String[]{"bar"}, - GenericIndexed.STRING_STRATEGY - ) - ); - - Assert.assertEquals(0, indexed.indexOf(null)); - Assert.assertEquals(-2, indexed.indexOf("")); - Assert.assertEquals(-2, indexed.indexOf("foo")); - Assert.assertEquals(-2, indexed.indexOf("bar")); - Assert.assertEquals(-2, indexed.indexOf("baz")); - Assert.assertEquals(-2, indexed.indexOf("qux")); - Assert.assertEquals(1, indexed.size()); - Assert.assertNull(indexed.get(0)); - Assert.assertTrue(indexed.isSorted()); // Matches delegate. See class doc for ReplaceFirstValueWithNullIndexed. - Assert.assertEquals(Collections.singletonList(null), Lists.newArrayList(indexed)); - } - - @Test - public void testSizeTwoSorted() - { - final ReplaceFirstValueWithNullIndexed indexed = - new ReplaceFirstValueWithNullIndexed<>( - GenericIndexed.fromArray( - new String[]{"bar", "foo"}, - GenericIndexed.STRING_STRATEGY - ) - ); - - Assert.assertEquals(0, indexed.indexOf(null)); - Assert.assertEquals(1, indexed.indexOf("foo")); - Assert.assertEquals(-2, indexed.indexOf("")); - Assert.assertEquals(-2, indexed.indexOf("bar")); - Assert.assertEquals(-2, indexed.indexOf("baz")); - Assert.assertEquals(-3, indexed.indexOf("qux")); - Assert.assertEquals(2, indexed.size()); - Assert.assertNull(indexed.get(0)); - Assert.assertEquals("foo", indexed.get(1)); - Assert.assertTrue(indexed.isSorted()); // Matches delegate. See class doc for ReplaceFirstValueWithNullIndexed. - Assert.assertEquals(Lists.newArrayList(null, "foo"), Lists.newArrayList(indexed)); - } -} diff --git a/processing/src/test/java/org/apache/druid/segment/transform/TransformerTest.java b/processing/src/test/java/org/apache/druid/segment/transform/TransformerTest.java index 0c33b3c2d1db..7375b927a531 100644 --- a/processing/src/test/java/org/apache/druid/segment/transform/TransformerTest.java +++ b/processing/src/test/java/org/apache/druid/segment/transform/TransformerTest.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.data.input.InputRowListPlusRawValues; import org.apache.druid.data.input.MapBasedInputRow; @@ -97,15 +96,9 @@ public void testTransformTimeColumnWithInvalidTimeValue() ImmutableList.of("ts", "dim"), ImmutableMap.of("ts", "not_a_timestamp", "dim", false) ); - if (NullHandling.replaceWithDefault()) { - final InputRow actual = transformer.transform(row); - Assert.assertNotNull(actual); - Assert.assertEquals(DateTimes.of("1970-01-01T00:00:00.000Z"), actual.getTimestamp()); - } else { - expectedException.expectMessage("Could not transform value for __time."); - expectedException.expect(ParseException.class); - transformer.transform(row); - } + expectedException.expectMessage("Could not transform value for __time."); + expectedException.expect(ParseException.class); + transformer.transform(row); } @Test @@ -133,13 +126,8 @@ public void testTransformTimeColumnWithInvalidTimeValueInputRowListPlusRawValues ); Assert.assertNotNull(actual); Assert.assertEquals(1, actual.getRawValuesList().size()); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(1, actual.getInputRows().size()); - Assert.assertEquals(DateTimes.of("1970-01-01T00:00:00.000Z"), actual.getInputRows().get(0).getTimestamp()); - } else { - Assert.assertNull(actual.getInputRows()); - Assert.assertEquals("Could not transform value for __time.", actual.getParseException().getMessage()); - } + Assert.assertNull(actual.getInputRows()); + Assert.assertEquals("Could not transform value for __time.", actual.getParseException().getMessage()); } @Test diff --git a/processing/src/test/java/org/apache/druid/segment/vector/NilVectorSelectorTest.java b/processing/src/test/java/org/apache/druid/segment/vector/NilVectorSelectorTest.java index 704ef9bf11aa..3c8e11bdd586 100644 --- a/processing/src/test/java/org/apache/druid/segment/vector/NilVectorSelectorTest.java +++ b/processing/src/test/java/org/apache/druid/segment/vector/NilVectorSelectorTest.java @@ -20,7 +20,6 @@ package org.apache.druid.segment.vector; import org.apache.druid.collections.bitmap.WrappedRoaringBitmap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.QueryContexts; import org.apache.druid.testing.InitializedNullHandlingTest; import org.junit.Assert; @@ -76,7 +75,7 @@ private static void testOffset(VectorOffset offset) Assert.assertEquals(0L, longs[i]); Assert.assertEquals(0.0, doubles[i], 0.0); Assert.assertEquals(0f, floats[i], 0.0); - Assert.assertEquals(NullHandling.sqlCompatible(), nulls[i]); + Assert.assertTrue(nulls[i]); Assert.assertNull(objects[i]); } offset.advance(); diff --git a/processing/src/test/java/org/apache/druid/segment/virtual/ExpressionPlannerTest.java b/processing/src/test/java/org/apache/druid/segment/virtual/ExpressionPlannerTest.java index 3dddbd991c32..a62df2ce8079 100644 --- a/processing/src/test/java/org/apache/druid/segment/virtual/ExpressionPlannerTest.java +++ b/processing/src/test/java/org/apache/druid/segment/virtual/ExpressionPlannerTest.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; import org.apache.druid.math.expr.Expr; import org.apache.druid.math.expr.ExprEval; @@ -344,11 +343,7 @@ public void testScalarNumeric() ColumnCapabilities inferred = thePlan.inferColumnCapabilities(null); Assert.assertNotNull(inferred); Assert.assertEquals(ValueType.LONG, inferred.getType()); - if (NullHandling.sqlCompatible()) { - Assert.assertTrue(inferred.hasNulls().isMaybeTrue()); - } else { - Assert.assertFalse(inferred.hasNulls().isMaybeTrue()); - } + Assert.assertTrue(inferred.hasNulls().isMaybeTrue()); Assert.assertFalse(inferred.isDictionaryEncoded().isMaybeTrue()); Assert.assertFalse(inferred.areDictionaryValuesSorted().isMaybeTrue()); Assert.assertFalse(inferred.areDictionaryValuesUnique().isMaybeTrue()); @@ -383,11 +378,7 @@ public void testScalarNumeric() inferred = thePlan.inferColumnCapabilities(null); Assert.assertNotNull(inferred); Assert.assertEquals(ValueType.DOUBLE, inferred.getType()); - if (NullHandling.sqlCompatible()) { - Assert.assertTrue(inferred.hasNulls().isMaybeTrue()); - } else { - Assert.assertFalse(inferred.hasNulls().isMaybeTrue()); - } + Assert.assertTrue(inferred.hasNulls().isMaybeTrue()); Assert.assertFalse(inferred.isDictionaryEncoded().isMaybeTrue()); Assert.assertFalse(inferred.areDictionaryValuesSorted().isMaybeTrue()); Assert.assertFalse(inferred.areDictionaryValuesUnique().isMaybeTrue()); diff --git a/processing/src/test/java/org/apache/druid/segment/virtual/ExpressionSelectorsTest.java b/processing/src/test/java/org/apache/druid/segment/virtual/ExpressionSelectorsTest.java index fe0d8c6f75a9..2ed144e5552d 100644 --- a/processing/src/test/java/org/apache/druid/segment/virtual/ExpressionSelectorsTest.java +++ b/processing/src/test/java/org/apache/druid/segment/virtual/ExpressionSelectorsTest.java @@ -22,7 +22,6 @@ import com.google.common.base.Supplier; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.guava.SettableSupplier; import org.apache.druid.data.input.MapBasedInputRow; import org.apache.druid.data.input.impl.TimestampSpec; @@ -656,12 +655,11 @@ public void test_incrementalIndexStringSelector() throws IndexSizeExceededExcept Object x = xExprSelector.getObject(); Object y = yExprSelector.getObject(); String expectedFoo = "foofoo"; - String expectedNull = NullHandling.replaceWithDefault() ? "foo" : null; if (rowCount == 0) { Assert.assertEquals(expectedFoo, x); - Assert.assertEquals(expectedNull, y); + Assert.assertNull(y); } else { - Assert.assertEquals(expectedNull, x); + Assert.assertNull(x); Assert.assertEquals(expectedFoo, y); } rowCount++; diff --git a/processing/src/test/java/org/apache/druid/segment/virtual/ExpressionVirtualColumnTest.java b/processing/src/test/java/org/apache/druid/segment/virtual/ExpressionVirtualColumnTest.java index 16e22c010806..430673a0574c 100644 --- a/processing/src/test/java/org/apache/druid/segment/virtual/ExpressionVirtualColumnTest.java +++ b/processing/src/test/java/org/apache/druid/segment/virtual/ExpressionVirtualColumnTest.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.data.input.MapBasedInputRow; import org.apache.druid.data.input.Row; @@ -220,12 +219,8 @@ public void testObjectSelector() Assert.assertEquals(null, selector.getObject()); CURRENT_ROW.set(ROW1); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(4L, selector.getObject()); - } else { - // y is null for row1 - Assert.assertEquals(null, selector.getObject()); - } + // y is null for row1 + Assert.assertEquals(null, selector.getObject()); CURRENT_ROW.set(ROW2); Assert.assertEquals(5.1d, selector.getObject()); @@ -249,7 +244,7 @@ public void testMultiObjectSelector() Assert.assertEquals(ImmutableList.of("6.0", "8.0", "10.0"), selectorImplicit.getObject()); CURRENT_ROW.set(ROWMULTI3); Assert.assertEquals( - Arrays.asList("6.0", NullHandling.replaceWithDefault() ? "0.0" : null, "10.0"), + Arrays.asList("6.0", null, "10.0"), selectorImplicit.getObject() ); @@ -263,7 +258,7 @@ public void testMultiObjectSelector() Assert.assertEquals(ImmutableList.of("6.0", "8.0", "10.0"), selectorExplicit.getObject()); CURRENT_ROW.set(ROWMULTI3); Assert.assertEquals( - Arrays.asList("6.0", NullHandling.replaceWithDefault() ? "0.0" : null, "10.0"), + Arrays.asList("6.0", null, "10.0"), selectorExplicit.getObject() ); } @@ -380,19 +375,11 @@ public void testLongSelector() final BaseLongColumnValueSelector selector = X_PLUS_Y.makeColumnValueSelector("expr", COLUMN_SELECTOR_FACTORY); CURRENT_ROW.set(ROW0); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(0L, selector.getLong()); - } else { - Assert.assertTrue(selector.isNull()); - } + Assert.assertTrue(selector.isNull()); CURRENT_ROW.set(ROW1); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(4L, selector.getLong()); - } else { - // y is null for row1 - Assert.assertTrue(selector.isNull()); - } + // y is null for row1 + Assert.assertTrue(selector.isNull()); CURRENT_ROW.set(ROW2); Assert.assertEquals(5L, selector.getLong()); @@ -407,33 +394,17 @@ public void testLongSelectorUsingStringFunction() final BaseLongColumnValueSelector selector = Z_CONCAT_X.makeColumnValueSelector("expr", COLUMN_SELECTOR_FACTORY); CURRENT_ROW.set(ROW0); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(0L, selector.getLong()); - } else { - Assert.assertTrue(selector.isNull()); - } + Assert.assertTrue(selector.isNull()); CURRENT_ROW.set(ROW1); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(4L, selector.getLong()); - } else { - // y is null for row1 - Assert.assertTrue(selector.isNull()); - } + // y is null for row1 + Assert.assertTrue(selector.isNull()); CURRENT_ROW.set(ROW2); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(0L, selector.getLong()); - } else { - Assert.assertTrue(selector.isNull()); - } + Assert.assertTrue(selector.isNull()); CURRENT_ROW.set(ROW3); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(0L, selector.getLong()); - } else { - Assert.assertTrue(selector.isNull()); - } + Assert.assertTrue(selector.isNull()); } @Test @@ -442,19 +413,11 @@ public void testFloatSelector() final BaseFloatColumnValueSelector selector = X_PLUS_Y.makeColumnValueSelector("expr", COLUMN_SELECTOR_FACTORY); CURRENT_ROW.set(ROW0); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(0.0f, selector.getFloat(), 0.0f); - } else { - Assert.assertTrue(selector.isNull()); - } + Assert.assertTrue(selector.isNull()); CURRENT_ROW.set(ROW1); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(4.0f, selector.getFloat(), 0.0f); - } else { - // y is null for row1 - Assert.assertTrue(selector.isNull()); - } + // y is null for row1 + Assert.assertTrue(selector.isNull()); CURRENT_ROW.set(ROW2); Assert.assertEquals(5.1f, selector.getFloat(), 0.0f); @@ -486,18 +449,11 @@ public void testDimensionSelector() Assert.assertEquals(null, selector.lookupName(selector.getRow().get(0))); CURRENT_ROW.set(ROW1); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(false, nullMatcher.matches(false)); - Assert.assertEquals(false, fiveMatcher.matches(false)); - Assert.assertEquals(true, nonNullMatcher.matches(false)); - Assert.assertEquals("4", selector.lookupName(selector.getRow().get(0))); - } else { - // y is null in row1 - Assert.assertEquals(true, nullMatcher.matches(false)); - Assert.assertEquals(false, fiveMatcher.matches(false)); - Assert.assertEquals(false, nonNullMatcher.matches(false)); - Assert.assertEquals(null, selector.lookupName(selector.getRow().get(0))); - } + // y is null in row1 + Assert.assertEquals(true, nullMatcher.matches(false)); + Assert.assertEquals(false, fiveMatcher.matches(false)); + Assert.assertEquals(false, nonNullMatcher.matches(false)); + Assert.assertEquals(null, selector.lookupName(selector.getRow().get(0))); CURRENT_ROW.set(ROW2); Assert.assertEquals(false, nullMatcher.matches(false)); @@ -549,7 +505,7 @@ public void testDimensionSelectorUsingStringFunction() CURRENT_ROW.set(ROW1); Assert.assertEquals(1, selector.getRow().size()); Assert.assertEquals( - NullHandling.replaceWithDefault() ? "4" : null, + null, selector.lookupName(selector.getRow().get(0)) ); @@ -583,14 +539,14 @@ public void testDimensionSelectorUsingNonexistentColumn() CURRENT_ROW.set(ROW2); Assert.assertEquals(1, selector.getRow().size()); Assert.assertEquals( - NullHandling.replaceWithDefault() ? "foobar" : null, + null, selector.lookupName(selector.getRow().get(0)) ); CURRENT_ROW.set(ROW3); Assert.assertEquals(1, selector.getRow().size()); Assert.assertEquals( - NullHandling.replaceWithDefault() ? "foobar" : null, + null, selector.lookupName(selector.getRow().get(0)) ); } @@ -618,18 +574,11 @@ public void testDimensionSelectorWithExtraction() Assert.assertEquals(null, selector.lookupName(selector.getRow().get(0))); CURRENT_ROW.set(ROW1); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(false, nullMatcher.matches(false)); - Assert.assertEquals(false, fiveMatcher.matches(false)); - Assert.assertEquals(true, nonNullMatcher.matches(false)); - Assert.assertEquals("4", selector.lookupName(selector.getRow().get(0))); - } else { - // y is null in row1 - Assert.assertEquals(true, nullMatcher.matches(false)); - Assert.assertEquals(false, fiveMatcher.matches(false)); - Assert.assertEquals(false, nonNullMatcher.matches(false)); - Assert.assertEquals(null, selector.lookupName(selector.getRow().get(0))); - } + // y is null in row1 + Assert.assertEquals(true, nullMatcher.matches(false)); + Assert.assertEquals(false, fiveMatcher.matches(false)); + Assert.assertEquals(false, nonNullMatcher.matches(false)); + Assert.assertEquals(null, selector.lookupName(selector.getRow().get(0))); CURRENT_ROW.set(ROW2); Assert.assertEquals(false, nullMatcher.matches(false)); @@ -661,12 +610,7 @@ public void testLongSelectorWithConstantNullArithmetic() CONSTANT_NULL_ARITHMETIC.makeColumnValueSelector("expr", COLUMN_SELECTOR_FACTORY); CURRENT_ROW.set(ROW0); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(2L, selector.getLong()); - Assert.assertFalse(selector.isNull()); - } else { - Assert.assertTrue(selector.isNull()); - } + Assert.assertTrue(selector.isNull()); } @Test @@ -676,12 +620,7 @@ public void testFloatSelectorWithConstantNullArithmetic() CONSTANT_NULL_ARITHMETIC.makeColumnValueSelector("expr", COLUMN_SELECTOR_FACTORY); CURRENT_ROW.set(ROW0); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(2.1f, selector.getFloat(), 0.0f); - Assert.assertFalse(selector.isNull()); - } else { - Assert.assertTrue(selector.isNull()); - } + Assert.assertTrue(selector.isNull()); } @Test @@ -693,14 +632,8 @@ public void testExprEvalSelectorWithConstantNullArithmetic() ); CURRENT_ROW.set(ROW0); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(2.1f, selector.getFloat(), 0.0f); - Assert.assertFalse(selector.isNull()); - Assert.assertEquals(2.1d, selector.getObject().asDouble(), 0.0d); - } else { - Assert.assertTrue(selector.isNull()); - Assert.assertTrue(selector.getObject().isNumericNull()); - } + Assert.assertTrue(selector.isNull()); + Assert.assertTrue(selector.getObject().isNumericNull()); } @Test @@ -767,13 +700,8 @@ public void testExprEvalSelectorWithLongsAndNulls() ); CURRENT_ROW.set(ROW0); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(0, selector.getLong(), 0.0f); - Assert.assertFalse(selector.isNull()); - } else { - Assert.assertTrue(selector.isNull()); - Assert.assertTrue(selector.getObject().isNumericNull()); - } + Assert.assertTrue(selector.isNull()); + Assert.assertTrue(selector.getObject().isNumericNull()); } @Test @@ -791,13 +719,8 @@ public void testExprEvalSelectorWithDoublesAndNulls() ); CURRENT_ROW.set(ROW0); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(0, selector.getDouble(), 0.0f); - Assert.assertFalse(selector.isNull()); - } else { - Assert.assertTrue(selector.isNull()); - Assert.assertTrue(selector.getObject().isNumericNull()); - } + Assert.assertTrue(selector.isNull()); + Assert.assertTrue(selector.getObject().isNumericNull()); } @Test @@ -815,13 +738,8 @@ public void testExprEvalSelectorWithFloatAndNulls() ); CURRENT_ROW.set(ROW0); - if (NullHandling.replaceWithDefault()) { - Assert.assertEquals(0, selector.getFloat(), 0.0f); - Assert.assertFalse(selector.isNull()); - } else { - Assert.assertTrue(selector.isNull()); - Assert.assertTrue(selector.getObject().isNumericNull()); - } + Assert.assertTrue(selector.isNull()); + Assert.assertTrue(selector.getObject().isNumericNull()); } @Test diff --git a/processing/src/test/java/org/apache/druid/segment/virtual/FallbackVirtualColumnTest.java b/processing/src/test/java/org/apache/druid/segment/virtual/FallbackVirtualColumnTest.java index 9a04b906e91d..9e3345143c9f 100644 --- a/processing/src/test/java/org/apache/druid/segment/virtual/FallbackVirtualColumnTest.java +++ b/processing/src/test/java/org/apache/druid/segment/virtual/FallbackVirtualColumnTest.java @@ -20,7 +20,6 @@ package org.apache.druid.segment.virtual; import org.apache.druid.collections.bitmap.RoaringBitmapFactory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.cache.CacheKeyBuilder; import org.apache.druid.query.dimension.DefaultDimensionSpec; import org.apache.druid.query.dimension.DimensionSpec; @@ -55,10 +54,6 @@ @SuppressWarnings("ALL") public class FallbackVirtualColumnTest { - static { - NullHandling.initializeForTests(); - } - @Test public void testGetOutputName() { diff --git a/processing/src/test/java/org/apache/druid/testing/InitializedNullHandlingTest.java b/processing/src/test/java/org/apache/druid/testing/InitializedNullHandlingTest.java index b0334757001a..2b8da4673d48 100644 --- a/processing/src/test/java/org/apache/druid/testing/InitializedNullHandlingTest.java +++ b/processing/src/test/java/org/apache/druid/testing/InitializedNullHandlingTest.java @@ -19,13 +19,11 @@ package org.apache.druid.testing; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.math.expr.ExpressionProcessing; public class InitializedNullHandlingTest { static { - NullHandling.initializeForTests(); ExpressionProcessing.initializeForTests(); } } diff --git a/quidem-ut/src/test/java/org/apache/druid/quidem/KttmNestedComponentSupplierTest.java b/quidem-ut/src/test/java/org/apache/druid/quidem/KttmNestedComponentSupplierTest.java deleted file mode 100644 index a874d3f60b53..000000000000 --- a/quidem-ut/src/test/java/org/apache/druid/quidem/KttmNestedComponentSupplierTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.druid.quidem; - -import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; -import org.apache.druid.sql.calcite.BaseCalciteQueryTest; -import org.apache.druid.sql.calcite.SqlTestFrameworkConfig.ComponentSupplier; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.EnabledIf; - -@EnabledIf(value = "isReplaceWithDefault", disabledReason = "Needed to provide coverage in defaults mode") -@ComponentSupplier(KttmNestedComponentSupplier.class) -public class KttmNestedComponentSupplierTest extends BaseCalciteQueryTest -{ - static { - NullHandling.initializeForTests(); - } - - public static boolean isReplaceWithDefault() - { - return NullHandling.replaceWithDefault(); - } - - @Test - public void testDataset() - { - msqIncompatible(); - testBuilder() - .sql("SELECT count(1),sum(session_length) from kttm_nested") - .expectedResults(ImmutableList.of(new Object[] {465346L, 153573448620L})) - .run(); - } -} diff --git a/server/src/test/java/org/apache/druid/client/DirectDruidClientTest.java b/server/src/test/java/org/apache/druid/client/DirectDruidClientTest.java index 522d8b039021..1bdcec158268 100644 --- a/server/src/test/java/org/apache/druid/client/DirectDruidClientTest.java +++ b/server/src/test/java/org/apache/druid/client/DirectDruidClientTest.java @@ -28,7 +28,6 @@ import org.apache.druid.client.selector.ConnectionCountServerSelectorStrategy; import org.apache.druid.client.selector.HighestPriorityTierSelectorStrategy; import org.apache.druid.client.selector.ServerSelector; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.Intervals; @@ -104,7 +103,6 @@ public class DirectDruidClientTest @Before public void setup() { - NullHandling.initializeForTests(); httpClient = EasyMock.createMock(HttpClient.class); serverSelector = new ServerSelector( dataSegment, diff --git a/server/src/test/java/org/apache/druid/client/indexing/ClientCompactionTaskTransformSpecTest.java b/server/src/test/java/org/apache/druid/client/indexing/ClientCompactionTaskTransformSpecTest.java index 750ad82a348d..77593a8d1a6b 100644 --- a/server/src/test/java/org/apache/druid/client/indexing/ClientCompactionTaskTransformSpecTest.java +++ b/server/src/test/java/org/apache/druid/client/indexing/ClientCompactionTaskTransformSpecTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import nl.jqno.equalsverifier.EqualsVerifier; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.query.filter.SelectorDimFilter; import org.junit.Assert; @@ -44,7 +43,6 @@ public void testEquals() @Test public void testSerde() throws IOException { - NullHandling.initializeForTests(); final ClientCompactionTaskTransformSpec expected = new ClientCompactionTaskTransformSpec( new SelectorDimFilter("dim1", "foo", null) ); @@ -61,7 +59,6 @@ public void testSerde() throws IOException @Test public void testAsMap() { - NullHandling.initializeForTests(); final ObjectMapper objectMapper = new DefaultObjectMapper(); String dimension = "dim1"; String value = "foo"; diff --git a/server/src/test/java/org/apache/druid/query/dimension/LookupDimensionSpecTest.java b/server/src/test/java/org/apache/druid/query/dimension/LookupDimensionSpecTest.java index dd9fd34a2a30..f4d62f90d7dd 100644 --- a/server/src/test/java/org/apache/druid/query/dimension/LookupDimensionSpecTest.java +++ b/server/src/test/java/org/apache/druid/query/dimension/LookupDimensionSpecTest.java @@ -25,7 +25,6 @@ import com.google.common.collect.ImmutableMap; import junitparams.JUnitParamsRunner; import junitparams.Parameters; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.query.extraction.ExtractionFn; import org.apache.druid.query.extraction.MapLookupExtractor; @@ -179,7 +178,7 @@ public void testApply(DimensionSpec dimensionSpec, Map map) { for (Map.Entry entry : map.entrySet()) { Assert.assertEquals( - NullHandling.emptyToNullIfNeeded(entry.getValue()), + entry.getValue(), dimensionSpec.getExtractionFn().apply(entry.getKey()) ); } diff --git a/server/src/test/java/org/apache/druid/segment/metadata/FingerprintGeneratorTest.java b/server/src/test/java/org/apache/druid/segment/metadata/FingerprintGeneratorTest.java index c0100ffe1513..6637e524b6ee 100644 --- a/server/src/test/java/org/apache/druid/segment/metadata/FingerprintGeneratorTest.java +++ b/server/src/test/java/org/apache/druid/segment/metadata/FingerprintGeneratorTest.java @@ -20,7 +20,6 @@ package org.apache.druid.segment.metadata; import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.aggregation.AggregatorFactory; import org.apache.druid.query.aggregation.any.StringAnyAggregatorFactory; import org.apache.druid.query.aggregation.firstlast.first.LongFirstAggregatorFactory; @@ -38,10 +37,6 @@ public class FingerprintGeneratorTest { - static { - NullHandling.initializeForTests(); - } - private final ObjectMapper mapper = TestHelper.makeJsonMapper(); private final FingerprintGenerator fingerprintGenerator = new FingerprintGenerator(mapper); diff --git a/server/src/test/java/org/apache/druid/segment/metadata/SegmentSchemaBackFillQueueTest.java b/server/src/test/java/org/apache/druid/segment/metadata/SegmentSchemaBackFillQueueTest.java index 2229525c30a1..4a92c157ec71 100644 --- a/server/src/test/java/org/apache/druid/segment/metadata/SegmentSchemaBackFillQueueTest.java +++ b/server/src/test/java/org/apache/druid/segment/metadata/SegmentSchemaBackFillQueueTest.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.Pair; import org.apache.druid.java.util.common.concurrent.ScheduledExecutors; @@ -50,10 +49,6 @@ public class SegmentSchemaBackFillQueueTest { - static { - NullHandling.initializeForTests(); - } - @Rule public final TestDerbyConnector.DerbyConnectorRule derbyConnectorRule = new TestDerbyConnector.DerbyConnectorRule(getEnabledConfig()); diff --git a/server/src/test/java/org/apache/druid/segment/metadata/SegmentSchemaManagerTest.java b/server/src/test/java/org/apache/druid/segment/metadata/SegmentSchemaManagerTest.java index ed6a567644d4..c0e5c6efdb58 100644 --- a/server/src/test/java/org/apache/druid/segment/metadata/SegmentSchemaManagerTest.java +++ b/server/src/test/java/org/apache/druid/segment/metadata/SegmentSchemaManagerTest.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.Pair; import org.apache.druid.metadata.MetadataStorageTablesConfig; @@ -51,10 +50,6 @@ public class SegmentSchemaManagerTest { - static { - NullHandling.initializeForTests(); - } - @Rule public final TestDerbyConnector.DerbyConnectorRule derbyConnectorRule = new TestDerbyConnector.DerbyConnectorRule(CentralizedDatasourceSchemaConfig.create(true)); diff --git a/server/src/test/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderatorDriverTest.java b/server/src/test/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderatorDriverTest.java index ed63bca31956..085958c5f9fb 100644 --- a/server/src/test/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderatorDriverTest.java +++ b/server/src/test/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderatorDriverTest.java @@ -22,7 +22,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.data.input.MapBasedInputRow; import org.apache.druid.indexing.overlord.SegmentPublishResult; @@ -82,10 +81,6 @@ public class BatchAppenderatorDriverTest extends EasyMockSupport private BatchAppenderatorDriver driver; private DataSegmentKiller dataSegmentKiller; - static { - NullHandling.initializeForTests(); - } - @Before public void setup() { diff --git a/server/src/test/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderatorTest.java b/server/src/test/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderatorTest.java index 8b9117705f52..85bb173bce24 100644 --- a/server/src/test/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderatorTest.java +++ b/server/src/test/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderatorTest.java @@ -23,7 +23,6 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.google.common.util.concurrent.ListenableFuture; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.data.input.MapBasedInputRow; import org.apache.druid.java.util.common.DateTimes; @@ -297,7 +296,7 @@ public void testMaxBytesInMemoryWithSkipBytesInMemoryOverheadCheckConfig() throw //expectedSizeInBytes = // 44(map overhead) + 28 (TimeAndDims overhead) + 56 (aggregator metrics) + 54 (dimsKeySize) = // 182 + 1 byte when null handling is enabled - int nullHandlingOverhead = NullHandling.sqlCompatible() ? 1 : 0; + int nullHandlingOverhead = 1; Assert.assertEquals( 182 + nullHandlingOverhead, ((BatchAppenderator) appenderator).getBytesInMemory(IDENTIFIERS.get(0)) @@ -330,7 +329,7 @@ public void testMaxBytesInMemoryInMultipleSinksWithSkipBytesInMemoryOverheadChec appenderator.startJob(); appenderator.add(IDENTIFIERS.get(0), createInputRow("2000", "foo", 1), null); //expectedSizeInBytes = 44(map overhead) + 28 (TimeAndDims overhead) + 56 (aggregator metrics) + 54 (dimsKeySize) = 182 - int nullHandlingOverhead = NullHandling.sqlCompatible() ? 1 : 0; + int nullHandlingOverhead = 1; Assert.assertEquals(182 + nullHandlingOverhead, ((BatchAppenderator) appenderator).getBytesCurrentlyInMemory()); appenderator.add(IDENTIFIERS.get(1), createInputRow("2000", "bar", 1), null); Assert.assertEquals( @@ -353,7 +352,7 @@ public void testMaxBytesInMemory() throws Exception appenderator.add(IDENTIFIERS.get(0), createInputRow("2000", "foo", 1), null); // Still under maxSizeInBytes after the add. Hence, we do not persist yet //expectedSizeInBytes = 44(map overhead) + 28 (TimeAndDims overhead) + 56 (aggregator metrics) + 54 (dimsKeySize) = 182 + 1 byte when null handling is enabled - int nullHandlingOverhead = NullHandling.sqlCompatible() ? 1 : 0; + int nullHandlingOverhead = 1; int currentInMemoryIndexSize = 182 + nullHandlingOverhead; int sinkSizeOverhead = BatchAppenderator.ROUGH_OVERHEAD_PER_SINK; // currHydrant in the sink still has > 0 bytesInMemory since we do not persist yet @@ -476,7 +475,7 @@ public void testTaskCleanupInMemoryCounterAfterCloseWithRowInMemory() throws Exc appenderator.add(IDENTIFIERS.get(0), createInputRow("2000", "foo", 1), null); // Still under maxSizeInBytes after the add. Hence, we do not persist yet - int nullHandlingOverhead = NullHandling.sqlCompatible() ? 1 : 0; + int nullHandlingOverhead = 1; int currentInMemoryIndexSize = 182 + nullHandlingOverhead; int sinkSizeOverhead = BatchAppenderator.ROUGH_OVERHEAD_PER_SINK; Assert.assertEquals( @@ -506,7 +505,7 @@ public void testMaxBytesInMemoryInMultipleSinks() throws Exception // Still under maxSizeInBytes after the add. Hence, we do not persist yet //expectedSizeInBytes = 44(map overhead) + 28 (TimeAndDims overhead) + 56 (aggregator metrics) + 54 (dimsKeySize) = 182 + 1 byte when null handling is enabled - int nullHandlingOverhead = NullHandling.sqlCompatible() ? 1 : 0; + int nullHandlingOverhead = 1; int currentInMemoryIndexSize = 182 + nullHandlingOverhead; int sinkSizeOverhead = 2 * BatchAppenderator.ROUGH_OVERHEAD_PER_SINK; // currHydrant in the sink still has > 0 bytesInMemory since we do not persist yet @@ -625,7 +624,7 @@ public void testIgnoreMaxBytesInMemory() throws Exception Assert.assertEquals(0, ((BatchAppenderator) appenderator).getRowsInMemory()); appenderator.add(IDENTIFIERS.get(0), createInputRow("2000", "foo", 1), null); //we still calculate the size even when ignoring it to make persist decision - int nullHandlingOverhead = NullHandling.sqlCompatible() ? 1 : 0; + int nullHandlingOverhead = 1; Assert.assertEquals( 182 + nullHandlingOverhead, ((BatchAppenderator) appenderator).getBytesInMemory(IDENTIFIERS.get(0)) diff --git a/server/src/test/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderatorDriverTest.java b/server/src/test/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderatorDriverTest.java index d3dfc45636f4..27aadaee574f 100644 --- a/server/src/test/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderatorDriverTest.java +++ b/server/src/test/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderatorDriverTest.java @@ -26,7 +26,6 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; import com.google.common.util.concurrent.ListenableFuture; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.Committer; import org.apache.druid.data.input.InputRow; import org.apache.druid.data.input.MapBasedInputRow; @@ -108,10 +107,6 @@ public class StreamAppenderatorDriverTest extends EasyMockSupport @Rule public TemporaryFolder temporaryFolder = new TemporaryFolder(); - static { - NullHandling.initializeForTests(); - } - @Before public void setUp() throws Exception { diff --git a/server/src/test/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderatorTest.java b/server/src/test/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderatorTest.java index b2ce7de967cb..aab13960cd9b 100644 --- a/server/src/test/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderatorTest.java +++ b/server/src/test/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderatorTest.java @@ -26,7 +26,6 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.google.common.util.concurrent.ListenableFuture; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.Committer; import org.apache.druid.data.input.InputRow; import org.apache.druid.data.input.MapBasedInputRow; @@ -300,7 +299,7 @@ public void run() appenderator.startJob(); appenderator.add(IDENTIFIERS.get(0), ir("2000", "foo", 1), committerSupplier); //expectedSizeInBytes = 44(map overhead) + 28 (TimeAndDims overhead) + 56 (aggregator metrics) + 54 (dimsKeySize) = 182 + 1 byte when null handling is enabled - int nullHandlingOverhead = NullHandling.sqlCompatible() ? 1 : 0; + int nullHandlingOverhead = 1; Assert.assertEquals( 182 + nullHandlingOverhead, ((StreamAppenderator) appenderator).getBytesInMemory(IDENTIFIERS.get(0)) @@ -349,7 +348,7 @@ public void run() appenderator.startJob(); appenderator.add(IDENTIFIERS.get(0), ir("2000", "foo", 1), committerSupplier); //expectedSizeInBytes = 44(map overhead) + 28 (TimeAndDims overhead) + 56 (aggregator metrics) + 54 (dimsKeySize) = 182 - int nullHandlingOverhead = NullHandling.sqlCompatible() ? 1 : 0; + int nullHandlingOverhead = 1; Assert.assertEquals(182 + nullHandlingOverhead, ((StreamAppenderator) appenderator).getBytesCurrentlyInMemory()); appenderator.add(IDENTIFIERS.get(1), ir("2000", "bar", 1), committerSupplier); Assert.assertEquals( @@ -395,7 +394,7 @@ public void run() appenderator.add(IDENTIFIERS.get(0), ir("2000", "foo", 1), committerSupplier); // Still under maxSizeInBytes after the add. Hence, we do not persist yet //expectedSizeInBytes = 44(map overhead) + 28 (TimeAndDims overhead) + 56 (aggregator metrics) + 54 (dimsKeySize) = 182 + 1 byte when null handling is enabled - int nullHandlingOverhead = NullHandling.sqlCompatible() ? 1 : 0; + int nullHandlingOverhead = 1; int currentInMemoryIndexSize = 182 + nullHandlingOverhead; int sinkSizeOverhead = 1 * StreamAppenderator.ROUGH_OVERHEAD_PER_SINK; // currHydrant in the sink still has > 0 bytesInMemory since we do not persist yet @@ -591,7 +590,7 @@ public void run() appenderator.add(IDENTIFIERS.get(0), ir("2000", "foo", 1), committerSupplier); // Still under maxSizeInBytes after the add. Hence, we do not persist yet - int nullHandlingOverhead = NullHandling.sqlCompatible() ? 1 : 0; + int nullHandlingOverhead = 1; int currentInMemoryIndexSize = 182 + nullHandlingOverhead; int sinkSizeOverhead = 1 * StreamAppenderator.ROUGH_OVERHEAD_PER_SINK; Assert.assertEquals( @@ -643,7 +642,7 @@ public void run() // Still under maxSizeInBytes after the add. Hence, we do not persist yet //expectedSizeInBytes = 44(map overhead) + 28 (TimeAndDims overhead) + 56 (aggregator metrics) + 54 (dimsKeySize) = 182 + 1 byte when null handling is enabled - int nullHandlingOverhead = NullHandling.sqlCompatible() ? 1 : 0; + int nullHandlingOverhead = 1; int currentInMemoryIndexSize = 182 + nullHandlingOverhead; int sinkSizeOverhead = 2 * StreamAppenderator.ROUGH_OVERHEAD_PER_SINK; // currHydrant in the sink still has > 0 bytesInMemory since we do not persist yet @@ -787,7 +786,7 @@ public void run() Assert.assertEquals(0, ((StreamAppenderator) appenderator).getRowsInMemory()); appenderator.add(IDENTIFIERS.get(0), ir("2000", "foo", 1), committerSupplier); //we still calculate the size even when ignoring it to make persist decision - int nullHandlingOverhead = NullHandling.sqlCompatible() ? 1 : 0; + int nullHandlingOverhead = 1; Assert.assertEquals( 182 + nullHandlingOverhead, ((StreamAppenderator) appenderator).getBytesInMemory(IDENTIFIERS.get(0)) diff --git a/server/src/test/java/org/apache/druid/server/ClientQuerySegmentWalkerTest.java b/server/src/test/java/org/apache/druid/server/ClientQuerySegmentWalkerTest.java index f9c6c02cca33..0fbc725235d8 100644 --- a/server/src/test/java/org/apache/druid/server/ClientQuerySegmentWalkerTest.java +++ b/server/src/test/java/org/apache/druid/server/ClientQuerySegmentWalkerTest.java @@ -25,7 +25,6 @@ import com.google.common.collect.ImmutableSet; import com.google.inject.Injector; import org.apache.druid.client.DirectDruidClient; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.guava.Sequence; @@ -1520,7 +1519,7 @@ public void testTimeseriesOnArrays() testQuery( query, ImmutableList.of(ExpectedQuery.cluster(query)), - ImmutableList.of(new Object[]{INTERVAL.getStartMillis(), NullHandling.sqlCompatible() ? null : 0L}) + ImmutableList.of(new Object[]{INTERVAL.getStartMillis(), null}) ); Assert.assertEquals(1, scheduler.getTotalRun().get()); @@ -1546,7 +1545,7 @@ public void testTimeseriesOnArraysUnknown() testQuery( query, ImmutableList.of(ExpectedQuery.cluster(query)), - ImmutableList.of(new Object[]{INTERVAL.getStartMillis(), NullHandling.sqlCompatible() ? null : 0L}) + ImmutableList.of(new Object[]{INTERVAL.getStartMillis(), null}) ); Assert.assertEquals(1, scheduler.getTotalRun().get()); diff --git a/server/src/test/java/org/apache/druid/server/compaction/NewestSegmentFirstPolicyTest.java b/server/src/test/java/org/apache/druid/server/compaction/NewestSegmentFirstPolicyTest.java index d866f996eaf8..73fdd28fb239 100644 --- a/server/src/test/java/org/apache/druid/server/compaction/NewestSegmentFirstPolicyTest.java +++ b/server/src/test/java/org/apache/druid/server/compaction/NewestSegmentFirstPolicyTest.java @@ -26,7 +26,6 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import org.apache.druid.client.indexing.ClientCompactionTaskQueryTuningConfig; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.impl.DimensionsSpec; import org.apache.druid.indexer.partitions.DimensionRangePartitionsSpec; import org.apache.druid.indexer.partitions.PartitionsSpec; @@ -1217,7 +1216,6 @@ public void testIteratorDoesNotReturnsSegmentsWhenPartitionDimensionsPrefixed() @Test public void testIteratorReturnsSegmentsAsSegmentsWasCompactedAndHaveDifferentFilter() throws Exception { - NullHandling.initializeForTests(); // Same indexSpec as what is set in the auto compaction config Map indexSpec = IndexSpec.DEFAULT.asMap(mapper); // Same partitionsSpec as what is set in the auto compaction config @@ -1323,7 +1321,6 @@ public void testIteratorReturnsSegmentsAsSegmentsWasCompactedAndHaveDifferentFil @Test public void testIteratorReturnsSegmentsAsSegmentsWasCompactedAndHaveDifferentMetricsSpec() { - NullHandling.initializeForTests(); mapper.setInjectableValues( new InjectableValues.Std() .addValue(ExprMacroTable.class.getName(), TestExprMacroTable.INSTANCE) @@ -1507,7 +1504,6 @@ public void testIteratorReturnsSegmentsAsCompactionStateChangedWithCompactedStat @Test public void testIteratorDoesNotReturnSegmentWithChangingAppendableIndexSpec() { - NullHandling.initializeForTests(); PartitionsSpec partitionsSpec = CompactionStatus.findPartitionsSpecFromConfig(ClientCompactionTaskQueryTuningConfig.from(null)); final SegmentTimeline timeline = createTimeline( createSegments() diff --git a/server/src/test/java/org/apache/druid/server/coordination/ServerManagerTest.java b/server/src/test/java/org/apache/druid/server/coordination/ServerManagerTest.java index e93f08c03de6..eb7b34471718 100644 --- a/server/src/test/java/org/apache/druid/server/coordination/ServerManagerTest.java +++ b/server/src/test/java/org/apache/druid/server/coordination/ServerManagerTest.java @@ -28,7 +28,6 @@ import org.apache.druid.client.cache.CachePopulatorStats; import org.apache.druid.client.cache.ForegroundCachePopulator; import org.apache.druid.client.cache.LocalCacheProvider; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.java.util.common.IAE; import org.apache.druid.java.util.common.ISE; @@ -182,7 +181,6 @@ public ReferenceCountingSegment getSegment(final DataSegment dataSegment) segmentManager = new SegmentManager(localCacheManager); EmittingLogger.registerEmitter(new NoopServiceEmitter()); - NullHandling.initializeForTests(); queryWaitLatch = new CountDownLatch(1); queryWaitYieldLatch = new CountDownLatch(1); queryNotifyLatch = new CountDownLatch(1); diff --git a/server/src/test/java/org/apache/druid/server/coordinator/DataSourceCompactionConfigTest.java b/server/src/test/java/org/apache/druid/server/coordinator/DataSourceCompactionConfigTest.java index 67f276f76512..b3c9d4f5afdc 100644 --- a/server/src/test/java/org/apache/druid/server/coordinator/DataSourceCompactionConfigTest.java +++ b/server/src/test/java/org/apache/druid/server/coordinator/DataSourceCompactionConfigTest.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.SegmentsSplitHintSpec; import org.apache.druid.data.input.impl.DimensionsSpec; import org.apache.druid.indexer.CompactionEngine; @@ -431,7 +430,6 @@ public void testSerdeDimensionsSpec() throws IOException @Test public void testSerdeTransformSpec() throws IOException { - NullHandling.initializeForTests(); final DataSourceCompactionConfig config = DataSourceCompactionConfig .builder() .forDataSource("dataSource") diff --git a/server/src/test/java/org/apache/druid/server/coordinator/UserCompactionTaskTransformConfigTest.java b/server/src/test/java/org/apache/druid/server/coordinator/UserCompactionTaskTransformConfigTest.java index d7ead348c094..5bf08abe6e75 100644 --- a/server/src/test/java/org/apache/druid/server/coordinator/UserCompactionTaskTransformConfigTest.java +++ b/server/src/test/java/org/apache/druid/server/coordinator/UserCompactionTaskTransformConfigTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import nl.jqno.equalsverifier.EqualsVerifier; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.query.filter.SelectorDimFilter; import org.junit.Assert; @@ -43,7 +42,6 @@ public void testEquals() @Test public void testSerde() throws IOException { - NullHandling.initializeForTests(); final UserCompactionTaskTransformConfig expected = new UserCompactionTaskTransformConfig( new SelectorDimFilter("dim1", "foo", null) ); diff --git a/server/src/test/java/org/apache/druid/server/coordinator/duty/CompactSegmentsTest.java b/server/src/test/java/org/apache/druid/server/coordinator/duty/CompactSegmentsTest.java index c2d5b14aaeaa..d8bcf4837e49 100644 --- a/server/src/test/java/org/apache/druid/server/coordinator/duty/CompactSegmentsTest.java +++ b/server/src/test/java/org/apache/druid/server/coordinator/duty/CompactSegmentsTest.java @@ -40,7 +40,6 @@ import org.apache.druid.client.indexing.ClientTaskQuery; import org.apache.druid.client.indexing.IndexingTotalWorkerCapacityInfo; import org.apache.druid.client.indexing.TaskPayloadResponse; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.impl.DimensionsSpec; import org.apache.druid.indexer.CompactionEngine; import org.apache.druid.indexer.RunnerTaskState; @@ -1312,7 +1311,6 @@ public void testRunWithLockedIntervals() @Test public void testCompactWithTransformSpec() { - NullHandling.initializeForTests(); final OverlordClient mockClient = Mockito.mock(OverlordClient.class); final ArgumentCaptor payloadCaptor = setUpMockClient(mockClient); final CompactSegments compactSegments = new CompactSegments(statusTracker, mockClient); @@ -1415,7 +1413,6 @@ public void testCompactWithoutCustomSpecs() @Test public void testCompactWithMetricsSpec() { - NullHandling.initializeForTests(); AggregatorFactory[] aggregatorFactories = new AggregatorFactory[] {new CountAggregatorFactory("cnt")}; final OverlordClient mockClient = Mockito.mock(OverlordClient.class); final ArgumentCaptor payloadCaptor = setUpMockClient(mockClient); diff --git a/services/src/test/java/org/apache/druid/cli/DumpSegmentTest.java b/services/src/test/java/org/apache/druid/cli/DumpSegmentTest.java index b8fc3f72732f..3e1170bc6927 100644 --- a/services/src/test/java/org/apache/druid/cli/DumpSegmentTest.java +++ b/services/src/test/java/org/apache/druid/cli/DumpSegmentTest.java @@ -28,7 +28,6 @@ import org.apache.druid.collections.bitmap.BitmapFactory; import org.apache.druid.collections.bitmap.ImmutableBitmap; import org.apache.druid.collections.bitmap.RoaringBitmapFactory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.impl.DimensionsSpec; import org.apache.druid.data.input.impl.TimestampSpec; import org.apache.druid.guice.BuiltInTypesModule; @@ -219,17 +218,10 @@ public void testDumpNestedColumn() throws Exception ); final byte[] fileBytes = Files.readAllBytes(outputFile.toPath()); final String output = StringUtils.fromUtf8(fileBytes); - if (NullHandling.sqlCompatible()) { - Assert.assertEquals( - "{\"nest\":{\"fields\":[{\"path\":\"$.x\",\"types\":[\"LONG\"]},{\"path\":\"$.y\",\"types\":[\"DOUBLE\"]},{\"path\":\"$.z\",\"types\":[\"STRING\"]}],\"dictionaries\":{\"strings\":[{\"globalId\":0,\"value\":null},{\"globalId\":1,\"value\":\"a\"},{\"globalId\":2,\"value\":\"b\"}],\"longs\":[{\"globalId\":3,\"value\":100},{\"globalId\":4,\"value\":200},{\"globalId\":5,\"value\":400}],\"doubles\":[{\"globalId\":6,\"value\":1.1},{\"globalId\":7,\"value\":2.2},{\"globalId\":8,\"value\":3.3}],\"nullRows\":[]}}}", - output - ); - } else { - Assert.assertEquals( - "{\"nest\":{\"fields\":[{\"path\":\"$.x\",\"types\":[\"LONG\"]},{\"path\":\"$.y\",\"types\":[\"DOUBLE\"]},{\"path\":\"$.z\",\"types\":[\"STRING\"]}],\"dictionaries\":{\"strings\":[{\"globalId\":0,\"value\":null},{\"globalId\":1,\"value\":\"a\"},{\"globalId\":2,\"value\":\"b\"}],\"longs\":[{\"globalId\":3,\"value\":0},{\"globalId\":4,\"value\":100},{\"globalId\":5,\"value\":200},{\"globalId\":6,\"value\":400}],\"doubles\":[{\"globalId\":7,\"value\":0.0},{\"globalId\":8,\"value\":1.1},{\"globalId\":9,\"value\":2.2},{\"globalId\":10,\"value\":3.3}],\"nullRows\":[]}}}", - output - ); - } + Assert.assertEquals( + "{\"nest\":{\"fields\":[{\"path\":\"$.x\",\"types\":[\"LONG\"]},{\"path\":\"$.y\",\"types\":[\"DOUBLE\"]},{\"path\":\"$.z\",\"types\":[\"STRING\"]}],\"dictionaries\":{\"strings\":[{\"globalId\":0,\"value\":null},{\"globalId\":1,\"value\":\"a\"},{\"globalId\":2,\"value\":\"b\"}],\"longs\":[{\"globalId\":3,\"value\":100},{\"globalId\":4,\"value\":200},{\"globalId\":5,\"value\":400}],\"doubles\":[{\"globalId\":6,\"value\":1.1},{\"globalId\":7,\"value\":2.2},{\"globalId\":8,\"value\":3.3}],\"nullRows\":[]}}}", + output + ); } @Test @@ -260,17 +252,10 @@ public void testDumpNestedColumnPath() throws Exception ); final byte[] fileBytes = Files.readAllBytes(outputFile.toPath()); final String output = StringUtils.fromUtf8(fileBytes); - if (NullHandling.sqlCompatible()) { - Assert.assertEquals( - "{\"bitmapSerdeFactory\":{\"type\":\"roaring\"},\"nest\":{\"$.x\":{\"types\":[\"LONG\"],\"dictionary\":[{\"localId\":0,\"globalId\":0,\"value\":null,\"rows\":[4]},{\"localId\":1,\"globalId\":3,\"value\":\"100\",\"rows\":[3]},{\"localId\":2,\"globalId\":4,\"value\":\"200\",\"rows\":[0,2]},{\"localId\":3,\"globalId\":5,\"value\":\"400\",\"rows\":[1]}],\"column\":[{\"row\":0,\"raw\":{\"x\":200,\"y\":2.2},\"fieldId\":2,\"fieldValue\":\"200\"},{\"row\":1,\"raw\":{\"x\":400,\"y\":1.1,\"z\":\"a\"},\"fieldId\":3,\"fieldValue\":\"400\"},{\"row\":2,\"raw\":{\"x\":200,\"z\":\"b\"},\"fieldId\":2,\"fieldValue\":\"200\"},{\"row\":3,\"raw\":{\"x\":100,\"y\":1.1,\"z\":\"a\"},\"fieldId\":1,\"fieldValue\":\"100\"},{\"row\":4,\"raw\":{\"y\":3.3,\"z\":\"b\"},\"fieldId\":0,\"fieldValue\":null}]}}}", - output - ); - } else { - Assert.assertEquals( - "{\"bitmapSerdeFactory\":{\"type\":\"roaring\"},\"nest\":{\"$.x\":{\"types\":[\"LONG\"],\"dictionary\":[{\"localId\":0,\"globalId\":0,\"value\":null,\"rows\":[4]},{\"localId\":1,\"globalId\":4,\"value\":\"100\",\"rows\":[3]},{\"localId\":2,\"globalId\":5,\"value\":\"200\",\"rows\":[0,2]},{\"localId\":3,\"globalId\":6,\"value\":\"400\",\"rows\":[1]}],\"column\":[{\"row\":0,\"raw\":{\"x\":200,\"y\":2.2},\"fieldId\":2,\"fieldValue\":\"200\"},{\"row\":1,\"raw\":{\"x\":400,\"y\":1.1,\"z\":\"a\"},\"fieldId\":3,\"fieldValue\":\"400\"},{\"row\":2,\"raw\":{\"x\":200,\"z\":\"b\"},\"fieldId\":2,\"fieldValue\":\"200\"},{\"row\":3,\"raw\":{\"x\":100,\"y\":1.1,\"z\":\"a\"},\"fieldId\":1,\"fieldValue\":\"100\"},{\"row\":4,\"raw\":{\"y\":3.3,\"z\":\"b\"},\"fieldId\":0,\"fieldValue\":null}]}}}", - output - ); - } + Assert.assertEquals( + "{\"bitmapSerdeFactory\":{\"type\":\"roaring\"},\"nest\":{\"$.x\":{\"types\":[\"LONG\"],\"dictionary\":[{\"localId\":0,\"globalId\":0,\"value\":null,\"rows\":[4]},{\"localId\":1,\"globalId\":3,\"value\":\"100\",\"rows\":[3]},{\"localId\":2,\"globalId\":4,\"value\":\"200\",\"rows\":[0,2]},{\"localId\":3,\"globalId\":5,\"value\":\"400\",\"rows\":[1]}],\"column\":[{\"row\":0,\"raw\":{\"x\":200,\"y\":2.2},\"fieldId\":2,\"fieldValue\":\"200\"},{\"row\":1,\"raw\":{\"x\":400,\"y\":1.1,\"z\":\"a\"},\"fieldId\":3,\"fieldValue\":\"400\"},{\"row\":2,\"raw\":{\"x\":200,\"z\":\"b\"},\"fieldId\":2,\"fieldValue\":\"200\"},{\"row\":3,\"raw\":{\"x\":100,\"y\":1.1,\"z\":\"a\"},\"fieldId\":1,\"fieldValue\":\"100\"},{\"row\":4,\"raw\":{\"y\":3.3,\"z\":\"b\"},\"fieldId\":0,\"fieldValue\":null}]}}}", + output + ); } @Test diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/BitwiseSqlAggregator.java b/sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/BitwiseSqlAggregator.java index 489080acd164..85c09813af44 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/BitwiseSqlAggregator.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/BitwiseSqlAggregator.java @@ -23,7 +23,6 @@ import org.apache.calcite.rel.core.AggregateCall; import org.apache.calcite.sql.SqlAggFunction; import org.apache.calcite.sql.fun.SqlStdOperatorTable; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.math.expr.ExprMacroTable; import org.apache.druid.query.aggregation.ExpressionLambdaAggregatorFactory; @@ -159,7 +158,7 @@ public Aggregation toDruidAggregation( ), new NotDimFilter( plannerContext.isUseBoundsAndSelectors() - ? new SelectorDimFilter(fieldName, NullHandling.defaultStringValue(), null) + ? new SelectorDimFilter(fieldName, null, null) : NullFilter.forColumn(fieldName) ) ) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/StringSqlAggregator.java b/sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/StringSqlAggregator.java index 49469decf996..117738f72dda 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/StringSqlAggregator.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/StringSqlAggregator.java @@ -36,7 +36,6 @@ import org.apache.calcite.sql.type.SqlTypeFamily; import org.apache.calcite.sql.type.SqlTypeName; import org.apache.calcite.util.Optionality; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.HumanReadableBytes; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.math.expr.ExprMacroTable; @@ -149,7 +148,7 @@ public Aggregation toDruidAggregation( final String finalizer = StringUtils.format("if(array_length(o) == 0, null, array_to_string(o, '%s'))", separator); final NotDimFilter dimFilter = new NotDimFilter( plannerContext.isUseBoundsAndSelectors() - ? new SelectorDimFilter(fieldName, NullHandling.defaultStringValue(), null) + ? new SelectorDimFilter(fieldName, null, null) : NullFilter.forColumn(fieldName) ); if (aggregateCall.isDistinct()) { diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/expression/DruidLiteral.java b/sql/src/main/java/org/apache/druid/sql/calcite/expression/DruidLiteral.java index 616530035372..4d750d60a842 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/expression/DruidLiteral.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/expression/DruidLiteral.java @@ -19,7 +19,6 @@ package org.apache.druid.sql.calcite.expression; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.math.expr.ExprEval; import org.apache.druid.math.expr.ExpressionType; @@ -28,9 +27,7 @@ /** * Literal value, plus a {@link ExpressionType} that represents how to interpret the literal value. * - * These are similar to {@link ExprEval}, but not identical: unlike {@link ExprEval}, string values in this class - * are not normalized through {@link NullHandling#emptyToNullIfNeeded(String)}. This allows us to differentiate - * between null and empty-string literals even when {@link NullHandling#replaceWithDefault()}. + * These are similar to {@link ExprEval}. */ public class DruidLiteral { diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/expression/Expressions.java b/sql/src/main/java/org/apache/druid/sql/calcite/expression/Expressions.java index 689db77c0faa..5c65ce75d68e 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/expression/Expressions.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/expression/Expressions.java @@ -34,7 +34,6 @@ import org.apache.calcite.sql.SqlOperator; import org.apache.calcite.sql.type.SqlTypeFamily; import org.apache.calcite.sql.type.SqlTypeName; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.ISE; import org.apache.druid.java.util.common.StringUtils; @@ -418,42 +417,21 @@ public static DimFilter toFilter( || kind == SqlKind.IS_NOT_TRUE || kind == SqlKind.IS_FALSE || kind == SqlKind.IS_NOT_FALSE) { - if (NullHandling.useThreeValueLogic()) { - final DimFilter baseFilter = toFilter( - plannerContext, - rowSignature, - virtualColumnRegistry, - Iterables.getOnlyElement(((RexCall) expression).getOperands()) - ); + final DimFilter baseFilter = toFilter( + plannerContext, + rowSignature, + virtualColumnRegistry, + Iterables.getOnlyElement(((RexCall) expression).getOperands()) + ); - if (kind == SqlKind.IS_TRUE) { - return IsTrueDimFilter.of(baseFilter); - } else if (kind == SqlKind.IS_NOT_TRUE) { - return NotDimFilter.of(IsTrueDimFilter.of(baseFilter)); - } else if (kind == SqlKind.IS_FALSE) { - return IsFalseDimFilter.of(baseFilter); - } else { // SqlKind.IS_NOT_FALSE - return NotDimFilter.of(IsFalseDimFilter.of(baseFilter)); - } - } else { - // legacy behavior - if (kind == SqlKind.IS_TRUE || kind == SqlKind.IS_NOT_FALSE) { - return toFilter( - plannerContext, - rowSignature, - virtualColumnRegistry, - Iterables.getOnlyElement(((RexCall) expression).getOperands()) - ); - } else { // SqlKind.IS_FALSE || SqlKind.IS_NOT_TRUE - return new NotDimFilter( - toFilter( - plannerContext, - rowSignature, - virtualColumnRegistry, - Iterables.getOnlyElement(((RexCall) expression).getOperands()) - ) - ); - } + if (kind == SqlKind.IS_TRUE) { + return IsTrueDimFilter.of(baseFilter); + } else if (kind == SqlKind.IS_NOT_TRUE) { + return NotDimFilter.of(IsTrueDimFilter.of(baseFilter)); + } else if (kind == SqlKind.IS_FALSE) { + return IsFalseDimFilter.of(baseFilter); + } else { // SqlKind.IS_NOT_FALSE + return NotDimFilter.of(IsFalseDimFilter.of(baseFilter)); } } else if (kind == SqlKind.CAST && expression.getType().getSqlTypeName() == SqlTypeName.BOOLEAN) { // Calcite sometimes leaves errant, useless cast-to-booleans inside filters. Strip them and continue. @@ -544,32 +522,9 @@ private static DimFilter toSimpleLeafFilter( { final SqlKind kind = rexNode.getKind(); - if (kind == SqlKind.IS_TRUE || kind == SqlKind.IS_NOT_FALSE) { - if (NullHandling.useThreeValueLogic()) { - // use expression filter to get istrue or notfalse expressions for correct 3vl behavior - return toExpressionLeafFilter(plannerContext, rowSignature, rexNode); - } - // legacy behavior - return toSimpleLeafFilter( - plannerContext, - rowSignature, - virtualColumnRegistry, - Iterables.getOnlyElement(((RexCall) rexNode).getOperands()) - ); - } else if (kind == SqlKind.IS_FALSE || kind == SqlKind.IS_NOT_TRUE) { - if (NullHandling.useThreeValueLogic()) { - // use expression filter to get isfalse or nottrue expressions for correct 3vl behavior - return toExpressionLeafFilter(plannerContext, rowSignature, rexNode); - } - // legacy behavior - return new NotDimFilter( - toSimpleLeafFilter( - plannerContext, - rowSignature, - virtualColumnRegistry, - Iterables.getOnlyElement(((RexCall) rexNode).getOperands()) - ) - ); + if (kind == SqlKind.IS_TRUE || kind == SqlKind.IS_NOT_FALSE || kind == SqlKind.IS_FALSE || kind == SqlKind.IS_NOT_TRUE) { + // use expression filter to get istrue/notfalse/isfalse/nottrue expressions for correct 3vl behavior + return toExpressionLeafFilter(plannerContext, rowSignature, rexNode); } else if (kind == SqlKind.IS_NULL || kind == SqlKind.IS_NOT_NULL) { final RexNode operand = Iterables.getOnlyElement(((RexCall) rexNode).getOperands()); @@ -591,7 +546,7 @@ private static DimFilter toSimpleLeafFilter( if (plannerContext.isUseBoundsAndSelectors()) { equalFilter = new SelectorDimFilter( druidExpression.getSimpleExtraction().getColumn(), - NullHandling.defaultStringValue(), + null, druidExpression.getSimpleExtraction().getExtractionFn() ); } else { @@ -617,7 +572,7 @@ private static DimFilter toSimpleLeafFilter( ); if (plannerContext.isUseBoundsAndSelectors()) { - equalFilter = new SelectorDimFilter(virtualColumn, NullHandling.defaultStringValue(), null); + equalFilter = new SelectorDimFilter(virtualColumn, null, null); } else { equalFilter = NullFilter.forColumn(virtualColumn); } @@ -746,7 +701,7 @@ private static DimFilter toSimpleLeafFilter( final String stringVal; if (rhsParsed.getLiteralValue() == null) { - stringVal = NullHandling.defaultStringValue(); + stringVal = null; } else if (RexUtil.isLiteral(rhs, true) && SqlTypeName.NUMERIC_TYPES.contains(rhs.getType().getSqlTypeName())) { // Peek inside the original rhs for numerics, rather than using the parsed version, for highest fidelity // to what the query originally contained. (It may be a BigDecimal.) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/ReductionOperatorConversionHelper.java b/sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/ReductionOperatorConversionHelper.java index 427c93a28782..8cd1a7819939 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/ReductionOperatorConversionHelper.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/ReductionOperatorConversionHelper.java @@ -23,7 +23,6 @@ import org.apache.calcite.rel.type.RelDataTypeFactory; import org.apache.calcite.sql.type.SqlReturnTypeInference; import org.apache.calcite.sql.type.SqlTypeName; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.IAE; import org.apache.druid.math.expr.ExpressionTypeConversion; import org.apache.druid.segment.column.ColumnType; @@ -84,12 +83,7 @@ private ReductionOperatorConversionHelper() } } - if (isString || NullHandling.sqlCompatible()) { - // String can be null in both modes - return typeFactory.createTypeWithNullability(typeFactory.createSqlType(returnSqlTypeName), true); - } else { - return typeFactory.createSqlType(returnSqlTypeName); - } + return typeFactory.createTypeWithNullability(typeFactory.createSqlType(returnSqlTypeName), true); }; } diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/filtration/ConvertSelectorsToIns.java b/sql/src/main/java/org/apache/druid/sql/calcite/filtration/ConvertSelectorsToIns.java index 413d75fbc6dc..36674f38934c 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/filtration/ConvertSelectorsToIns.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/filtration/ConvertSelectorsToIns.java @@ -20,9 +20,7 @@ package org.apache.druid.sql.calcite.filtration; import com.google.common.collect.Lists; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.Pair; -import org.apache.druid.math.expr.Evals; import org.apache.druid.query.filter.AndDimFilter; import org.apache.druid.query.filter.DimFilter; import org.apache.druid.query.filter.EqualityFilter; @@ -66,11 +64,7 @@ public DimFilter process(DimFilter filter) children = new CollectSelectors(children, sourceRowSignature).collect(); // Process "equality" filters, which are used when "sqlUseBoundAndSelectors" is false. - if (NullHandling.sqlCompatible()) { - children = new CollectEqualities(children).collect(); - } else { - children = new CollectEqualitiesDefaultValueMode(children).collect(); - } + children = new CollectEqualities(children).collect(); if (!children.equals(((OrDimFilter) filter).getFields())) { return children.size() == 1 ? children.get(0) : new OrDimFilter(children); @@ -262,64 +256,4 @@ protected DimFilter makeAnd(List exprs) return new AndDimFilter(exprs); } } - - private static class CollectEqualitiesDefaultValueMode - extends CollectComparisons - { - public CollectEqualitiesDefaultValueMode(final List orExprs) - { - super(orExprs); - } - - @Nullable - @Override - protected Pair> getCollectibleComparison(DimFilter filter) - { - return ConvertSelectorsToIns.splitAnd( - filter, - EqualityFilter.class, - - // Prefer extracting nonnull vs null comparisons when ANDed, as nonnull comparisons are more likely to - // find companions in other ORs. - Comparator.comparing(equality -> equality.getMatchValue() == null ? 0 : 1) - ); - } - - @Override - protected InDimFilter.ValuesSet makeCollection() - { - return new InDimFilter.ValuesSet(); - } - - @Nullable - @Override - protected RangeRefKey getCollectionKey(EqualityFilter selector) - { - return RangeRefKey.from(selector); - } - - @Override - protected Set getMatchValues(EqualityFilter selector) - { - return Collections.singleton(Evals.asString(selector.getMatchValue())); - } - - @Nullable - @Override - protected InDimFilter makeCollectedComparison(RangeRefKey rangeRefKey, InDimFilter.ValuesSet values) - { - if (values.size() > 1) { - // skip non-string equality filters since InDimFilter uses a sorted string set, which is a different sort - // than numbers or other types might use - return new InDimFilter(rangeRefKey.getColumn(), values, null, null); - } - return null; - } - - @Override - protected DimFilter makeAnd(List exprs) - { - return new AndDimFilter(exprs); - } - } } diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/PlannerContext.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/PlannerContext.java index 74744c2bb8f4..c6e600d8a757 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/PlannerContext.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/PlannerContext.java @@ -28,7 +28,6 @@ import org.apache.calcite.avatica.remote.TypedValue; import org.apache.calcite.linq4j.QueryProvider; import org.apache.calcite.schema.SchemaPlus; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.InvalidSqlInput; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.ISE; @@ -102,7 +101,7 @@ public class PlannerContext * Context key for {@link PlannerContext#isUseBoundsAndSelectors()}. */ public static final String CTX_SQL_USE_BOUNDS_AND_SELECTORS = "sqlUseBoundAndSelectors"; - public static final boolean DEFAULT_SQL_USE_BOUNDS_AND_SELECTORS = NullHandling.replaceWithDefault(); + public static final boolean DEFAULT_SQL_USE_BOUNDS_AND_SELECTORS = false; /** * Context key for {@link PlannerContext#isPullUpLookup()}. @@ -413,7 +412,6 @@ public boolean isStringifyArrays() * {@link org.apache.druid.query.filter.SelectorDimFilter} (true) or {@link org.apache.druid.query.filter.RangeFilter}, * {@link org.apache.druid.query.filter.EqualityFilter}, and {@link org.apache.druid.query.filter.NullFilter} (false). * - * Typically true when {@link NullHandling#replaceWithDefault()} and false when {@link NullHandling#sqlCompatible()}. * Can be overriden by the context parameter {@link #CTX_SQL_USE_BOUNDS_AND_SELECTORS}. */ public boolean isUseBoundsAndSelectors() @@ -426,7 +424,7 @@ public boolean isUseBoundsAndSelectors() */ public boolean isUseLegacyInFilter() { - return useBoundsAndSelectors || NullHandling.replaceWithDefault(); + return useBoundsAndSelectors; } /** diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rule/DruidJoinRule.java b/sql/src/main/java/org/apache/druid/sql/calcite/rule/DruidJoinRule.java index d604999e41b3..3dd7214eeafb 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rule/DruidJoinRule.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rule/DruidJoinRule.java @@ -46,7 +46,6 @@ import org.apache.calcite.sql.type.SqlTypeName; import org.apache.calcite.tools.RelBuilder; import org.apache.calcite.util.ImmutableBitSet; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.query.JoinAlgorithm; @@ -273,14 +272,9 @@ public boolean canHandleCondition( } } - if (joinType != JoinRelType.INNER || !systemFieldList.isEmpty() || NullHandling.replaceWithDefault()) { + if (joinType != JoinRelType.INNER || !systemFieldList.isEmpty()) { // I am not sure in what case, the list of system fields will be not empty. I have just picked up this logic // directly from https://github.com/apache/calcite/blob/calcite-1.35.0/core/src/main/java/org/apache/calcite/rel/rules/AbstractJoinExtractFilterRule.java#L58 - - // Also to avoid results changes for existing queries in non-null handling mode, we don't handle unsupported - // conditions. Otherwise, some left/right joins with a condition that doesn't allow nulls on join input will - // be converted to inner joins. See Test CalciteJoinQueryTest#testFilterAndGroupByLookupUsingJoinOperatorBackwards - // for an example. return conditionAnalysis.getUnsupportedOnSubConditions().isEmpty(); } diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rule/DruidLogicalValuesRule.java b/sql/src/main/java/org/apache/druid/sql/calcite/rule/DruidLogicalValuesRule.java index c17e339e7854..8cf224e2a60d 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rule/DruidLogicalValuesRule.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rule/DruidLogicalValuesRule.java @@ -25,7 +25,6 @@ import org.apache.calcite.plan.RelOptRuleCall; import org.apache.calcite.rel.logical.LogicalValues; import org.apache.calcite.rex.RexLiteral; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.InvalidSqlInput; import org.apache.druid.query.InlineDataSource; import org.apache.druid.segment.column.RowSignature; @@ -121,7 +120,7 @@ public static Object getValueFromLiteral(RexLiteral literal, PlannerContext plan } return ((Number) RexLiteral.value(literal)).longValue(); case BOOLEAN: - if (NullHandling.sqlCompatible() && literal.isNull()) { + if (literal.isNull()) { return null; } return literal.isAlwaysTrue() ? 1L : 0L; diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rule/FilterDecomposeConcatRule.java b/sql/src/main/java/org/apache/druid/sql/calcite/rule/FilterDecomposeConcatRule.java index 30b9b8eb962c..b4a4b16b8a28 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rule/FilterDecomposeConcatRule.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rule/FilterDecomposeConcatRule.java @@ -36,7 +36,6 @@ import org.apache.calcite.sql.fun.SqlStdOperatorTable; import org.apache.calcite.sql.type.SqlTypeFamily; import org.apache.calcite.sql.type.SqlTypeName; -import org.apache.druid.common.config.NullHandling; import javax.annotation.Nullable; import java.util.ArrayList; @@ -110,19 +109,14 @@ public RexNode visitCall(final RexCall call) && FlattenConcatRule.isNonTrivialStringConcat(Iterables.getOnlyElement(call.getOperands()))) { negate = call.isA(SqlKind.IS_NOT_NULL); final RexCall concatCall = (RexCall) Iterables.getOnlyElement(call.getOperands()); - if (NullHandling.sqlCompatible()) { - // Convert: [CONCAT(x, '-', y) IS NULL] => [x IS NULL OR y IS NULL] - newCall = RexUtil.composeDisjunction( - rexBuilder, - Iterables.transform( - concatCall.getOperands(), - operand -> rexBuilder.makeCall(SqlStdOperatorTable.IS_NULL, operand) - ) - ); - } else { - // Treat [CONCAT(x, '-', y) IS NULL] as [CONCAT(x, '-', y) = ''] - newCall = tryDecomposeConcatEquals(concatCall, rexBuilder.makeLiteral(""), rexBuilder); - } + // Convert: [CONCAT(x, '-', y) IS NULL] => [x IS NULL OR y IS NULL] + newCall = RexUtil.composeDisjunction( + rexBuilder, + Iterables.transform( + concatCall.getOperands(), + operand -> rexBuilder.makeCall(SqlStdOperatorTable.IS_NULL, operand) + ) + ); } else { negate = false; newCall = null; @@ -239,27 +233,23 @@ private static RexNode tryDecomposeConcatEquals( */ private static RexNode impossibleMatch(final List nonLiterals, final RexBuilder rexBuilder) { - if (NullHandling.sqlCompatible()) { - // This expression might be FALSE and might be UNKNOWN depending on whether any of the inputs are null. Use the - // construct "x IS NULL AND UNKNOWN" for each arg x to CONCAT, which is FALSE if x is not null and UNKNOWN if - // x is null. Then OR them all together, so the entire expression is FALSE if all args are not null, and - // UNKNOWN if any arg is null. - final RexLiteral unknown = - rexBuilder.makeNullLiteral(rexBuilder.getTypeFactory().createSqlType(SqlTypeName.BOOLEAN)); - return RexUtil.composeDisjunction( - rexBuilder, - Iterables.transform( - nonLiterals, - operand -> rexBuilder.makeCall( - SqlStdOperatorTable.AND, - rexBuilder.makeCall(SqlStdOperatorTable.IS_NULL, operand), - unknown - ) - ) - ); - } else { - return rexBuilder.makeLiteral(false); - } + // This expression might be FALSE and might be UNKNOWN depending on whether any of the inputs are null. Use the + // construct "x IS NULL AND UNKNOWN" for each arg x to CONCAT, which is FALSE if x is not null and UNKNOWN if + // x is null. Then OR them all together, so the entire expression is FALSE if all args are not null, and + // UNKNOWN if any arg is null. + final RexLiteral unknown = + rexBuilder.makeNullLiteral(rexBuilder.getTypeFactory().createSqlType(SqlTypeName.BOOLEAN)); + return RexUtil.composeDisjunction( + rexBuilder, + Iterables.transform( + nonLiterals, + operand -> rexBuilder.makeCall( + SqlStdOperatorTable.AND, + rexBuilder.makeCall(SqlStdOperatorTable.IS_NULL, operand), + unknown + ) + ) + ); } /** diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rule/FilterJoinExcludePushToChildRule.java b/sql/src/main/java/org/apache/druid/sql/calcite/rule/FilterJoinExcludePushToChildRule.java index 4432b2824383..57791abbfc08 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rule/FilterJoinExcludePushToChildRule.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rule/FilterJoinExcludePushToChildRule.java @@ -35,7 +35,6 @@ import org.apache.calcite.rex.RexUtil; import org.apache.calcite.sql.SqlKind; import org.apache.calcite.tools.RelBuilder; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.Pair; import java.util.ArrayList; @@ -166,7 +165,7 @@ protected void perform(RelOptRuleCall call, Filter filter, Join join) } // once the filters are pushed to join from top, try to remove redudant 'IS NOT NULL' filters - removeRedundantIsNotNullFilters(joinFilters, joinType, NullHandling.sqlCompatible()); + removeRedundantIsNotNullFilters(joinFilters, joinType); // if nothing actually got pushed and there is nothing leftover, // then this rule is a no-op @@ -285,14 +284,14 @@ private static boolean classifyFilters(List filters, * This tries to find all the 'IS NOT NULL' filters in an inner join whose checking column is also * a part of an equi-condition between the two tables. It removes such 'IS NOT NULL' filters from join since * the equi-condition will never return true for null input, thus making the 'IS NOT NULL' filter a no-op. + * * @param joinFilters * @param joinType - * @param isSqlCompatible */ - static void removeRedundantIsNotNullFilters(List joinFilters, JoinRelType joinType, boolean isSqlCompatible) + static void removeRedundantIsNotNullFilters(List joinFilters, JoinRelType joinType) { - if (joinType != JoinRelType.INNER || !isSqlCompatible) { - return; // only works for inner joins in SQL mode + if (joinType != JoinRelType.INNER) { + return; // only works for inner joins } ImmutableList.Builder isNotNullFiltersBuilder = ImmutableList.builder(); diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rule/FlattenConcatRule.java b/sql/src/main/java/org/apache/druid/sql/calcite/rule/FlattenConcatRule.java index 48aee4cf3556..fcf94e980a87 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rule/FlattenConcatRule.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rule/FlattenConcatRule.java @@ -33,7 +33,6 @@ import org.apache.calcite.sql.fun.SqlStdOperatorTable; import org.apache.calcite.sql.type.SqlTypeFamily; import org.apache.calcite.tools.RelBuilder; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.math.expr.Function; import org.apache.druid.sql.calcite.expression.builtin.ConcatOperatorConversion; import org.apache.druid.sql.calcite.expression.builtin.TextcatOperatorConversion; @@ -92,7 +91,7 @@ public RexNode visitCall(RexCall call) } else { newOperands.add(visitedOperand); } - } else if (RexUtil.isNullLiteral(operand, true) && NullHandling.sqlCompatible()) { + } else if (RexUtil.isNullLiteral(operand, true)) { return rexBuilder.makeNullLiteral(call.getType()); } else { newOperands.add(operand); diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rule/ReverseLookupRule.java b/sql/src/main/java/org/apache/druid/sql/calcite/rule/ReverseLookupRule.java index 30329816f042..d262e28337b5 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rule/ReverseLookupRule.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rule/ReverseLookupRule.java @@ -36,7 +36,6 @@ import org.apache.calcite.sql.fun.SqlStdOperatorTable; import org.apache.calcite.sql.type.SqlTypeFamily; import org.apache.calcite.sql.type.SqlTypeName; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.ISE; import org.apache.druid.java.util.common.Pair; import org.apache.druid.query.QueryContext; @@ -154,7 +153,7 @@ static class ReverseLookupShuttle extends RexShuttle private final Set consideredAsChild = new HashSet<>(); /** - * Flipped by each call to {@link #visitNot(RexCall)}. See {@link NullHandling#useThreeValueLogic()}. + * Flipped by each call to {@link #visitNot(RexCall)}. */ private boolean includeUnknown = false; @@ -199,9 +198,9 @@ public RexNode visitCall(RexCall call) */ private RexNode visitNot(final RexCall call) { - includeUnknown = NullHandling.useThreeValueLogic() && !includeUnknown; + includeUnknown = !includeUnknown; final RexNode retVal = super.visitCall(call); - includeUnknown = NullHandling.useThreeValueLogic() && !includeUnknown; + includeUnknown = !includeUnknown; return retVal; } @@ -364,7 +363,7 @@ protected ReverseLookupKey getCollectionKey(RexCall call) final String replaceMissingValueWith; if (lookupOperands.size() >= 3) { - replaceMissingValueWith = NullHandling.emptyToNullIfNeeded(RexLiteral.stringValue(lookupOperands.get(2))); + replaceMissingValueWith = RexLiteral.stringValue(lookupOperands.get(2)); } else { replaceMissingValueWith = null; } @@ -531,7 +530,7 @@ private Set reverseLookup( return InDimFilter.optimizeLookup( filterToOptimize, - mayIncludeUnknown && NullHandling.useThreeValueLogic(), + mayIncludeUnknown, maxInSize ); } diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/run/SqlResults.java b/sql/src/main/java/org/apache/druid/sql/calcite/run/SqlResults.java index 0f4a07d33357..69a7d4f9787b 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/run/SqlResults.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/run/SqlResults.java @@ -27,7 +27,6 @@ import com.google.common.primitives.Ints; import org.apache.calcite.sql.type.SqlTypeName; import org.apache.calcite.util.NlsString; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.math.expr.Evals; @@ -63,7 +62,7 @@ public static Object coerce( if (SqlTypeName.CHAR_TYPES.contains(sqlTypeName)) { if (value == null || value instanceof String) { - coercedValue = NullHandling.nullToEmptyIfNeeded((String) value); + coercedValue = value; } else if (value instanceof NlsString) { coercedValue = ((NlsString) value).getValue(); } else if (value instanceof Number) { @@ -138,7 +137,7 @@ public static Object coerce( } else if (sqlTypeName == SqlTypeName.ARRAY) { if (context.isStringifyArrays()) { if (value instanceof String) { - coercedValue = NullHandling.nullToEmptyIfNeeded((String) value); + coercedValue = value; } else if (value instanceof NlsString) { coercedValue = ((NlsString) value).getValue(); } else { diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java b/sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java index 0551480125c1..37f8c50b4733 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java @@ -52,7 +52,6 @@ import org.apache.druid.client.JsonParserIterator; import org.apache.druid.client.TimelineServerView; import org.apache.druid.client.coordinator.Coordinator; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.guava.FutureUtils; import org.apache.druid.discovery.DataNodeService; import org.apache.druid.discovery.DiscoveryDruidNode; @@ -634,7 +633,7 @@ private static Object[] buildRowForNonDataServer(DiscoveryDruidNode discoveryDru null, UNKNOWN_SIZE, UNKNOWN_SIZE, - NullHandling.defaultLongValue(), + null, toStringOrNull(discoveryDruidNode.getStartTime()) }; } @@ -692,7 +691,7 @@ private static Object[] buildRowForDiscoverableDataServer( druidServerToUse.getTier(), currentSize, druidServerToUse.getMaxSize(), - NullHandling.defaultLongValue(), + null, toStringOrNull(discoveryDruidNode.getStartTime()) }; } diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/table/RowSignatures.java b/sql/src/main/java/org/apache/druid/sql/calcite/table/RowSignatures.java index e02cd6458945..9c345dafad0c 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/table/RowSignatures.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/table/RowSignatures.java @@ -31,7 +31,6 @@ import org.apache.calcite.sql.type.SqlOperandCountRanges; import org.apache.calcite.sql.type.SqlSingleOperandTypeChecker; import org.apache.calcite.sql.type.SqlTypeName; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.IAE; import org.apache.druid.java.util.common.ISE; import org.apache.druid.java.util.common.StringUtils; @@ -117,7 +116,6 @@ public static RelDataType toRelDataType( ) { final RelDataTypeFactory.Builder builder = typeFactory.builder(); - final boolean nullNumeric = !NullHandling.replaceWithDefault(); for (final String columnName : rowSignature.getColumnNames()) { final RelDataType type; @@ -128,7 +126,7 @@ public static RelDataType toRelDataType( rowSignature.getColumnType(columnName) .orElseThrow(() -> new ISE("Encountered null type for column[%s]", columnName)); - type = columnTypeToRelDataType(typeFactory, columnType, nullNumeric); + type = columnTypeToRelDataType(typeFactory, columnType, true); } builder.add(columnName, type); diff --git a/sql/src/test/java/org/apache/druid/quidem/DruidQuidemTestBase.java b/sql/src/test/java/org/apache/druid/quidem/DruidQuidemTestBase.java index 0bd8ed4b48af..290bc5184506 100644 --- a/sql/src/test/java/org/apache/druid/quidem/DruidQuidemTestBase.java +++ b/sql/src/test/java/org/apache/druid/quidem/DruidQuidemTestBase.java @@ -29,14 +29,12 @@ import org.apache.calcite.util.Util; import org.apache.commons.io.filefilter.TrueFileFilter; import org.apache.commons.io.filefilter.WildcardFileFilter; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.FileUtils; import org.apache.druid.java.util.common.IAE; import org.apache.druid.java.util.common.RE; import org.apache.druid.java.util.common.StringUtils; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -78,13 +76,8 @@ * */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@ExtendWith(EnabledOnlyInSqlCompatibleMode.class) public abstract class DruidQuidemTestBase { - static { - NullHandling.initializeForTests(); - } - public static final String IQ_SUFFIX = ".iq"; /** * System property name for "overwrite mode"; note: empty value is treated as diff --git a/sql/src/test/java/org/apache/druid/quidem/EnabledOnlyInSqlCompatibleMode.java b/sql/src/test/java/org/apache/druid/quidem/EnabledOnlyInSqlCompatibleMode.java deleted file mode 100644 index 96cf0a72acff..000000000000 --- a/sql/src/test/java/org/apache/druid/quidem/EnabledOnlyInSqlCompatibleMode.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.druid.quidem; - -import org.apache.druid.common.config.NullHandling; -import org.junit.jupiter.api.extension.ConditionEvaluationResult; -import org.junit.jupiter.api.extension.ExecutionCondition; -import org.junit.jupiter.api.extension.ExtensionContext; - -public class EnabledOnlyInSqlCompatibleMode implements ExecutionCondition -{ - static { - NullHandling.initializeForTests(); - } - - @Override - public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) - { - if (NullHandling.sqlCompatible()) { - return ConditionEvaluationResult.enabled("SQL compatible mode is enabled"); - } else { - return ConditionEvaluationResult.disabled("SQL compatible mode is disabled"); - } - } - -} diff --git a/sql/src/test/java/org/apache/druid/sql/avatica/DruidAvaticaHandlerTest.java b/sql/src/test/java/org/apache/druid/sql/avatica/DruidAvaticaHandlerTest.java index 8ee486701a27..86cc2e4a6522 100644 --- a/sql/src/test/java/org/apache/druid/sql/avatica/DruidAvaticaHandlerTest.java +++ b/sql/src/test/java/org/apache/druid/sql/avatica/DruidAvaticaHandlerTest.java @@ -40,7 +40,6 @@ import org.apache.calcite.avatica.MissingResultsException; import org.apache.calcite.avatica.NoSuchStatementException; import org.apache.calcite.avatica.server.AbstractAvaticaHandler; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.guice.LazySingleton; import org.apache.druid.guice.StartupInjectorBuilder; import org.apache.druid.initialization.CoreInjectorBuilder; @@ -158,8 +157,6 @@ public class DruidAvaticaHandlerTest extends CalciteTestBase private static SpecificSegmentsQuerySegmentWalker walker; private static Closer resourceCloser; - private final boolean nullNumeric = !NullHandling.replaceWithDefault(); - @BeforeAll public static void setUpClass(@TempDir File tempDir) { @@ -736,7 +733,7 @@ public void testDatabaseMetaDataColumns() throws SQLException Pair.of("COLUMN_NAME", "cnt"), Pair.of("DATA_TYPE", Types.BIGINT), Pair.of("TYPE_NAME", "BIGINT"), - Pair.of("IS_NULLABLE", nullNumeric ? "YES" : "NO") + Pair.of("IS_NULLABLE", "YES") ), row( Pair.of("TABLE_SCHEM", "druid"), @@ -744,7 +741,7 @@ public void testDatabaseMetaDataColumns() throws SQLException Pair.of("COLUMN_NAME", "m1"), Pair.of("DATA_TYPE", Types.FLOAT), Pair.of("TYPE_NAME", "FLOAT"), - Pair.of("IS_NULLABLE", nullNumeric ? "YES" : "NO") + Pair.of("IS_NULLABLE", "YES") ), row( Pair.of("TABLE_SCHEM", "druid"), @@ -752,7 +749,7 @@ public void testDatabaseMetaDataColumns() throws SQLException Pair.of("COLUMN_NAME", "m2"), Pair.of("DATA_TYPE", Types.DOUBLE), Pair.of("TYPE_NAME", "DOUBLE"), - Pair.of("IS_NULLABLE", nullNumeric ? "YES" : "NO") + Pair.of("IS_NULLABLE", "YES") ), row( Pair.of("TABLE_SCHEM", "druid"), @@ -819,7 +816,7 @@ public void testDatabaseMetaDataColumnsWithSuperuser() throws SQLException Pair.of("COLUMN_NAME", "cnt"), Pair.of("DATA_TYPE", Types.BIGINT), Pair.of("TYPE_NAME", "BIGINT"), - Pair.of("IS_NULLABLE", nullNumeric ? "YES" : "NO") + Pair.of("IS_NULLABLE", "YES") ), row( Pair.of("TABLE_SCHEM", "druid"), @@ -827,7 +824,7 @@ public void testDatabaseMetaDataColumnsWithSuperuser() throws SQLException Pair.of("COLUMN_NAME", "m1"), Pair.of("DATA_TYPE", Types.FLOAT), Pair.of("TYPE_NAME", "FLOAT"), - Pair.of("IS_NULLABLE", nullNumeric ? "YES" : "NO") + Pair.of("IS_NULLABLE", "YES") ), row( Pair.of("TABLE_SCHEM", "druid"), @@ -835,7 +832,7 @@ public void testDatabaseMetaDataColumnsWithSuperuser() throws SQLException Pair.of("COLUMN_NAME", "m2"), Pair.of("DATA_TYPE", Types.DOUBLE), Pair.of("TYPE_NAME", "DOUBLE"), - Pair.of("IS_NULLABLE", nullNumeric ? "YES" : "NO") + Pair.of("IS_NULLABLE", "YES") ), row( Pair.of("TABLE_SCHEM", "druid"), @@ -1608,17 +1605,10 @@ public void testArrayStuff() throws SQLException Assert.assertTrue(rows.get(0).containsKey("arr2")); Assert.assertTrue(rows.get(0).containsKey("arr3")); Assert.assertTrue(rows.get(0).containsKey("arr4")); - if (NullHandling.sqlCompatible()) { - Assert.assertArrayEquals(new Object[]{"a", null, "", "a", "abc", null}, (Object[]) rows.get(0).get("arr1")); - Assert.assertArrayEquals(new Object[]{7L, 325323L, 0L, null, null, null}, (Object[]) rows.get(0).get("arr2")); - Assert.assertArrayEquals(new Object[]{1.0, 1.7, 0.0, null, null, null}, (Object[]) rows.get(0).get("arr3")); - Assert.assertArrayEquals(new Object[]{1.0, 0.10000000149011612, 0.0, null, null, null}, (Object[]) rows.get(0).get("arr4")); - } else { - Assert.assertArrayEquals(new Object[]{"a", null, null, "a", "abc", null}, (Object[]) rows.get(0).get("arr1")); - Assert.assertArrayEquals(new Object[]{7L, 325323L, 0L, 0L, 0L, 0L}, (Object[]) rows.get(0).get("arr2")); - Assert.assertArrayEquals(new Object[]{1.0, 1.7, 0.0, 0.0, 0.0, 0.0}, (Object[]) rows.get(0).get("arr3")); - Assert.assertArrayEquals(new Object[]{1.0, 0.10000000149011612, 0.0, 0.0, 0.0, 0.0}, (Object[]) rows.get(0).get("arr4")); - } + Assert.assertArrayEquals(new Object[]{"a", null, "", "a", "abc", null}, (Object[]) rows.get(0).get("arr1")); + Assert.assertArrayEquals(new Object[]{7L, 325323L, 0L, null, null, null}, (Object[]) rows.get(0).get("arr2")); + Assert.assertArrayEquals(new Object[]{1.0, 1.7, 0.0, null, null, null}, (Object[]) rows.get(0).get("arr3")); + Assert.assertArrayEquals(new Object[]{1.0, 0.10000000149011612, 0.0, null, null, null}, (Object[]) rows.get(0).get("arr4")); } } diff --git a/sql/src/test/java/org/apache/druid/sql/avatica/DruidStatementTest.java b/sql/src/test/java/org/apache/druid/sql/avatica/DruidStatementTest.java index ed855f9c5f86..94b20eb9d65f 100644 --- a/sql/src/test/java/org/apache/druid/sql/avatica/DruidStatementTest.java +++ b/sql/src/test/java/org/apache/druid/sql/avatica/DruidStatementTest.java @@ -25,7 +25,6 @@ import org.apache.calcite.avatica.ColumnMetaData; import org.apache.calcite.avatica.Meta; import org.apache.calcite.avatica.remote.TypedValue; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.io.Closer; import org.apache.druid.math.expr.ExprMacroTable; @@ -306,13 +305,13 @@ public void testSelectAllInFirstFrameDirect() DateTimes.of("2000-01-02").getMillis(), 1L, "10.1", - NullHandling.defaultStringValue(), + null, 2.0f }, new Object[]{DateTimes.of("2000-01-03").getMillis(), 1L, "2", "", 3.0f}, new Object[]{DateTimes.of("2001-01-01").getMillis(), 1L, "1", "a", 4.0f}, new Object[]{DateTimes.of("2001-01-02").getMillis(), 1L, "def", "abc", 5.0f}, - new Object[]{DateTimes.of("2001-01-03").getMillis(), 1L, "abc", NullHandling.defaultStringValue(), 6.0f} + new Object[]{DateTimes.of("2001-01-03").getMillis(), 1L, "abc", null, 6.0f} ) ), frame @@ -438,7 +437,7 @@ private Meta.Frame firstFrameResults() DateTimes.of("2000-01-02").getMillis(), 1L, "10.1", - NullHandling.defaultStringValue(), + null, 2.0f } ) @@ -454,7 +453,7 @@ private Meta.Frame secondFrameResults() new Object[]{DateTimes.of("2000-01-03").getMillis(), 1L, "2", "", 3.0f}, new Object[]{DateTimes.of("2001-01-01").getMillis(), 1L, "1", "a", 4.0f}, new Object[]{DateTimes.of("2001-01-02").getMillis(), 1L, "def", "abc", 5.0f}, - new Object[]{DateTimes.of("2001-01-03").getMillis(), 1L, "abc", NullHandling.defaultStringValue(), 6.0f} + new Object[]{DateTimes.of("2001-01-03").getMillis(), 1L, "abc", null, 6.0f} ) ); } diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java index cfdad72d40be..6a14d4d13c58 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java @@ -40,7 +40,6 @@ import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.java.util.common.granularity.Granularity; import org.apache.druid.java.util.common.logger.Logger; -import org.apache.druid.math.expr.Evals; import org.apache.druid.math.expr.ExprEval; import org.apache.druid.math.expr.ExpressionProcessing; import org.apache.druid.query.DataSource; @@ -58,7 +57,6 @@ import org.apache.druid.query.extraction.CascadeExtractionFn; import org.apache.druid.query.extraction.ExtractionFn; import org.apache.druid.query.filter.AndDimFilter; -import org.apache.druid.query.filter.BoundDimFilter; import org.apache.druid.query.filter.DimFilter; import org.apache.druid.query.filter.EqualityFilter; import org.apache.druid.query.filter.ExpressionDimFilter; @@ -68,12 +66,9 @@ import org.apache.druid.query.filter.NullFilter; import org.apache.druid.query.filter.OrDimFilter; import org.apache.druid.query.filter.RangeFilter; -import org.apache.druid.query.filter.SelectorDimFilter; import org.apache.druid.query.filter.TypedInFilter; import org.apache.druid.query.groupby.GroupByQuery; import org.apache.druid.query.groupby.having.DimFilterHavingSpec; -import org.apache.druid.query.ordering.StringComparator; -import org.apache.druid.query.ordering.StringComparators; import org.apache.druid.query.scan.ScanQuery; import org.apache.druid.query.spec.MultipleIntervalSegmentSpec; import org.apache.druid.query.spec.QuerySegmentSpec; @@ -109,7 +104,6 @@ import org.joda.time.chrono.ISOChronology; import org.junit.Assert; import org.junit.internal.matchers.ThrowableMessageMatcher; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Named; import org.junit.jupiter.api.extension.RegisterExtension; @@ -125,7 +119,6 @@ import java.util.List; import java.util.Map; import java.util.Optional; -import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -142,17 +135,6 @@ public class BaseCalciteQueryTest extends CalciteTestBase { public static final double ASSERTION_EPSILON = 1e-5; - public static String NULL_STRING; - public static Float NULL_FLOAT; - public static Long NULL_LONG; - - @BeforeAll - public static void setupNullValues() - { - NULL_STRING = NullHandling.defaultStringValue(); - NULL_FLOAT = NullHandling.defaultFloatValue(); - NULL_LONG = NullHandling.defaultLongValue(); - } public static final Logger log = new Logger(BaseCalciteQueryTest.class); @@ -208,7 +190,6 @@ public static void setupNullValues() public static final Map QUERY_CONTEXT_NO_STRINGIFY_ARRAY_USE_EQUALITY = ImmutableMap.builder() .putAll(QUERY_CONTEXT_NO_STRINGIFY_ARRAY) - .put(PlannerContext.CTX_SQL_USE_BOUNDS_AND_SELECTORS, false) .build(); public static final Map QUERY_CONTEXT_DONT_SKIP_EMPTY_BUCKETS = ImmutableMap.of( @@ -278,8 +259,6 @@ public static Map getTimeseriesContextWithFloorTime( public static final Map OUTER_LIMIT_CONTEXT = new HashMap<>(QUERY_CONTEXT_DEFAULT); - final boolean useDefault = NullHandling.replaceWithDefault(); - public boolean cannotVectorize = false; public boolean cannotVectorizeUnlessFallback = false; public boolean skipVectorize = false; @@ -348,15 +327,12 @@ public static IsTrueDimFilter istrue(DimFilter filter) public static DimFilter in(String dimension, Collection values) { - if (NullHandling.sqlCompatible()) { - return in(dimension, ColumnType.STRING, new ArrayList<>(values)); - } - return new InDimFilter(dimension, values, null); + return in(dimension, ColumnType.STRING, new ArrayList<>(values)); } public static DimFilter in(String dimension, Collection values, ExtractionFn extractionFn) { - if (NullHandling.sqlCompatible() && extractionFn == null) { + if (extractionFn == null) { return in(dimension, ColumnType.STRING, new ArrayList<>(values)); } return new InDimFilter(dimension, values, extractionFn); @@ -364,11 +340,7 @@ public static DimFilter in(String dimension, Collection values, Extracti public static DimFilter in(String dimension, ColumnType matchValueType, List values) { - if (NullHandling.sqlCompatible()) { - return new TypedInFilter(dimension, matchValueType, values, null, null); - } - Set set = values.stream().map(Evals::asString).collect(Collectors.toSet()); - return in(dimension, set, null); + return new TypedInFilter(dimension, matchValueType, values, null, null); } public static DimFilter isNull(final String fieldName) @@ -378,10 +350,7 @@ public static DimFilter isNull(final String fieldName) public static DimFilter isNull(final String fieldName, final ExtractionFn extractionFn) { - if (NullHandling.sqlCompatible()) { - return new NullFilter(fieldName, null); - } - return selector(fieldName, NullHandling.defaultStringValue(), extractionFn); + return new NullFilter(fieldName, null); } public static DimFilter notNull(final String fieldName) @@ -391,32 +360,7 @@ public static DimFilter notNull(final String fieldName) public static DimFilter equality(final String fieldName, final Object matchValue, final ColumnType matchValueType) { - if (NullHandling.sqlCompatible()) { - return new EqualityFilter(fieldName, matchValueType, matchValue, null); - } - return selector(fieldName, Evals.asString(matchValue), null); - } - - /** - * Callers should use {@link #equality(String, Object, ColumnType)} instead of this method, since they will correctly - * use either a {@link EqualityFilter} or {@link SelectorDimFilter} depending on the value of - * {@link NullHandling#sqlCompatible()}, which determines the default of - * {@link PlannerContext#CTX_SQL_USE_BOUNDS_AND_SELECTORS} - */ - public static SelectorDimFilter selector(final String fieldName, final String value) - { - return selector(fieldName, value, null); - } - - /** - * Callers should use {@link #equality(String, Object, ColumnType)} instead of this method, since they will correctly - * use either a {@link EqualityFilter} or {@link SelectorDimFilter} depending on the value of - * {@link NullHandling#sqlCompatible()}, which determines the default of - * {@link PlannerContext#CTX_SQL_USE_BOUNDS_AND_SELECTORS} - */ - public static SelectorDimFilter selector(final String fieldName, final String value, final ExtractionFn extractionFn) - { - return new SelectorDimFilter(fieldName, value, extractionFn); + return new EqualityFilter(fieldName, matchValueType, matchValue, null); } public static ExpressionDimFilter expressionFilter(final String expression) @@ -424,73 +368,6 @@ public static ExpressionDimFilter expressionFilter(final String expression) return new ExpressionDimFilter(expression, CalciteTests.createExprMacroTable()); } - /** - * This method should be used instead of {@link #equality(String, Object, ColumnType)} when the match value type - * does not match the column type. If {@link NullHandling#sqlCompatible()} is true, this method is equivalent to - * {@link #equality(String, Object, ColumnType)}. When false, this method uses - * {@link #numericSelector(String, String)} so that the equality comparison uses a bound filter to correctly match - * numerical types. - */ - public static DimFilter numericEquality( - final String fieldName, - final Object value, - final ColumnType matchValueType - ) - { - if (NullHandling.sqlCompatible()) { - return equality(fieldName, value, matchValueType); - } - return numericSelector(fieldName, String.valueOf(value)); - } - - public static DimFilter numericSelector( - final String fieldName, - final String value - ) - { - // We use Bound filters for numeric equality to achieve "10.0" = "10" - return bound(fieldName, value, value, false, false, null, StringComparators.NUMERIC); - } - - /** - * Callers should use {@link #range(String, ColumnType, Object, Object, boolean, boolean)} instead of this method, - * since they will correctly use either a {@link RangeFilter} or {@link BoundDimFilter} depending on the value of - * {@link NullHandling#sqlCompatible()}, which determines the default of - * {@link PlannerContext#CTX_SQL_USE_BOUNDS_AND_SELECTORS} - */ - public static BoundDimFilter bound( - final String fieldName, - final String lower, - final String upper, - final boolean lowerStrict, - final boolean upperStrict, - final ExtractionFn extractionFn, - final StringComparator comparator - ) - { - return new BoundDimFilter(fieldName, lower, upper, lowerStrict, upperStrict, null, extractionFn, comparator); - } - - /** - * Callers should use {@link #timeRange(Object)} instead of this method, since it will correctly use either a - * {@link RangeFilter} or {@link BoundDimFilter} depending on the value of {@link NullHandling#sqlCompatible()}, - * which determines the default of {@link PlannerContext#CTX_SQL_USE_BOUNDS_AND_SELECTORS} - */ - public static BoundDimFilter timeBound(final Object intervalObj) - { - final Interval interval = new Interval(intervalObj, ISOChronology.getInstanceUTC()); - return new BoundDimFilter( - ColumnHolder.TIME_COLUMN_NAME, - String.valueOf(interval.getStartMillis()), - String.valueOf(interval.getEndMillis()), - false, - true, - null, - null, - StringComparators.NUMERIC - ); - } - public static DimFilter range( final String fieldName, final ColumnType matchValueType, @@ -500,35 +377,20 @@ public static DimFilter range( final boolean upperStrict ) { - if (NullHandling.sqlCompatible()) { - return new RangeFilter(fieldName, matchValueType, lower, upper, lowerStrict, upperStrict, null); - } - return new BoundDimFilter( - fieldName, - Evals.asString(lower), - Evals.asString(upper), - lowerStrict, - upperStrict, - false, - null, - matchValueType.isNumeric() ? StringComparators.NUMERIC : StringComparators.LEXICOGRAPHIC - ); + return new RangeFilter(fieldName, matchValueType, lower, upper, lowerStrict, upperStrict, null); } public static DimFilter timeRange(final Object intervalObj) { final Interval interval = new Interval(intervalObj, ISOChronology.getInstanceUTC()); - if (NullHandling.sqlCompatible()) { - return range( - ColumnHolder.TIME_COLUMN_NAME, - ColumnType.LONG, - interval.getStartMillis(), - interval.getEndMillis(), - false, - true - ); - } - return timeBound(intervalObj); + return range( + ColumnHolder.TIME_COLUMN_NAME, + ColumnType.LONG, + interval.getStartMillis(), + interval.getEndMillis(), + false, + true + ); } public static CascadeExtractionFn cascade(final ExtractionFn... fns) @@ -1018,7 +880,6 @@ void validate(int row, int column, ValueType type, Object expectedCell, Object r if (resultCell == null) { return; } - expectedCell = NullHandling.defaultValueForType(type); } EQUALS.validate(row, column, type, expectedCell, resultCell); } @@ -1070,7 +931,6 @@ void validate(int row, int column, ValueType type, Object expectedCell, Object r if (resultCell == null) { return; } - expectedCell = NullHandling.defaultValueForType(type); } EQUALS_EPS.validate(row, column, type, expectedCell, resultCell); } @@ -1134,7 +994,6 @@ void validate(int row, int column, ValueType type, Object expectedCell, Object r if (resultCell == null) { return; } - expectedCell = NullHandling.defaultValueForType(type); } EQUALS_RELATIVE_1000_ULPS.validate(row, column, type, expectedCell, resultCell); } @@ -1160,9 +1019,6 @@ private static Object[] homogenizeArray(Object array) /** * Validates the results with slight loosening in case {@link NullHandling} is not sql compatible. - * - * In case {@link NullHandling#replaceWithDefault()} is true, if the expected result is null it accepts - * both null and the default value for that column as actual result. */ public void assertResultsValid(final ResultMatchMode matchMode, final List expected, final QueryResults queryResults) { diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index 9d5eaf51a887..4dfe4c84c0e6 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -23,7 +23,6 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import org.apache.calcite.avatica.SqlType; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.HumanReadableBytes; import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.StringUtils; @@ -265,7 +264,7 @@ public void testSelectNonConstantArrayExpressionFromTableForMultival() new Object[]{"[[\"bword\",\"up\"],[\"cword\",\"up\"]]", "10.1"}, new Object[]{"[[\"dword\",\"up\"]]", "2"}, new Object[]{"[[\"word\",\"up\"]]", "1"}, - useDefault ? new Object[]{"[[\"word\",\"up\"]]", "def"} : new Object[]{"[[null,\"up\"]]", "def"} + new Object[]{"[[null,\"up\"]]", "def"} ) ); @@ -274,64 +273,33 @@ public void testSelectNonConstantArrayExpressionFromTableForMultival() @Test public void testSomeArrayFunctionsWithScanQuery() { - List expectedResults; - if (useDefault) { - expectedResults = ImmutableList.of( - new Object[]{ - "", - "a", - "[\"a\",\"b\"]", - 7L, - 0L, - 1.0, - 0.0, - "[\"a\",\"b\",\"c\"]", - "[1,2,3]", - "[1.9,2.2,4.3]", - "[\"a\",\"b\",\"foo\"]", - "[\"foo\",\"a\"]", - "[1,2,7]", - "[0,1,2]", - "[1.2,2.2,1.0]", - "[0.0,1.1,2.2]", - "[\"a\",\"a\",\"b\"]", - "[7,0]", - "[1.0,0.0]", - 7L, - 1.0, - 7L, - 1.0 - } - ); - } else { - expectedResults = ImmutableList.of( - new Object[]{ - "", - "a", - "[\"a\",\"b\"]", - 7L, - null, - 1.0, - null, - "[\"a\",\"b\",\"c\"]", - "[1,2,3]", - "[1.9,2.2,4.3]", - "[\"a\",\"b\",\"foo\"]", - "[\"foo\",\"a\"]", - "[1,2,7]", - "[null,1,2]", - "[1.2,2.2,1.0]", - "[null,1.1,2.2]", - "[\"a\",\"a\",\"b\"]", - "[7,null]", - "[1.0,null]", - 7L, - 1.0, - 7L, - 1.0 - } - ); - } + List expectedResults = ImmutableList.of( + new Object[]{ + "", + "a", + "[\"a\",\"b\"]", + 7L, + null, + 1.0, + null, + "[\"a\",\"b\",\"c\"]", + "[1,2,3]", + "[1.9,2.2,4.3]", + "[\"a\",\"b\",\"foo\"]", + "[\"foo\",\"a\"]", + "[1,2,7]", + "[null,1,2]", + "[1.2,2.2,1.0]", + "[null,1.1,2.2]", + "[\"a\",\"a\",\"b\"]", + "[7,null]", + "[1.0,null]", + 7L, + 1.0, + 7L, + 1.0 + } + ); RowSignature resultSignature = RowSignature.builder() .add("dim1", ColumnType.STRING) .add("dim2", ColumnType.STRING) @@ -450,42 +418,288 @@ public void testSomeArrayFunctionsWithScanQuery() @Test public void testSomeArrayFunctionsWithScanQueryArrayColumns() { - List expectedResults; - if (useDefault) { - expectedResults = ImmutableList.of( - new Object[]{null, "[]", null, null, null, "[1]", "[2]", null, null, null, "[1,2,3]", null, "", null, null, "", null, null}, - new Object[]{"[\"a\",\"b\"]", "[2,3]", "[null]", "[\"a\",\"b\",\"foo\"]", "[\"foo\",\"a\",\"b\"]", "[2,3,1]", "[2,2,3]", "[null,1.1]", "[2.2,null]", null, null, null, "a", 2L, 0.0D, "a", 2L, 0.0D}, - new Object[]{"[\"b\",\"b\"]", "[1]", null, "[\"b\",\"b\",\"foo\"]", "[\"foo\",\"b\",\"b\"]", "[1,1]", "[2,1]", null, null, "[\"d\",\"e\",\"b\",\"b\"]", "[1,4,1]", null, "b", 1L, null, "b", 1L, null}, - new Object[]{null, "[null,2,9]", "[999.0,5.5,null]", null, null, "[null,2,9,1]", "[2,null,2,9]", "[999.0,5.5,null,1.1]", "[2.2,999.0,5.5,null]", null, null, null, "", 0L, 999.0D, "", 0L, 999.0D}, - new Object[]{"[\"a\",\"b\"]", "[1,null,3]", "[1.1,2.2,null]", "[\"a\",\"b\",\"foo\"]", "[\"foo\",\"a\",\"b\"]", "[1,null,3,1]", "[2,1,null,3]", "[1.1,2.2,null,1.1]", "[2.2,1.1,2.2,null]", "[\"a\",\"b\",\"a\",\"b\"]", "[1,2,3,1,null,3]", "[1.1,2.2,3.3,1.1,2.2,null]", "a", 1L, 1.1D, "a", 1L, 1.1D}, - new Object[]{"[\"d\",null,\"b\"]", "[1,2,3]", "[null,2.2,null]", "[\"d\",null,\"b\",\"foo\"]", "[\"foo\",\"d\",null,\"b\"]", "[1,2,3,1]", "[2,1,2,3]", "[null,2.2,null,1.1]", "[2.2,null,2.2,null]", "[\"b\",\"c\",\"d\",null,\"b\"]", "[1,2,3,4,1,2,3]", "[1.1,3.3,null,2.2,null]", "d", 1L, 0.0D, "d", 1L, 0.0D}, - new Object[]{"[null,\"b\"]", null, "[999.0,null,5.5]", "[null,\"b\",\"foo\"]", "[\"foo\",null,\"b\"]", null, null, "[999.0,null,5.5,1.1]", "[2.2,999.0,null,5.5]", "[\"a\",\"b\",\"c\",null,\"b\"]", null, "[3.3,4.4,5.5,999.0,null,5.5]", "", null, 999.0D, "", null, 999.0D}, - new Object[]{null, null, "[]", null, null, null, null, "[1.1]", "[2.2]", null, null, "[1.1,2.2,3.3]", "", null, null, "", null, null}, - new Object[]{"[\"a\",\"b\"]", "[2,3]", "[null,1.1]", "[\"a\",\"b\",\"foo\"]", "[\"foo\",\"a\",\"b\"]", "[2,3,1]", "[2,2,3]", "[null,1.1,1.1]", "[2.2,null,1.1]", null, null, null, "a", 2L, 0.0D, "a", 2L, 0.0D}, - new Object[]{"[\"b\",\"b\"]", "[null]", null, "[\"b\",\"b\",\"foo\"]", "[\"foo\",\"b\",\"b\"]", "[null,1]", "[2,null]", null, null, "[\"d\",\"e\",\"b\",\"b\"]", "[1,4,null]", null, "b", 0L, null, "b", 0L, null}, - new Object[]{"[null]", "[null,2,9]", "[999.0,5.5,null]", "[null,\"foo\"]", "[\"foo\",null]", "[null,2,9,1]", "[2,null,2,9]", "[999.0,5.5,null,1.1]", "[2.2,999.0,5.5,null]", "[\"a\",\"b\",null]", null, null, "", 0L, 999.0D, "", 0L, 999.0D}, - new Object[]{"[]", "[1,null,3]", "[1.1,2.2,null]", "[\"foo\"]", "[\"foo\"]", "[1,null,3,1]", "[2,1,null,3]", "[1.1,2.2,null,1.1]", "[2.2,1.1,2.2,null]", "[\"a\",\"b\"]", "[1,2,3,1,null,3]", "[1.1,2.2,3.3,1.1,2.2,null]", "", 1L, 1.1D, "", 1L, 1.1D}, - new Object[]{"[\"d\",null,\"b\"]", "[1,2,3]", "[null,2.2,null]", "[\"d\",null,\"b\",\"foo\"]", "[\"foo\",\"d\",null,\"b\"]", "[1,2,3,1]", "[2,1,2,3]", "[null,2.2,null,1.1]", "[2.2,null,2.2,null]", "[\"b\",\"c\",\"d\",null,\"b\"]", "[1,2,3,4,1,2,3]", "[1.1,3.3,null,2.2,null]", "d", 1L, 0.0D, "d", 1L, 0.0D}, - new Object[]{"[null,\"b\"]", null, "[999.0,null,5.5]", "[null,\"b\",\"foo\"]", "[\"foo\",null,\"b\"]", null, null, "[999.0,null,5.5,1.1]", "[2.2,999.0,null,5.5]", "[\"a\",\"b\",\"c\",null,\"b\"]", null, "[3.3,4.4,5.5,999.0,null,5.5]", "", null, 999.0D, "", null, 999.0D} - ); - } else { - expectedResults = ImmutableList.of( - new Object[]{null, "[]", null, null, null, "[1]", "[2]", null, null, null, "[1,2,3]", null, null, null, null, null, null, null}, - new Object[]{"[\"a\",\"b\"]", "[2,3]", "[null]", "[\"a\",\"b\",\"foo\"]", "[\"foo\",\"a\",\"b\"]", "[2,3,1]", "[2,2,3]", "[null,1.1]", "[2.2,null]", null, null, null, "a", 2L, null, "a", 2L, null}, - new Object[]{"[\"b\",\"b\"]", "[1]", null, "[\"b\",\"b\",\"foo\"]", "[\"foo\",\"b\",\"b\"]", "[1,1]", "[2,1]", null, null, "[\"d\",\"e\",\"b\",\"b\"]", "[1,4,1]", null, "b", 1L, null, "b", 1L, null}, - new Object[]{null, "[null,2,9]", "[999.0,5.5,null]", null, null, "[null,2,9,1]", "[2,null,2,9]", "[999.0,5.5,null,1.1]", "[2.2,999.0,5.5,null]", null, null, null, null, null, 999.0D, null, null, 999.0D}, - new Object[]{"[\"a\",\"b\"]", "[1,null,3]", "[1.1,2.2,null]", "[\"a\",\"b\",\"foo\"]", "[\"foo\",\"a\",\"b\"]", "[1,null,3,1]", "[2,1,null,3]", "[1.1,2.2,null,1.1]", "[2.2,1.1,2.2,null]", "[\"a\",\"b\",\"a\",\"b\"]", "[1,2,3,1,null,3]", "[1.1,2.2,3.3,1.1,2.2,null]", "a", 1L, 1.1D, "a", 1L, 1.1D}, - new Object[]{"[\"d\",null,\"b\"]", "[1,2,3]", "[null,2.2,null]", "[\"d\",null,\"b\",\"foo\"]", "[\"foo\",\"d\",null,\"b\"]", "[1,2,3,1]", "[2,1,2,3]", "[null,2.2,null,1.1]", "[2.2,null,2.2,null]", "[\"b\",\"c\",\"d\",null,\"b\"]", "[1,2,3,4,1,2,3]", "[1.1,3.3,null,2.2,null]", "d", 1L, null, "d", 1L, null}, - new Object[]{"[null,\"b\"]", null, "[999.0,null,5.5]", "[null,\"b\",\"foo\"]", "[\"foo\",null,\"b\"]", null, null, "[999.0,null,5.5,1.1]", "[2.2,999.0,null,5.5]", "[\"a\",\"b\",\"c\",null,\"b\"]", null, "[3.3,4.4,5.5,999.0,null,5.5]", null, null, 999.0D, null, null, 999.0D}, - new Object[]{null, null, "[]", null, null, null, null, "[1.1]", "[2.2]", null, null, "[1.1,2.2,3.3]", null, null, null, null, null, null}, - new Object[]{"[\"a\",\"b\"]", "[2,3]", "[null,1.1]", "[\"a\",\"b\",\"foo\"]", "[\"foo\",\"a\",\"b\"]", "[2,3,1]", "[2,2,3]", "[null,1.1,1.1]", "[2.2,null,1.1]", null, null, null, "a", 2L, null, "a", 2L, null}, - new Object[]{"[\"b\",\"b\"]", "[null]", null, "[\"b\",\"b\",\"foo\"]", "[\"foo\",\"b\",\"b\"]", "[null,1]", "[2,null]", null, null, "[\"d\",\"e\",\"b\",\"b\"]", "[1,4,null]", null, "b", null, null, "b", null, null}, - new Object[]{"[null]", "[null,2,9]", "[999.0,5.5,null]", "[null,\"foo\"]", "[\"foo\",null]", "[null,2,9,1]", "[2,null,2,9]", "[999.0,5.5,null,1.1]", "[2.2,999.0,5.5,null]", "[\"a\",\"b\",null]", null, null, null, null, 999.0D, null, null, 999.0D}, - new Object[]{"[]", "[1,null,3]", "[1.1,2.2,null]", "[\"foo\"]", "[\"foo\"]", "[1,null,3,1]", "[2,1,null,3]", "[1.1,2.2,null,1.1]", "[2.2,1.1,2.2,null]", "[\"a\",\"b\"]", "[1,2,3,1,null,3]", "[1.1,2.2,3.3,1.1,2.2,null]", null, 1L, 1.1D, null, 1L, 1.1D}, - new Object[]{"[\"d\",null,\"b\"]", "[1,2,3]", "[null,2.2,null]", "[\"d\",null,\"b\",\"foo\"]", "[\"foo\",\"d\",null,\"b\"]", "[1,2,3,1]", "[2,1,2,3]", "[null,2.2,null,1.1]", "[2.2,null,2.2,null]", "[\"b\",\"c\",\"d\",null,\"b\"]", "[1,2,3,4,1,2,3]", "[1.1,3.3,null,2.2,null]", "d", 1L, null, "d", 1L, null}, - new Object[]{"[null,\"b\"]", null, "[999.0,null,5.5]", "[null,\"b\",\"foo\"]", "[\"foo\",null,\"b\"]", null, null, "[999.0,null,5.5,1.1]", "[2.2,999.0,null,5.5]", "[\"a\",\"b\",\"c\",null,\"b\"]", null, "[3.3,4.4,5.5,999.0,null,5.5]", null, null, 999.0D, null, null, 999.0D} - ); - } + List expectedResults = ImmutableList.of( + new Object[]{ + null, + "[]", + null, + null, + null, + "[1]", + "[2]", + null, + null, + null, + "[1,2,3]", + null, + null, + null, + null, + null, + null, + null + }, + new Object[]{ + "[\"a\",\"b\"]", + "[2,3]", + "[null]", + "[\"a\",\"b\",\"foo\"]", + "[\"foo\",\"a\",\"b\"]", + "[2,3,1]", + "[2,2,3]", + "[null,1.1]", + "[2.2,null]", + null, + null, + null, + "a", + 2L, + null, + "a", + 2L, + null + }, + new Object[]{ + "[\"b\",\"b\"]", + "[1]", + null, + "[\"b\",\"b\",\"foo\"]", + "[\"foo\",\"b\",\"b\"]", + "[1,1]", + "[2,1]", + null, + null, + "[\"d\",\"e\",\"b\",\"b\"]", + "[1,4,1]", + null, + "b", + 1L, + null, + "b", + 1L, + null + }, + new Object[]{ + null, + "[null,2,9]", + "[999.0,5.5,null]", + null, + null, + "[null,2,9,1]", + "[2,null,2,9]", + "[999.0,5.5,null,1.1]", + "[2.2,999.0,5.5,null]", + null, + null, + null, + null, + null, + 999.0D, + null, + null, + 999.0D + }, + new Object[]{ + "[\"a\",\"b\"]", + "[1,null,3]", + "[1.1,2.2,null]", + "[\"a\",\"b\",\"foo\"]", + "[\"foo\",\"a\",\"b\"]", + "[1,null,3,1]", + "[2,1,null,3]", + "[1.1,2.2,null,1.1]", + "[2.2,1.1,2.2,null]", + "[\"a\",\"b\",\"a\",\"b\"]", + "[1,2,3,1,null,3]", + "[1.1,2.2,3.3,1.1,2.2,null]", + "a", + 1L, + 1.1D, + "a", + 1L, + 1.1D + }, + new Object[]{ + "[\"d\",null,\"b\"]", + "[1,2,3]", + "[null,2.2,null]", + "[\"d\",null,\"b\",\"foo\"]", + "[\"foo\",\"d\",null,\"b\"]", + "[1,2,3,1]", + "[2,1,2,3]", + "[null,2.2,null,1.1]", + "[2.2,null,2.2,null]", + "[\"b\",\"c\",\"d\",null,\"b\"]", + "[1,2,3,4,1,2,3]", + "[1.1,3.3,null,2.2,null]", + "d", + 1L, + null, + "d", + 1L, + null + }, + new Object[]{ + "[null,\"b\"]", + null, + "[999.0,null,5.5]", + "[null,\"b\",\"foo\"]", + "[\"foo\",null,\"b\"]", + null, + null, + "[999.0,null,5.5,1.1]", + "[2.2,999.0,null,5.5]", + "[\"a\",\"b\",\"c\",null,\"b\"]", + null, + "[3.3,4.4,5.5,999.0,null,5.5]", + null, + null, + 999.0D, + null, + null, + 999.0D + }, + new Object[]{ + null, + null, + "[]", + null, + null, + null, + null, + "[1.1]", + "[2.2]", + null, + null, + "[1.1,2.2,3.3]", + null, + null, + null, + null, + null, + null + }, + new Object[]{ + "[\"a\",\"b\"]", + "[2,3]", + "[null,1.1]", + "[\"a\",\"b\",\"foo\"]", + "[\"foo\",\"a\",\"b\"]", + "[2,3,1]", + "[2,2,3]", + "[null,1.1,1.1]", + "[2.2,null,1.1]", + null, + null, + null, + "a", + 2L, + null, + "a", + 2L, + null + }, + new Object[]{ + "[\"b\",\"b\"]", + "[null]", + null, + "[\"b\",\"b\",\"foo\"]", + "[\"foo\",\"b\",\"b\"]", + "[null,1]", + "[2,null]", + null, + null, + "[\"d\",\"e\",\"b\",\"b\"]", + "[1,4,null]", + null, + "b", + null, + null, + "b", + null, + null + }, + new Object[]{ + "[null]", + "[null,2,9]", + "[999.0,5.5,null]", + "[null,\"foo\"]", + "[\"foo\",null]", + "[null,2,9,1]", + "[2,null,2,9]", + "[999.0,5.5,null,1.1]", + "[2.2,999.0,5.5,null]", + "[\"a\",\"b\",null]", + null, + null, + null, + null, + 999.0D, + null, + null, + 999.0D + }, + new Object[]{ + "[]", + "[1,null,3]", + "[1.1,2.2,null]", + "[\"foo\"]", + "[\"foo\"]", + "[1,null,3,1]", + "[2,1,null,3]", + "[1.1,2.2,null,1.1]", + "[2.2,1.1,2.2,null]", + "[\"a\",\"b\"]", + "[1,2,3,1,null,3]", + "[1.1,2.2,3.3,1.1,2.2,null]", + null, + 1L, + 1.1D, + null, + 1L, + 1.1D + }, + new Object[]{ + "[\"d\",null,\"b\"]", + "[1,2,3]", + "[null,2.2,null]", + "[\"d\",null,\"b\",\"foo\"]", + "[\"foo\",\"d\",null,\"b\"]", + "[1,2,3,1]", + "[2,1,2,3]", + "[null,2.2,null,1.1]", + "[2.2,null,2.2,null]", + "[\"b\",\"c\",\"d\",null,\"b\"]", + "[1,2,3,4,1,2,3]", + "[1.1,3.3,null,2.2,null]", + "d", + 1L, + null, + "d", + 1L, + null + }, + new Object[]{ + "[null,\"b\"]", + null, + "[999.0,null,5.5]", + "[null,\"b\",\"foo\"]", + "[\"foo\",null,\"b\"]", + null, + null, + "[999.0,null,5.5,1.1]", + "[2.2,999.0,null,5.5]", + "[\"a\",\"b\",\"c\",null,\"b\"]", + null, + "[3.3,4.4,5.5,999.0,null,5.5]", + null, + null, + 999.0D, + null, + null, + 999.0D + } + ); RowSignature resultSignature = RowSignature.builder() .add("arrayStringNulls", ColumnType.STRING_ARRAY) .add("arrayLongNulls", ColumnType.LONG_ARRAY) @@ -587,48 +801,25 @@ public void testSomeArrayFunctionsWithScanQueryNoStringify() // which will still always be stringified to ultimately adhere to the varchar type // as array support increases in the engine this will likely change since using explict array functions should // probably kick it into an array - List expectedResults; - if (useDefault) { - expectedResults = ImmutableList.of( - new Object[]{ - "", - "a", - "[\"a\",\"b\"]", - Arrays.asList("a", "b", "c"), - Arrays.asList(1L, 2L, 3L), - Arrays.asList(1.9, 2.2, 4.3), - Arrays.asList("a", "b", "foo"), - Arrays.asList("foo", "a"), - Arrays.asList(1L, 2L, 7L), - Arrays.asList(0L, 1L, 2L), - Arrays.asList(1.2, 2.2, 1.0), - Arrays.asList(0.0, 1.1, 2.2), - Arrays.asList("a", "a", "b"), - Arrays.asList(7L, 0L), - Arrays.asList(1.0, 0.0) - } - ); - } else { - expectedResults = ImmutableList.of( - new Object[]{ - "", - "a", - "[\"a\",\"b\"]", - Arrays.asList("a", "b", "c"), - Arrays.asList(1L, 2L, 3L), - Arrays.asList(1.9, 2.2, 4.3), - Arrays.asList("a", "b", "foo"), - Arrays.asList("foo", "a"), - Arrays.asList(1L, 2L, 7L), - Arrays.asList(null, 1L, 2L), - Arrays.asList(1.2, 2.2, 1.0), - Arrays.asList(null, 1.1, 2.2), - Arrays.asList("a", "a", "b"), - Arrays.asList(7L, null), - Arrays.asList(1.0, null) - } - ); - } + List expectedResults = ImmutableList.of( + new Object[]{ + "", + "a", + "[\"a\",\"b\"]", + Arrays.asList("a", "b", "c"), + Arrays.asList(1L, 2L, 3L), + Arrays.asList(1.9, 2.2, 4.3), + Arrays.asList("a", "b", "foo"), + Arrays.asList("foo", "a"), + Arrays.asList(1L, 2L, 7L), + Arrays.asList(null, 1L, 2L), + Arrays.asList(1.2, 2.2, 1.0), + Arrays.asList(null, 1.1, 2.2), + Arrays.asList("a", "a", "b"), + Arrays.asList(7L, null), + Arrays.asList(1.0, null) + } + ); testQuery( "SELECT" + " dim1," @@ -969,15 +1160,12 @@ public void testArrayOverlapFilterWithDynamicParameter() "SELECT dim3 FROM druid.numfoo WHERE ARRAY_OVERLAP(?, ARRAY[dbl1]) LIMIT 5", CalciteTests.REGULAR_USER_AUTH_RESULT, ImmutableList.of(builder.build()), - NullHandling.sqlCompatible() ? ImmutableList.of( + ImmutableList.of( new Object[]{"[\"a\",\"b\"]"}, new Object[]{"[\"b\",\"c\"]"}, new Object[]{""}, new Object[]{null}, new Object[]{null} - ) : ImmutableList.of( - new Object[]{"[\"a\",\"b\"]"}, - new Object[]{"[\"b\",\"c\"]"} ) ); } @@ -1110,24 +1298,14 @@ public void testArrayContainsFilterWithExtractionFn() .columnTypes(ColumnType.STRING) .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) .limit(5) - .context(QUERY_CONTEXT_DEFAULT); - - if (NullHandling.sqlCompatible()) { - builder = builder.virtualColumns(expressionVirtualColumn("v0", "substring(\"dim3\", 0, 1)", ColumnType.STRING)) - .filters( - and( - equality("v0", "a", ColumnType.STRING), - equality("v0", "b", ColumnType.STRING) - ) - ); - } else { - builder = builder.filters( - and( - selector("dim3", "a", new SubstringDimExtractionFn(0, 1)), - selector("dim3", "b", new SubstringDimExtractionFn(0, 1)) - ) - ); - } + .context(QUERY_CONTEXT_DEFAULT) + .virtualColumns(expressionVirtualColumn("v0", "substring(\"dim3\", 0, 1)", ColumnType.STRING)) + .filters( + and( + equality("v0", "a", ColumnType.STRING), + equality("v0", "b", ColumnType.STRING) + ) + ); testQuery( "SELECT dim3 FROM druid.numfoo WHERE ARRAY_CONTAINS(SUBSTRING(dim3, 1, 1), ARRAY['a','b']) LIMIT 5", ImmutableList.of(builder.build()), @@ -1230,10 +1408,10 @@ public void testArrayContainsArrayStringColumns() .build() ), ImmutableList.of( - new Object[]{NullHandling.sqlCompatible() ? null : false, NullHandling.sqlCompatible() ? null : false}, + new Object[]{null, null}, new Object[]{true, false}, new Object[]{false, false}, - new Object[]{NullHandling.sqlCompatible() ? null : false, NullHandling.sqlCompatible() ? null : false}, + new Object[]{null, null}, new Object[]{true, true} ) ); @@ -1296,11 +1474,10 @@ public void testArrayContainsConstantNull() testQuery( "SELECT ARRAY_CONTAINS(null, ARRAY['a','b'])", ImmutableList.of( - NullHandling.sqlCompatible() - ? newScanQueryBuilder() + newScanQueryBuilder() .dataSource( InlineDataSource.fromIterable( - ImmutableList.of(new Object[]{NullHandling.defaultLongValue()}), + ImmutableList.of(new Object[]{null}), RowSignature.builder().add("EXPR$0", ColumnType.LONG).build() ) ) @@ -1310,23 +1487,9 @@ public void testArrayContainsConstantNull() .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) .context(QUERY_CONTEXT_DEFAULT) .build() - : newScanQueryBuilder() - .dataSource( - InlineDataSource.fromIterable( - ImmutableList.of(new Object[]{0L}), - RowSignature.builder().add("ZERO", ColumnType.LONG).build() - ) - ) - .virtualColumns(expressionVirtualColumn("v0", "0", ColumnType.LONG)) - .intervals(querySegmentSpec(Filtration.eternity())) - .columns("v0") - .columnTypes(ColumnType.LONG) - .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) - .context(QUERY_CONTEXT_DEFAULT) - .build() ), ImmutableList.of( - new Object[]{NullHandling.sqlCompatible() ? null : false} + new Object[]{null} ) ); } @@ -1353,13 +1516,11 @@ public void testArrayContainsFilterWithDynamicParameter() "SELECT dim3 FROM druid.numfoo WHERE ARRAY_CONTAINS(?, ARRAY[dbl1>1]) LIMIT 5", CalciteTests.REGULAR_USER_AUTH_RESULT, ImmutableList.of(builder.build()), - NullHandling.sqlCompatible() ? ImmutableList.of( + ImmutableList.of( new Object[]{"[\"b\",\"c\"]"}, new Object[]{""}, new Object[]{null}, new Object[]{null} - ) : ImmutableList.of( - new Object[]{"[\"b\",\"c\"]"} ) ); } @@ -1379,28 +1540,18 @@ public void testScalarInArrayFilter() .intervals(querySegmentSpec(Filtration.eternity())) .virtualColumns( VirtualColumns.create( - NullHandling.sqlCompatible() - ? ImmutableList.of( + ImmutableList.of( expressionVirtualColumn("v0", "substring(\"dim1\", 0, 1)", ColumnType.STRING), expressionVirtualColumn("v1", "(\"cnt\" * 2)", ColumnType.LONG) ) - : ImmutableList.of( - expressionVirtualColumn("v0", "(\"cnt\" * 2)", ColumnType.LONG) - ) ) ) .filters( - NullHandling.sqlCompatible() - ? or( + or( in("dim2", Arrays.asList("a", "d")), in("v0", Arrays.asList(null, "foo", "bar")), in("v1", ColumnType.LONG, Collections.singletonList(3L)) ) - : or( - in("dim2", Arrays.asList("a", "d")), - in("dim1", Arrays.asList(null, "foo", "bar"), new SubstringDimExtractionFn(0, 1)), - in("v0", ColumnType.LONG, Collections.singletonList(3L)) - ) ) .columns("dim2") .columnTypes(ColumnType.STRING) @@ -1432,17 +1583,10 @@ public void testNotScalarInArrayFilter() .context(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.sqlCompatible() - ? ImmutableList.of( + ImmutableList.of( new Object[]{""}, new Object[]{"abc"} ) - : ImmutableList.of( - new Object[]{""}, - new Object[]{""}, - new Object[]{"abc"}, - new Object[]{""} - ) ); } @@ -1454,7 +1598,7 @@ public void testArrayScalarInFilter_MVD() // The DimensionSelector returns an empty list; the ColumnValueSelector returns a list containing a single null. final String expectedValueForEmptyMvd = queryFramework().engine().name().equals("msq-task") - ? NullHandling.defaultStringValue() + ? null : "not abd"; testBuilder() @@ -1487,8 +1631,8 @@ public void testArrayScalarInFilter_MVD() new Object[]{"[\"b\",\"c\"]", "[\"abd\",\"not abd\"]"}, new Object[]{"d", "abd"}, new Object[]{"", "not abd"}, - new Object[]{NullHandling.defaultStringValue(), expectedValueForEmptyMvd}, - new Object[]{NullHandling.defaultStringValue(), "not abd"} + new Object[]{null, expectedValueForEmptyMvd}, + new Object[]{null, "not abd"} ) ) .run(); @@ -1515,7 +1659,7 @@ public void testArraySlice() new Object[]{Collections.singletonList("b")}, new Object[]{Collections.singletonList("c")}, new Object[]{Collections.emptyList()}, - new Object[]{useDefault ? null : Collections.emptyList()}, + new Object[]{Collections.emptyList()}, new Object[]{null}, new Object[]{null} ) @@ -1595,10 +1739,10 @@ public void testArrayLength() ImmutableList.of( new Object[]{"", 2, 1L}, new Object[]{"10.1", 2, 1L}, - useDefault ? new Object[]{"2", 1, 1L} : new Object[]{"1", 1, 1L}, - useDefault ? new Object[]{"1", 0, 1L} : new Object[]{"2", 1, 1L}, - new Object[]{"abc", useDefault ? 0 : null, 1L}, - new Object[]{"def", useDefault ? 0 : null, 1L} + new Object[]{"1", 1, 1L}, + new Object[]{"2", 1, 1L}, + new Object[]{"abc", null, 1L}, + new Object[]{"def", null, 1L} ) ); } @@ -1639,8 +1783,7 @@ public void testArrayLengthArrayColumn() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.sqlCompatible() - ? ImmutableList.of( + ImmutableList.of( new Object[]{"[\"d\",null,\"b\"]", 3, 2L}, new Object[]{"[null,\"b\"]", 2, 2L}, new Object[]{"[\"a\",\"b\"]", 2, 3L}, @@ -1649,15 +1792,6 @@ public void testArrayLengthArrayColumn() new Object[]{"[]", 0, 1L}, new Object[]{null, null, 3L} ) - : ImmutableList.of( - new Object[]{"[\"d\",null,\"b\"]", 3, 2L}, - new Object[]{"[null,\"b\"]", 2, 2L}, - new Object[]{"[\"a\",\"b\"]", 2, 3L}, - new Object[]{"[\"b\",\"b\"]", 2, 2L}, - new Object[]{"[null]", 1, 1L}, - new Object[]{null, 0, 3L}, - new Object[]{"[]", 0, 1L} - ) ); } @@ -1667,23 +1801,13 @@ public void testArrayAppend() // Cannot vectorize due to array expressions. cannotVectorize(); - ImmutableList results; - if (useDefault) { - results = ImmutableList.of( - new Object[]{null, 3L}, - new Object[]{ImmutableList.of("a", "b", "foo"), 1L}, - new Object[]{ImmutableList.of("b", "c", "foo"), 1L}, - new Object[]{ImmutableList.of("d", "foo"), 1L} - ); - } else { - results = ImmutableList.of( - new Object[]{null, 2L}, - new Object[]{ImmutableList.of("", "foo"), 1L}, - new Object[]{ImmutableList.of("a", "b", "foo"), 1L}, - new Object[]{ImmutableList.of("b", "c", "foo"), 1L}, - new Object[]{ImmutableList.of("d", "foo"), 1L} - ); - } + ImmutableList results = ImmutableList.of( + new Object[]{null, 2L}, + new Object[]{ImmutableList.of("", "foo"), 1L}, + new Object[]{ImmutableList.of("a", "b", "foo"), 1L}, + new Object[]{ImmutableList.of("b", "c", "foo"), 1L}, + new Object[]{ImmutableList.of("d", "foo"), 1L} + ); testQuery( "SELECT ARRAY_APPEND(dim3, 'foo'), SUM(cnt) FROM druid.numfoo GROUP BY 1 ORDER BY 2 DESC", QUERY_CONTEXT_NO_STRINGIFY_ARRAY, @@ -1724,23 +1848,13 @@ public void testArrayPrepend() // Cannot vectorize due to array expressions. cannotVectorize(); - ImmutableList results; - if (useDefault) { - results = ImmutableList.of( - new Object[]{null, 3L}, - new Object[]{ImmutableList.of("foo", "a", "b"), 1L}, - new Object[]{ImmutableList.of("foo", "b", "c"), 1L}, - new Object[]{ImmutableList.of("foo", "d"), 1L} - ); - } else { - results = ImmutableList.of( - new Object[]{null, 2L}, - new Object[]{ImmutableList.of("foo", ""), 1L}, - new Object[]{ImmutableList.of("foo", "a", "b"), 1L}, - new Object[]{ImmutableList.of("foo", "b", "c"), 1L}, - new Object[]{ImmutableList.of("foo", "d"), 1L} - ); - } + ImmutableList results = ImmutableList.of( + new Object[]{null, 2L}, + new Object[]{ImmutableList.of("foo", ""), 1L}, + new Object[]{ImmutableList.of("foo", "a", "b"), 1L}, + new Object[]{ImmutableList.of("foo", "b", "c"), 1L}, + new Object[]{ImmutableList.of("foo", "d"), 1L} + ); testQuery( "SELECT ARRAY_PREPEND('foo', dim3), SUM(cnt) FROM druid.numfoo GROUP BY 1 ORDER BY 2 DESC", QUERY_CONTEXT_NO_STRINGIFY_ARRAY, @@ -1779,23 +1893,13 @@ public void testArrayPrepend() public void testArrayPrependAppend() { cannotVectorizeUnlessFallback(); - ImmutableList results; - if (useDefault) { - results = ImmutableList.of( - new Object[]{"", "", 3L}, - new Object[]{"foo,a,b", "a,b,foo", 1L}, - new Object[]{"foo,b,c", "b,c,foo", 1L}, - new Object[]{"foo,d", "d,foo", 1L} - ); - } else { - results = ImmutableList.of( - new Object[]{null, null, 2L}, - new Object[]{"foo,", ",foo", 1L}, - new Object[]{"foo,a,b", "a,b,foo", 1L}, - new Object[]{"foo,b,c", "b,c,foo", 1L}, - new Object[]{"foo,d", "d,foo", 1L} - ); - } + ImmutableList results = ImmutableList.of( + new Object[]{null, null, 2L}, + new Object[]{"foo,", ",foo", 1L}, + new Object[]{"foo,a,b", "a,b,foo", 1L}, + new Object[]{"foo,b,c", "b,c,foo", 1L}, + new Object[]{"foo,d", "d,foo", 1L} + ); testQuery( "SELECT ARRAY_TO_STRING(ARRAY_PREPEND('foo', dim3), ','), ARRAY_TO_STRING(ARRAY_APPEND(dim3, 'foo'), ','), SUM(cnt) FROM druid.numfoo GROUP BY 1,2 ORDER BY 3 DESC", ImmutableList.of( @@ -1843,23 +1947,13 @@ public void testArrayConcat() // Cannot vectorize due to array expressions. cannotVectorize(); - ImmutableList results; - if (useDefault) { - results = ImmutableList.of( - new Object[]{null, 3L}, - new Object[]{ImmutableList.of("a", "b", "a", "b"), 1L}, - new Object[]{ImmutableList.of("b", "c", "b", "c"), 1L}, - new Object[]{ImmutableList.of("d", "d"), 1L} - ); - } else { - results = ImmutableList.of( - new Object[]{null, 2L}, - new Object[]{ImmutableList.of("", ""), 1L}, - new Object[]{ImmutableList.of("a", "b", "a", "b"), 1L}, - new Object[]{ImmutableList.of("b", "c", "b", "c"), 1L}, - new Object[]{ImmutableList.of("d", "d"), 1L} - ); - } + ImmutableList results = ImmutableList.of( + new Object[]{null, 2L}, + new Object[]{ImmutableList.of("", ""), 1L}, + new Object[]{ImmutableList.of("a", "b", "a", "b"), 1L}, + new Object[]{ImmutableList.of("b", "c", "b", "c"), 1L}, + new Object[]{ImmutableList.of("d", "d"), 1L} + ); testQuery( "SELECT ARRAY_CONCAT(dim3, dim3), SUM(cnt) FROM druid.numfoo GROUP BY 1 ORDER BY 2 DESC", QUERY_CONTEXT_NO_STRINGIFY_ARRAY, @@ -1924,7 +2018,7 @@ public void testArrayOffset() .build() ), ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 4L}, + new Object[]{null, 4L}, new Object[]{"b", 1L}, new Object[]{"c", 1L} ) @@ -1966,11 +2060,7 @@ public void testArrayGroupAsLongArray() .setContext(QUERY_CONTEXT_NO_STRINGIFY_ARRAY) .build() ), - useDefault ? ImmutableList.of( - new Object[]{ImmutableList.of(0L), 4L}, - new Object[]{ImmutableList.of(7L), 1L}, - new Object[]{ImmutableList.of(325323L), 1L} - ) : ImmutableList.of( + ImmutableList.of( new Object[]{Collections.singletonList(null), 3L}, new Object[]{ImmutableList.of(0L), 1L}, new Object[]{ImmutableList.of(7L), 1L}, @@ -2062,11 +2152,6 @@ public void testArrayGroupAsDoubleArray() .setContext(QUERY_CONTEXT_NO_STRINGIFY_ARRAY) .build() ), - useDefault ? ImmutableList.of( - new Object[]{ImmutableList.of(0.0), 4L}, - new Object[]{ImmutableList.of(1.0), 1L}, - new Object[]{ImmutableList.of(1.7), 1L} - ) : ImmutableList.of( new Object[]{Collections.singletonList(null), 3L}, new Object[]{ImmutableList.of(0.0), 1L}, @@ -2158,11 +2243,6 @@ public void testArrayGroupAsFloatArray() .setContext(QUERY_CONTEXT_NO_STRINGIFY_ARRAY) .build() ), - useDefault ? ImmutableList.of( - new Object[]{ImmutableList.of(0.0F), 4L}, - new Object[]{ImmutableList.of(0.10000000149011612F), 1L}, - new Object[]{ImmutableList.of(1.0F), 1L} - ) : ImmutableList.of( new Object[]{Collections.singletonList(null), 3L}, new Object[]{ImmutableList.of(0.0F), 1L}, @@ -2250,7 +2330,7 @@ public void testArrayOrdinal() .build() ), ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 4L}, + new Object[]{null, 4L}, new Object[]{"b", 1L}, new Object[]{"c", 1L} ) @@ -2290,13 +2370,7 @@ public void testArrayOffsetOf() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - useDefault - ? ImmutableList.of( - new Object[]{0, 4L}, - new Object[]{-1, 1L}, - new Object[]{1, 1L} - ) - : ImmutableList.of( + ImmutableList.of( new Object[]{null, 4L}, new Object[]{0, 1L}, new Object[]{1, 1L} @@ -2337,14 +2411,7 @@ public void testArrayOrdinalOf() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - useDefault - ? ImmutableList.of( - new Object[]{0, 3L}, - new Object[]{-1, 1L}, - new Object[]{1, 1L}, - new Object[]{2, 1L} - ) - : ImmutableList.of( + ImmutableList.of( new Object[]{null, 4L}, new Object[]{1, 1L}, new Object[]{2, 1L} @@ -2356,23 +2423,13 @@ public void testArrayOrdinalOf() public void testArrayToString() { cannotVectorizeUnlessFallback(); - ImmutableList results; - if (useDefault) { - results = ImmutableList.of( - new Object[]{"", 3L}, - new Object[]{"a,b", 1L}, - new Object[]{"b,c", 1L}, - new Object[]{"d", 1L} - ); - } else { - results = ImmutableList.of( - new Object[]{null, 2L}, - new Object[]{"", 1L}, - new Object[]{"a,b", 1L}, - new Object[]{"b,c", 1L}, - new Object[]{"d", 1L} - ); - } + ImmutableList results = ImmutableList.of( + new Object[]{null, 2L}, + new Object[]{"", 1L}, + new Object[]{"a,b", 1L}, + new Object[]{"b,c", 1L}, + new Object[]{"d", 1L} + ); testQuery( "SELECT ARRAY_TO_STRING(dim3, ','), SUM(cnt) FROM druid.numfoo GROUP BY 1 ORDER BY 2 DESC", ImmutableList.of( @@ -2412,21 +2469,12 @@ public void testArrayToStringToMultiValueString() // Cannot vectorize due to array expressions. cannotVectorize(); - ImmutableList results; - if (useDefault) { - results = ImmutableList.of( - new Object[]{ImmutableList.of("a", "b", "d"), 1L}, - new Object[]{ImmutableList.of("b", "c", "d"), 1L}, - new Object[]{ImmutableList.of("d", "d"), 1L} - ); - } else { - results = ImmutableList.of( - new Object[]{ImmutableList.of("", "d"), 1L}, - new Object[]{ImmutableList.of("a", "b", "d"), 1L}, - new Object[]{ImmutableList.of("b", "c", "d"), 1L}, - new Object[]{ImmutableList.of("d", "d"), 1L} - ); - } + ImmutableList results = ImmutableList.of( + new Object[]{ImmutableList.of("", "d"), 1L}, + new Object[]{ImmutableList.of("a", "b", "d"), 1L}, + new Object[]{ImmutableList.of("b", "c", "d"), 1L}, + new Object[]{ImmutableList.of("d", "d"), 1L} + ); testQuery( "SELECT STRING_TO_ARRAY(CONCAT(ARRAY_TO_STRING(dim3, ','), ',d'), ','), SUM(cnt) FROM druid.numfoo WHERE ARRAY_LENGTH(dim3) > 0 GROUP BY 1 ORDER BY 2 DESC", QUERY_CONTEXT_NO_STRINGIFY_ARRAY, @@ -2536,9 +2584,7 @@ public void testArrayAgg() .build() ), ImmutableList.of( - useDefault - ? new Object[]{"[\"10.1\",\"2\",\"1\",\"def\",\"abc\"]", "[\"1\",\"10.1\",\"2\",\"abc\",\"def\"]", null} - : new Object[]{ + new Object[]{ "[\"\",\"10.1\",\"2\",\"1\",\"def\",\"abc\"]", "[\"\",\"1\",\"10.1\",\"2\",\"abc\",\"def\"]", null @@ -2598,9 +2644,7 @@ public void testArrayAggMultiValue() .build() ), ImmutableList.of( - useDefault - ? new Object[]{"[\"a\",\"b\",\"b\",\"c\",\"d\",null,null,null]", "[null,\"a\",\"b\",\"c\",\"d\"]"} - : new Object[]{"[\"a\",\"b\",\"b\",\"c\",\"d\",\"\",null,null]", "[null,\"\",\"a\",\"b\",\"c\",\"d\"]"} + new Object[]{"[\"a\",\"b\",\"b\",\"c\",\"d\",\"\",null,null]", "[null,\"\",\"a\",\"b\",\"c\",\"d\"]"} ) ); } @@ -2720,16 +2764,7 @@ public void testArrayAggNumeric() .build() ), ImmutableList.of( - useDefault - ? new Object[]{ - "[7,325323,0,0,0,0]", - "[0,7,325323]", - "[1.0,1.7,0.0,0.0,0.0,0.0]", - "[0.0,1.0,1.7]", - "[1.0,0.10000000149011612,0.0,0.0,0.0,0.0]", - "[0.0,0.10000000149011612,1.0]" - } - : new Object[]{ + new Object[]{ "[7,325323,0,null,null,null]", "[null,0,7,325323]", "[1.0,1.7,0.0,null,null,null]", @@ -2778,9 +2813,7 @@ public void testArrayAggQuantile() .context(QUERY_CONTEXT_DEFAULT) .build() ), - // Different results because there are some nulls in the column. In SQL-compatible mode we ignore them; - // in replace-with-default mode we treat them as zeroes. - ImmutableList.of(new Object[]{NullHandling.sqlCompatible() ? 260259.80000000002 : 162665.0}) + ImmutableList.of(new Object[]{260259.80000000002}) ); } @@ -2844,23 +2877,6 @@ public void testArrayAggArrays() (sql, queryResults) -> { // ordering is not stable in array_agg and array_concat_agg List expected = ImmutableList.of( - useDefault ? - new Object[]{ - Arrays.asList( - Arrays.asList(7L, 0L), - Arrays.asList(325323L, 325323L), - Arrays.asList(0L, 0L), - Arrays.asList(0L, 0L), - Arrays.asList(0L, 0L), - Arrays.asList(0L, 0L) - ), - Arrays.asList( - Arrays.asList(0L, 0L), - Arrays.asList(7L, 0L), - Arrays.asList(325323L, 325323L) - ) - } - : new Object[]{ Arrays.asList( Arrays.asList(7L, null), @@ -2943,23 +2959,6 @@ public void testArrayAggArraysWithMaxSizeBytes() (sql, queryResults) -> { // ordering is not stable in array_agg and array_concat_agg List expected = ImmutableList.of( - useDefault ? - new Object[]{ - Arrays.asList( - Arrays.asList(7L, 0L), - Arrays.asList(325323L, 325323L), - Arrays.asList(0L, 0L), - Arrays.asList(0L, 0L), - Arrays.asList(0L, 0L), - Arrays.asList(0L, 0L) - ), - Arrays.asList( - Arrays.asList(0L, 0L), - Arrays.asList(7L, 0L), - Arrays.asList(325323L, 325323L) - ) - } - : new Object[]{ Arrays.asList( Arrays.asList(7L, null), @@ -3037,9 +3036,7 @@ public void testArrayConcatAggArrays() .build() ), ImmutableList.of( - useDefault - ? new Object[]{"[7,0,325323,325323,0,0,0,0,0,0,0,0]", "[0,7,325323]"} - : new Object[]{"[7,null,325323,325323,0,0,null,null,null,null,null,null]", "[null,0,7,325323]"} + new Object[]{"[7,null,325323,325323,0,0,null,null,null,null,null,null]", "[null,0,7,325323]"} ) ); } @@ -3099,9 +3096,7 @@ public void testArrayConcatAggArraysWithMaxSizeBytes() .build() ), ImmutableList.of( - useDefault - ? new Object[]{"[7,0,325323,325323,0,0,0,0,0,0,0,0]", "[0,7,325323]"} - : new Object[]{"[7,null,325323,325323,0,0,null,null,null,null,null,null]", "[null,0,7,325323]"} + new Object[]{"[7,null,325323,325323,0,0,null,null,null,null,null,null]", "[null,0,7,325323]"} ) ); } @@ -3114,10 +3109,6 @@ public void testArrayAggArrayColumns() msqIncompatible(); // nested array party cannotVectorize(); - if (NullHandling.replaceWithDefault()) { - // default value mode plans to selector filters for equality, which do not support array filtering - return; - } testQuery( "SELECT ARRAY_AGG(arrayLongNulls), ARRAY_AGG(DISTINCT arrayDouble), ARRAY_AGG(DISTINCT arrayStringNulls) FILTER(WHERE arrayLong = ARRAY[2,3]) FROM arrays WHERE arrayDoubleNulls is not null", ImmutableList.of( @@ -3198,10 +3189,6 @@ public void testArrayAggArrayColumns() public void testArrayConcatAggArrayColumns() { cannotVectorize(); - if (NullHandling.replaceWithDefault()) { - // default value mode plans to selector filters for equality, which do not support array filtering - return; - } testQuery( "SELECT ARRAY_CONCAT_AGG(arrayLongNulls), ARRAY_CONCAT_AGG(DISTINCT arrayDouble), ARRAY_CONCAT_AGG(DISTINCT arrayStringNulls) FILTER(WHERE arrayLong = ARRAY[2,3]) FROM arrays WHERE arrayDoubleNulls is not null", ImmutableList.of( @@ -3315,7 +3302,7 @@ public void testArrayAggToString() .build() ), ImmutableList.of( - useDefault ? new Object[]{"1,10.1,2,abc,def"} : new Object[]{",1,10.1,2,abc,def"} + new Object[]{",1,10.1,2,abc,def"} ) ); } @@ -3359,7 +3346,7 @@ public void testArrayAggExpression() .build() ), ImmutableList.of( - useDefault ? new Object[]{"10.1,1a,2,a,abc,defabc"} : new Object[]{"null,1a,2,a,defabc"} + new Object[]{"null,1a,2,a,defabc"} ) ); } @@ -3415,9 +3402,7 @@ public void testArrayAggMaxBytes() .build() ), ImmutableList.of( - useDefault - ? new Object[]{"[7,325323,0,0,0,0]", "[0,7,325323]"} - : new Object[]{"[7,325323,0,null,null,null]", "[null,0,7,325323]"} + new Object[]{"[7,325323,0,null,null,null]", "[null,0,7,325323]"} ) ); } @@ -3426,26 +3411,14 @@ public void testArrayAggMaxBytes() public void testArrayAggAsArrayFromJoin() { cannotVectorize(); - List expectedResults; - if (useDefault) { - expectedResults = ImmutableList.of( - new Object[]{"a", "[\"10.1\",\"2\"]", "10.1,2"}, - new Object[]{"a", "[\"10.1\",\"2\"]", "10.1,2"}, - new Object[]{"a", "[\"10.1\",\"2\"]", "10.1,2"}, - new Object[]{"b", "[\"1\",\"abc\",\"def\"]", "1,abc,def"}, - new Object[]{"b", "[\"1\",\"abc\",\"def\"]", "1,abc,def"}, - new Object[]{"b", "[\"1\",\"abc\",\"def\"]", "1,abc,def"} - ); - } else { - expectedResults = ImmutableList.of( - new Object[]{"a", "[\"\",\"10.1\",\"2\"]", ",10.1,2"}, - new Object[]{"a", "[\"\",\"10.1\",\"2\"]", ",10.1,2"}, - new Object[]{"a", "[\"\",\"10.1\",\"2\"]", ",10.1,2"}, - new Object[]{"b", "[\"1\",\"abc\",\"def\"]", "1,abc,def"}, - new Object[]{"b", "[\"1\",\"abc\",\"def\"]", "1,abc,def"}, - new Object[]{"b", "[\"1\",\"abc\",\"def\"]", "1,abc,def"} - ); - } + List expectedResults = ImmutableList.of( + new Object[]{"a", "[\"\",\"10.1\",\"2\"]", ",10.1,2"}, + new Object[]{"a", "[\"\",\"10.1\",\"2\"]", ",10.1,2"}, + new Object[]{"a", "[\"\",\"10.1\",\"2\"]", ",10.1,2"}, + new Object[]{"b", "[\"1\",\"abc\",\"def\"]", "1,abc,def"}, + new Object[]{"b", "[\"1\",\"abc\",\"def\"]", "1,abc,def"}, + new Object[]{"b", "[\"1\",\"abc\",\"def\"]", "1,abc,def"} + ); testQuery( "SELECT numfoo.dim4, j.arr, ARRAY_TO_STRING(j.arr, ',') FROM numfoo INNER JOIN (SELECT dim4, ARRAY_AGG(DISTINCT dim1) as arr FROM numfoo WHERE dim1 is not null GROUP BY 1) as j ON numfoo.dim4 = j.dim4", QUERY_CONTEXT_DEFAULT, @@ -3547,12 +3520,6 @@ public void testArrayAggGroupByArrayAggFromSubquery() .postAggregators(expressionPostAgg("s0", "1", ColumnType.LONG)) .build() ), - useDefault ? - ImmutableList.of( - new Object[]{"", ImmutableList.of("10.1", "2", "abc"), 1L}, - new Object[]{"a", ImmutableList.of("1"), 1L}, - new Object[]{"abc", ImmutableList.of("def"), 1L} - ) : ImmutableList.of( new Object[]{null, ImmutableList.of("10.1", "abc"), 1L}, new Object[]{"", ImmutableList.of("2"), 1L}, @@ -3762,25 +3729,14 @@ public void testArrayAggGroupByArrayAggOfDoubleFromSubquery() public void testArrayAggArrayContainsSubquery() { cannotVectorize(); - List expectedResults; - if (useDefault) { - expectedResults = ImmutableList.of( - new Object[]{"10.1", ""}, - new Object[]{"2", ""}, - new Object[]{"1", "a"}, - new Object[]{"def", "abc"}, - new Object[]{"abc", ""} - ); - } else { - expectedResults = ImmutableList.of( - new Object[]{"", "a"}, - new Object[]{"10.1", null}, - new Object[]{"2", ""}, - new Object[]{"1", "a"}, - new Object[]{"def", "abc"}, - new Object[]{"abc", null} - ); - } + List expectedResults = ImmutableList.of( + new Object[]{"", "a"}, + new Object[]{"10.1", null}, + new Object[]{"2", ""}, + new Object[]{"1", "a"}, + new Object[]{"def", "abc"}, + new Object[]{"abc", null} + ); testQuery( "SELECT dim1,dim2 FROM foo WHERE ARRAY_CONTAINS((SELECT ARRAY_AGG(DISTINCT dim1) FROM foo WHERE dim1 is not null), dim1)", QUERY_CONTEXT_DEFAULT, @@ -3846,21 +3802,12 @@ public void testArrayAggArrayContainsSubquery() public void testArrayAggGroupByArrayContainsSubquery() { cannotVectorize(); - List expectedResults; - if (useDefault) { - expectedResults = ImmutableList.of( - new Object[]{"", 3L}, - new Object[]{"a", 1L}, - new Object[]{"abc", 1L} - ); - } else { - expectedResults = ImmutableList.of( - new Object[]{null, 2L}, - new Object[]{"", 1L}, - new Object[]{"a", 2L}, - new Object[]{"abc", 1L} - ); - } + List expectedResults = ImmutableList.of( + new Object[]{null, 2L}, + new Object[]{"", 1L}, + new Object[]{"a", 2L}, + new Object[]{"abc", 1L} + ); testQuery( "SELECT dim2, COUNT(*) FROM foo WHERE ARRAY_CONTAINS((SELECT ARRAY_AGG(DISTINCT dim1) FROM foo WHERE dim1 is not null), dim1) GROUP BY 1", QUERY_CONTEXT_DEFAULT, @@ -4010,17 +3957,6 @@ public void testUnnest() .columnTypes(ColumnType.STRING) .build() ), - useDefault ? - ImmutableList.of( - new Object[]{"a"}, - new Object[]{"b"}, - new Object[]{"b"}, - new Object[]{"c"}, - new Object[]{"d"}, - new Object[]{""}, - new Object[]{""}, - new Object[]{""} - ) : ImmutableList.of( new Object[]{"a"}, new Object[]{"b"}, @@ -4157,19 +4093,19 @@ public void testUnnestArrayColumnsStringNulls() new Object[]{"a"}, new Object[]{"b"}, new Object[]{"d"}, - new Object[]{NullHandling.defaultStringValue()}, + new Object[]{null}, new Object[]{"b"}, - new Object[]{NullHandling.defaultStringValue()}, + new Object[]{null}, new Object[]{"b"}, new Object[]{"a"}, new Object[]{"b"}, new Object[]{"b"}, new Object[]{"b"}, - new Object[]{NullHandling.defaultStringValue()}, + new Object[]{null}, new Object[]{"d"}, - new Object[]{NullHandling.defaultStringValue()}, + new Object[]{null}, new Object[]{"b"}, - new Object[]{NullHandling.defaultStringValue()}, + new Object[]{null}, new Object[]{"b"} ) ); @@ -4429,17 +4365,6 @@ public void testUnnestTwice() .columnTypes(ColumnType.STRING, ColumnType.STRING_ARRAY, ColumnType.STRING_ARRAY, ColumnType.STRING, ColumnType.STRING) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{"10.1", ImmutableList.of("b", "c"), ImmutableList.of("10", "1"), "10", "b"}, - new Object[]{"10.1", ImmutableList.of("b", "c"), ImmutableList.of("10", "1"), "10", "c"}, - new Object[]{"10.1", ImmutableList.of("b", "c"), ImmutableList.of("10", "1"), "1", "b"}, - new Object[]{"10.1", ImmutableList.of("b", "c"), ImmutableList.of("10", "1"), "1", "c"}, - new Object[]{"2", ImmutableList.of("d"), ImmutableList.of("2"), "2", "d"}, - new Object[]{"1", useDefault ? null : ImmutableList.of(""), ImmutableList.of("1"), "1", ""}, - new Object[]{"def", null, ImmutableList.of("def"), "def", NullHandling.defaultStringValue()}, - new Object[]{"abc", null, ImmutableList.of("abc"), "abc", NullHandling.defaultStringValue()} - ) : ImmutableList.of( new Object[]{"", ImmutableList.of("a", "b"), ImmutableList.of(""), "", "a"}, new Object[]{"", ImmutableList.of("a", "b"), ImmutableList.of(""), "", "b"}, @@ -4509,9 +4434,9 @@ public void testUnnestTwiceArrayColumns() new Object[]{Arrays.asList("d", null, "b"), Arrays.asList(1L, 2L, 3L), "d", 1L}, new Object[]{Arrays.asList("d", null, "b"), Arrays.asList(1L, 2L, 3L), "d", 2L}, new Object[]{Arrays.asList("d", null, "b"), Arrays.asList(1L, 2L, 3L), "d", 3L}, - new Object[]{Arrays.asList("d", null, "b"), Arrays.asList(1L, 2L, 3L), NullHandling.defaultStringValue(), 1L}, - new Object[]{Arrays.asList("d", null, "b"), Arrays.asList(1L, 2L, 3L), NullHandling.defaultStringValue(), 2L}, - new Object[]{Arrays.asList("d", null, "b"), Arrays.asList(1L, 2L, 3L), NullHandling.defaultStringValue(), 3L}, + new Object[]{Arrays.asList("d", null, "b"), Arrays.asList(1L, 2L, 3L), null, 1L}, + new Object[]{Arrays.asList("d", null, "b"), Arrays.asList(1L, 2L, 3L), null, 2L}, + new Object[]{Arrays.asList("d", null, "b"), Arrays.asList(1L, 2L, 3L), null, 3L}, new Object[]{Arrays.asList("d", null, "b"), Arrays.asList(1L, 2L, 3L), "b", 1L}, new Object[]{Arrays.asList("d", null, "b"), Arrays.asList(1L, 2L, 3L), "b", 2L}, new Object[]{Arrays.asList("d", null, "b"), Arrays.asList(1L, 2L, 3L), "b", 3L}, @@ -4521,15 +4446,15 @@ public void testUnnestTwiceArrayColumns() new Object[]{Arrays.asList("a", "b"), Arrays.asList(2L, 3L), "b", 3L}, new Object[]{Arrays.asList("b", "b"), Collections.singletonList(null), "b", null}, new Object[]{Arrays.asList("b", "b"), Collections.singletonList(null), "b", null}, - new Object[]{Collections.singletonList(null), Arrays.asList(null, 2L, 9L), NullHandling.defaultStringValue(), null}, - new Object[]{Collections.singletonList(null), Arrays.asList(null, 2L, 9L), NullHandling.defaultStringValue(), 2L}, - new Object[]{Collections.singletonList(null), Arrays.asList(null, 2L, 9L), NullHandling.defaultStringValue(), 9L}, + new Object[]{Collections.singletonList(null), Arrays.asList(null, 2L, 9L), null, null}, + new Object[]{Collections.singletonList(null), Arrays.asList(null, 2L, 9L), null, 2L}, + new Object[]{Collections.singletonList(null), Arrays.asList(null, 2L, 9L), null, 9L}, new Object[]{Arrays.asList("d", null, "b"), Arrays.asList(1L, 2L, 3L), "d", 1L}, new Object[]{Arrays.asList("d", null, "b"), Arrays.asList(1L, 2L, 3L), "d", 2L}, new Object[]{Arrays.asList("d", null, "b"), Arrays.asList(1L, 2L, 3L), "d", 3L}, - new Object[]{Arrays.asList("d", null, "b"), Arrays.asList(1L, 2L, 3L), NullHandling.defaultStringValue(), 1L}, - new Object[]{Arrays.asList("d", null, "b"), Arrays.asList(1L, 2L, 3L), NullHandling.defaultStringValue(), 2L}, - new Object[]{Arrays.asList("d", null, "b"), Arrays.asList(1L, 2L, 3L), NullHandling.defaultStringValue(), 3L}, + new Object[]{Arrays.asList("d", null, "b"), Arrays.asList(1L, 2L, 3L), null, 1L}, + new Object[]{Arrays.asList("d", null, "b"), Arrays.asList(1L, 2L, 3L), null, 2L}, + new Object[]{Arrays.asList("d", null, "b"), Arrays.asList(1L, 2L, 3L), null, 3L}, new Object[]{Arrays.asList("d", null, "b"), Arrays.asList(1L, 2L, 3L), "b", 1L}, new Object[]{Arrays.asList("d", null, "b"), Arrays.asList(1L, 2L, 3L), "b", 2L}, new Object[]{Arrays.asList("d", null, "b"), Arrays.asList(1L, 2L, 3L), "b", 3L} @@ -4620,9 +4545,7 @@ public void testUnnestThriceWithFiltersOnDimAndUnnestCol() null ), and( - NullHandling.sqlCompatible() - ? equality("dimZipf", "27", ColumnType.LONG) - : bound("dimZipf", "27", "27", false, false, null, StringComparators.NUMERIC), + equality("dimZipf", "27", ColumnType.LONG), equality("j0.unnest", "Baz", ColumnType.STRING) ) ), @@ -4711,9 +4634,7 @@ public void testUnnestThriceWithFiltersOnDimAndAllUnnestColumns() null ), and( - NullHandling.sqlCompatible() - ? equality("dimZipf", "27", ColumnType.LONG) - : bound("dimZipf", "27", "27", false, false, null, StringComparators.NUMERIC), + equality("dimZipf", "27", ColumnType.LONG), equality("j0.unnest", "Baz", ColumnType.STRING) ) ), @@ -4779,9 +4700,7 @@ public void testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns() null ), and( - NullHandling.sqlCompatible() - ? equality("arrayString", ImmutableList.of("a", "b"), ColumnType.STRING_ARRAY) - : expressionFilter("(\"arrayString\" == array('a','b'))"), + equality("arrayString", ImmutableList.of("a", "b"), ColumnType.STRING_ARRAY), equality("j0.unnest", 1, ColumnType.LONG) ) ), @@ -4842,14 +4761,7 @@ public void testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations() nestedExpressionVirtualColumn("j0.unnest", "\"dimMultivalEnumerated\"", ColumnType.STRING), null ), - NullHandling.sqlCompatible() ? equality("dimZipf", "27", ColumnType.LONG) : range( - "dimZipf", - ColumnType.LONG, - "27", - "27", - false, - false - ) + equality("dimZipf", "27", ColumnType.LONG) ), nestedExpressionVirtualColumn("_j0.unnest", "\"dimMultivalEnumerated\"", ColumnType.STRING), null @@ -4914,9 +4826,7 @@ public void testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFil ), null ), - NullHandling.sqlCompatible() - ? equality("arrayString", ImmutableList.of("a", "b"), ColumnType.STRING_ARRAY) - : expressionFilter("(\"arrayString\" == array('a','b'))") + equality("arrayString", ImmutableList.of("a", "b"), ColumnType.STRING_ARRAY) ), expressionVirtualColumn( "_j0.unnest", @@ -4984,14 +4894,6 @@ public void testUnnestWithGroupBy() .setContext(QUERY_CONTEXT_UNNEST) .build() ), - useDefault ? - ImmutableList.of( - new Object[]{""}, - new Object[]{"a"}, - new Object[]{"b"}, - new Object[]{"c"}, - new Object[]{"d"} - ) : ImmutableList.of( new Object[]{null}, new Object[]{""}, @@ -5025,7 +4927,7 @@ public void testUnnestWithGroupByArrayColumn() .build() ), ImmutableList.of( - new Object[]{NullHandling.defaultStringValue()}, + new Object[]{null}, new Object[]{"a"}, new Object[]{"b"}, new Object[]{"d"} @@ -5066,14 +4968,6 @@ public void testUnnestWithGroupByOrderBy() .setContext(QUERY_CONTEXT_UNNEST) .build() ), - useDefault ? - ImmutableList.of( - new Object[]{"d", 1L}, - new Object[]{"c", 1L}, - new Object[]{"b", 2L}, - new Object[]{"a", 1L}, - new Object[]{"", 3L} - ) : ImmutableList.of( new Object[]{"d", 1L}, new Object[]{"c", 1L}, @@ -5107,13 +5001,6 @@ public void testUnnestWithGroupByOrderByWithLimit() .context(QUERY_CONTEXT_UNNEST) .build() ), - useDefault ? - ImmutableList.of( - new Object[]{"", 3L}, - new Object[]{"a", 1L}, - new Object[]{"b", 2L}, - new Object[]{"c", 1L} - ) : ImmutableList.of( new Object[]{null, 2L}, new Object[]{"", 1L}, @@ -5146,12 +5033,6 @@ public void testUnnestWithGroupByHaving() .setContext(QUERY_CONTEXT_UNNEST) .build() ), - useDefault ? - ImmutableList.of( - new Object[]{"a", 1L}, - new Object[]{"c", 1L}, - new Object[]{"d", 1L} - ) : ImmutableList.of( new Object[]{"", 1L}, new Object[]{"a", 1L}, @@ -5211,17 +5092,6 @@ public void testUnnestFirstQueryOnSelect() .columnTypes(ColumnType.STRING) .build() ), - useDefault ? - ImmutableList.of( - new Object[]{"a"}, - new Object[]{"b"}, - new Object[]{"b"}, - new Object[]{"c"}, - new Object[]{"d"}, - new Object[]{""}, - new Object[]{""}, - new Object[]{""} - ) : ImmutableList.of( new Object[]{"a"}, new Object[]{"b"}, @@ -5250,17 +5120,7 @@ public void testUnnestVirtualWithColumns1() .intervals(querySegmentSpec(Filtration.eternity())) .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) .filters(or( - NullHandling.sqlCompatible() - ? range("m1", ColumnType.LONG, null, "10", false, false) - : bound( - "m1", - null, - "10", - false, - false, - null, - StringComparators.NUMERIC - ), + range("m1", ColumnType.LONG, null, "10", false, false), equality("j0.unnest", "b", ColumnType.STRING) )) .context(QUERY_CONTEXT_UNNEST) @@ -5289,9 +5149,7 @@ public void testUnnestVirtualWithColumns2() .filters(or( equality("j0.unnest", "a", ColumnType.STRING), and( - NullHandling.sqlCompatible() - ? equality("m1", "2", ColumnType.FLOAT) - : equality("m1", "2", ColumnType.STRING), + equality("m1", "2", ColumnType.FLOAT), equality("j0.unnest", "b", ColumnType.STRING) ) )) @@ -5306,7 +5164,7 @@ public void testUnnestVirtualWithColumns2() ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_EXTRA_SCAN, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_EXTRA_SCAN) @Test public void testUnnestWithFilters() { @@ -5338,7 +5196,7 @@ public void testUnnestWithFilters() ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_EXTRA_SCAN, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_EXTRA_SCAN) @Test public void testUnnestWithFiltersWithExpressionInInnerQuery() { @@ -5375,7 +5233,7 @@ public void testUnnestWithFiltersWithExpressionInInnerQuery() ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_EXTRA_SCAN, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_EXTRA_SCAN) @Test public void testUnnestWithInFiltersWithExpressionInInnerQuery() { @@ -5410,7 +5268,7 @@ public void testUnnestWithInFiltersWithExpressionInInnerQuery() ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNUSED_VIRTUALCOLUMN, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNUSED_VIRTUALCOLUMN) @Test public void testUnnestWithFiltersInnerLimit() { @@ -5444,11 +5302,6 @@ public void testUnnestWithFiltersInnerLimit() .columnTypes(ColumnType.STRING) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{"a"}, - new Object[]{"b"} - ) : ImmutableList.of( new Object[]{"a"}, new Object[]{"b"}, @@ -5457,7 +5310,7 @@ public void testUnnestWithFiltersInnerLimit() ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_EXTRA_SCAN, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_EXTRA_SCAN) @Test public void testUnnestWithFiltersInsideAndOutside() { @@ -5606,8 +5459,7 @@ public void testUnnestWithInFilters() new Object[]{"a"}, new Object[]{"b"}, new Object[]{""}, - useDefault ? - new Object[]{""} : new Object[]{null} + new Object[]{null} ) ); } @@ -5687,13 +5539,6 @@ public void testUnnestWithGroupByOrderByOnVirtualColumn() .setContext(QUERY_CONTEXT_UNNEST) .build() ), - useDefault ? - ImmutableList.of( - new Object[]{"b", 3L}, - new Object[]{"abc", 1L}, - new Object[]{"a", 5L}, - new Object[]{"", 3L} - ) : ImmutableList.of( new Object[]{"b", 3L}, new Object[]{"abc", 1L}, @@ -5744,16 +5589,6 @@ public void testUnnestWithJoinOnTheLeft() .columnTypes(ColumnType.STRING) .build() ), - useDefault ? - ImmutableList.of( - new Object[]{"a"}, - new Object[]{"b"}, - new Object[]{"a"}, - new Object[]{"b"}, - new Object[]{""}, - new Object[]{""}, - new Object[]{""} - ) : ImmutableList.of( new Object[]{"a"}, new Object[]{"b"}, @@ -5846,17 +5681,6 @@ public void testUnnestWithSQLFunctionOnUnnestedColumn() .columnTypes(ColumnType.LONG) .build() ), - useDefault ? - ImmutableList.of( - new Object[]{1}, - new Object[]{1}, - new Object[]{1}, - new Object[]{1}, - new Object[]{1}, - new Object[]{0}, - new Object[]{0}, - new Object[]{0} - ) : ImmutableList.of( new Object[]{1}, new Object[]{1}, @@ -5956,7 +5780,7 @@ public void testUnnestWithInvalidINFiltersOnUnnestedColumn() ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_DIFFERENT_RESULTSET, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_DIFFERENT_RESULTSET) @Test public void testUnnestWithNotFiltersOnUnnestedColumn() { @@ -5977,16 +5801,6 @@ public void testUnnestWithNotFiltersOnUnnestedColumn() .columnTypes(ColumnType.STRING) .build() ), - useDefault ? - ImmutableList.of( - new Object[]{"a"}, - new Object[]{"b"}, - new Object[]{"b"}, - new Object[]{"c"}, - new Object[]{""}, - new Object[]{""}, - new Object[]{""} - ) : ImmutableList.of( new Object[]{"a"}, new Object[]{"b"}, @@ -6035,9 +5849,7 @@ public void testUnnestWithSelectorFiltersOnVirtualColumn() .dataSource(UnnestDataSource.create( new TableDataSource(CalciteTests.DATASOURCE3), expressionVirtualColumn("j0.unnest", "array(\"m1\",\"m2\")", ColumnType.FLOAT_ARRAY), - NullHandling.replaceWithDefault() - ? selector("j0.unnest", "1") - : equality("j0.unnest", 1.0, ColumnType.FLOAT) + equality("j0.unnest", 1.0, ColumnType.FLOAT) )) .intervals(querySegmentSpec(Filtration.eternity())) .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) @@ -6206,7 +6018,7 @@ public void testUnnestWithMultipleOrFiltersOnUnnestedColumns() ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_DIFFERENT_RESULTSET, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_DIFFERENT_RESULTSET) @Test public void testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns() { @@ -6230,17 +6042,6 @@ public void testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns() .columnTypes(ColumnType.STRING) .build() ), - useDefault ? - ImmutableList.of( - new Object[]{"a"}, - new Object[]{"b"}, - new Object[]{"b"}, - new Object[]{"c"}, - new Object[]{"d"}, - new Object[]{""}, - new Object[]{""}, - new Object[]{""} - ) : ImmutableList.of( new Object[]{"a"}, new Object[]{"b"}, @@ -6490,10 +6291,6 @@ public void testUnnestWithSumOnUnnestedColumn() .aggregators(aggregators(new DoubleSumAggregatorFactory("a0", "v0"))) .build() ), - useDefault ? - ImmutableList.of( - new Object[]{0.0} - ) : ImmutableList.of( new Object[]{null} ) @@ -6659,14 +6456,11 @@ public void testUnnestVirtualWithColumnsAndNullIf() .intervals(querySegmentSpec(Filtration.eternity())) .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) .filters( - useDefault ? expressionFilter("(\"j0.unnest\" == \"m2\")") : or( expressionFilter("(\"j0.unnest\" == \"m2\")"), and( isNull("j0.unnest"), - NullHandling.sqlCompatible() - ? not(istrue(expressionFilter("(\"j0.unnest\" == \"m2\")"))) - : not(expressionFilter("(\"j0.unnest\" == \"m2\")")) + not(istrue(expressionFilter("(\"j0.unnest\" == \"m2\")"))) ) ) ) @@ -6753,11 +6547,11 @@ public void testUnnestWithTimeFilterOnlyArrayColumn() new Object[]{"b"}, new Object[]{"b"}, new Object[]{"b"}, - new Object[]{NullHandling.defaultStringValue()}, + new Object[]{null}, new Object[]{"d"}, - new Object[]{NullHandling.defaultStringValue()}, + new Object[]{null}, new Object[]{"b"}, - new Object[]{NullHandling.defaultStringValue()}, + new Object[]{null}, new Object[]{"b"} ) ); @@ -6777,7 +6571,6 @@ public void testUnnestWithTimeFilterAndAnotherFilter() FilteredDataSource.create( new TableDataSource(CalciteTests.DATASOURCE1), and( - useDefault ? equality("m1", 2, ColumnType.FLOAT) : equality("m1", 2.0, ColumnType.FLOAT), range("__time", ColumnType.LONG, 946771200000L, 946858200000L, false, false) ) @@ -6812,7 +6605,6 @@ public void testUnnestWithTimeFilterOrAnotherFilter() FilteredDataSource.create( new TableDataSource(CalciteTests.DATASOURCE1), or( - useDefault ? equality("m1", 2, ColumnType.FLOAT) : equality("m1", 2.0, ColumnType.FLOAT), range("__time", ColumnType.LONG, 946771200000L, 946858200000L, false, false) ) @@ -6960,9 +6752,7 @@ public void testUnnestWithTimeFilterInsideSubquery() ) .intervals(querySegmentSpec(Filtration.eternity())) .filters( - NullHandling.sqlCompatible() - ? in("m1", ColumnType.FLOAT, ImmutableList.of(1.0f, 2.0f)) - : in("m1", ImmutableList.of("1", "2")) + in("m1", ColumnType.FLOAT, ImmutableList.of(1.0f, 2.0f)) ) .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) .context(QUERY_CONTEXT_UNNEST) @@ -7057,22 +6847,9 @@ public void testUnnestWithFilterAndUnnestNestedBackToBack() ), null ), - NullHandling.sqlCompatible() ? and( equality("m1", 2.0f, ColumnType.FLOAT), range("__time", ColumnType.LONG, 946771200000L, 946858200000L, false, false) - ) : - and( - selector("m1", "2", null), - bound( - "__time", - "946771200000", - "946858200000", - false, - false, - null, - StringComparators.NUMERIC - ) ) ), expressionVirtualColumn( @@ -7293,7 +7070,7 @@ public void testArrayToMvPostaggInline() ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_SUBSTRING_EMPTY, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_SUBSTRING_EMPTY) @Test public void testUnnestExtractionFn() { @@ -7305,9 +7082,7 @@ public void testUnnestExtractionFn() .dataSource(UnnestDataSource.create( new TableDataSource(CalciteTests.DATASOURCE3), nestedExpressionVirtualColumn("j0.unnest", "\"dim3\"", ColumnType.STRING), - NullHandling.sqlCompatible() - ? expressionFilter("(substring(\"j0.unnest\", 0, -1) != 'b')") - : not(selector("j0.unnest", "b", new SubstringDimExtractionFn(0, null))) + expressionFilter("(substring(\"j0.unnest\", 0, -1) != 'b')") )) .virtualColumns(expressionVirtualColumn("v0", "substring(\"j0.unnest\", 0, -1)", ColumnType.STRING)) .intervals(querySegmentSpec(Filtration.eternity())) @@ -7317,15 +7092,6 @@ public void testUnnestExtractionFn() .columnTypes(ColumnType.STRING) .build() ), - useDefault ? - ImmutableList.of( - new Object[]{"a"}, - new Object[]{"c"}, - new Object[]{"d"}, - new Object[]{""}, - new Object[]{""}, - new Object[]{""} - ) : ImmutableList.of( new Object[]{"a"}, new Object[]{"c"}, @@ -7345,9 +7111,7 @@ public void testUnnestExtractionFnNull() .dataSource(UnnestDataSource.create( new TableDataSource(CalciteTests.DATASOURCE3), nestedExpressionVirtualColumn("j0.unnest", "\"dim3\"", ColumnType.STRING), - NullHandling.sqlCompatible() - ? expressionFilter("notnull(substring(\"j0.unnest\", 0, -1))") - : not(selector("j0.unnest", null, new SubstringDimExtractionFn(0, null))) + expressionFilter("notnull(substring(\"j0.unnest\", 0, -1))") )) .virtualColumns(expressionVirtualColumn("v0", "substring(\"j0.unnest\", 0, -1)", ColumnType.STRING)) .intervals(querySegmentSpec(Filtration.eternity())) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteCorrelatedQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteCorrelatedQueryTest.java index bcb7759c981f..c34870f24739 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteCorrelatedQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteCorrelatedQueryTest.java @@ -46,6 +46,7 @@ import org.apache.druid.sql.calcite.util.CalciteTests; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; + import java.util.Arrays; import java.util.Collections; import java.util.Map; @@ -126,9 +127,7 @@ public void testCorrelatedSubquery(Map queryContext) .setDimensions(new DefaultDimensionSpec("d1", "_d0")) .setAggregatorSpecs( new DoubleSumAggregatorFactory("_a0:sum", "a0"), - useDefault - ? new CountAggregatorFactory("_a0:count") - : new FilteredAggregatorFactory( + new FilteredAggregatorFactory( new CountAggregatorFactory("_a0:count"), notNull("a0") ) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteExplainQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteExplainQueryTest.java index 946f597c477b..b5c3061e503c 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteExplainQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteExplainQueryTest.java @@ -20,7 +20,6 @@ package org.apache.druid.sql.calcite; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.sql.calcite.planner.PlannerConfig; import org.apache.druid.sql.calcite.util.CalciteTests; import org.junit.jupiter.api.Test; @@ -40,30 +39,18 @@ public void testExplainCountStarOnView() skipVectorize(); final String query = "EXPLAIN PLAN FOR SELECT COUNT(*) FROM view.aview WHERE dim1_firstchar <> 'z'"; - final String explanation = NullHandling.replaceWithDefault() - ? "[{" - + "\"query\":{\"queryType\":\"timeseries\"," - + "\"dataSource\":{\"type\":\"table\",\"name\":\"foo\"}," - + "\"intervals\":{\"type\":\"intervals\",\"intervals\":[\"-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z\"]}," - + "\"filter\":{\"type\":\"and\",\"fields\":[{\"type\":\"selector\",\"dimension\":\"dim2\",\"value\":\"a\"},{\"type\":\"not\",\"field\":{\"type\":\"selector\",\"dimension\":\"dim1\",\"value\":\"z\",\"extractionFn\":{\"type\":\"substring\",\"index\":0,\"length\":1}}}]}," - + "\"granularity\":{\"type\":\"all\"}," - + "\"aggregations\":[{\"type\":\"count\",\"name\":\"a0\"}]," - + "\"context\":{\"defaultTimeout\":300000,\"maxScatterGatherBytes\":9223372036854775807,\"sqlCurrentTimestamp\":\"2000-01-01T00:00:00Z\",\"sqlQueryId\":\"dummy\",\"vectorize\":\"false\",\"vectorizeVirtualColumns\":\"false\"}}," - + "\"signature\":[{\"name\":\"a0\",\"type\":\"LONG\"}]," - + "\"columnMappings\":[{\"queryColumn\":\"a0\",\"outputColumn\":\"EXPR$0\"}]" - + "}]" - : "[{" - + "\"query\":{\"queryType\":\"timeseries\"," - + "\"dataSource\":{\"type\":\"table\",\"name\":\"foo\"}," - + "\"intervals\":{\"type\":\"intervals\",\"intervals\":[\"-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z\"]}," - + "\"virtualColumns\":[{\"type\":\"expression\",\"name\":\"v0\",\"expression\":\"substring(\\\"dim1\\\", 0, 1)\",\"outputType\":\"STRING\"}]," - + "\"filter\":{\"type\":\"and\",\"fields\":[{\"type\":\"equals\",\"column\":\"dim2\",\"matchValueType\":\"STRING\",\"matchValue\":\"a\"},{\"type\":\"not\",\"field\":{\"type\":\"equals\",\"column\":\"v0\",\"matchValueType\":\"STRING\",\"matchValue\":\"z\"}}]}," - + "\"granularity\":{\"type\":\"all\"}," - + "\"aggregations\":[{\"type\":\"count\",\"name\":\"a0\"}]," - + "\"context\":{\"defaultTimeout\":300000,\"maxScatterGatherBytes\":9223372036854775807,\"sqlCurrentTimestamp\":\"2000-01-01T00:00:00Z\",\"sqlQueryId\":\"dummy\",\"vectorize\":\"false\",\"vectorizeVirtualColumns\":\"false\"}}," - + "\"signature\":[{\"name\":\"a0\",\"type\":\"LONG\"}]," - + "\"columnMappings\":[{\"queryColumn\":\"a0\",\"outputColumn\":\"EXPR$0\"}]" - + "}]"; + final String explanation = "[{" + + "\"query\":{\"queryType\":\"timeseries\"," + + "\"dataSource\":{\"type\":\"table\",\"name\":\"foo\"}," + + "\"intervals\":{\"type\":\"intervals\",\"intervals\":[\"-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z\"]}," + + "\"virtualColumns\":[{\"type\":\"expression\",\"name\":\"v0\",\"expression\":\"substring(\\\"dim1\\\", 0, 1)\",\"outputType\":\"STRING\"}]," + + "\"filter\":{\"type\":\"and\",\"fields\":[{\"type\":\"equals\",\"column\":\"dim2\",\"matchValueType\":\"STRING\",\"matchValue\":\"a\"},{\"type\":\"not\",\"field\":{\"type\":\"equals\",\"column\":\"v0\",\"matchValueType\":\"STRING\",\"matchValue\":\"z\"}}]}," + + "\"granularity\":{\"type\":\"all\"}," + + "\"aggregations\":[{\"type\":\"count\",\"name\":\"a0\"}]," + + "\"context\":{\"defaultTimeout\":300000,\"maxScatterGatherBytes\":9223372036854775807,\"sqlCurrentTimestamp\":\"2000-01-01T00:00:00Z\",\"sqlQueryId\":\"dummy\",\"vectorize\":\"false\",\"vectorizeVirtualColumns\":\"false\"}}," + + "\"signature\":[{\"name\":\"a0\",\"type\":\"LONG\"}]," + + "\"columnMappings\":[{\"queryColumn\":\"a0\",\"outputColumn\":\"EXPR$0\"}]" + + "}]"; final String resources = "[{\"name\":\"aview\",\"type\":\"VIEW\"}]"; final String attributes = "{\"statementType\":\"SELECT\"}"; @@ -115,20 +102,7 @@ public void testExplainExactCountDistinctOfSemiJoinResult() + " SELECT SUBSTRING(dim1, 1, 1) FROM druid.foo WHERE dim1 IS NOT NULL\n" + " )\n" + ")"; - final String explanation = NullHandling.replaceWithDefault() ? - "[" - + "{\"query\":{\"queryType\":\"groupBy\"," - + "\"dataSource\":{\"type\":\"query\",\"query\":{\"queryType\":\"groupBy\",\"dataSource\":{\"type\":\"join\",\"left\":{\"type\":\"table\",\"name\":\"foo\"},\"right\":{\"type\":\"query\",\"query\":{\"queryType\":\"groupBy\",\"dataSource\":{\"type\":\"table\",\"name\":\"foo\"},\"intervals\":{\"type\":\"intervals\",\"intervals\":[\"-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z\"]},\"filter\":{\"type\":\"not\",\"field\":{\"type\":\"selector\",\"dimension\":\"dim1\",\"value\":null}},\"granularity\":{\"type\":\"all\"},\"dimensions\":[{\"type\":\"extraction\",\"dimension\":\"dim1\",\"outputName\":\"d0\",\"outputType\":\"STRING\",\"extractionFn\":{\"type\":\"substring\",\"index\":0,\"length\":1}}],\"limitSpec\":{\"type\":\"NoopLimitSpec\"},\"context\":{\"defaultTimeout\":300000,\"maxScatterGatherBytes\":9223372036854775807,\"sqlCurrentTimestamp\":\"2000-01-01T00:00:00Z\",\"sqlQueryId\":\"dummy\",\"vectorize\":\"false\",\"vectorizeVirtualColumns\":\"false\"}}},\"rightPrefix\":\"j0.\",\"condition\":\"(substring(\\\"dim2\\\", 0, 1) == \\\"j0.d0\\\")\",\"joinType\":\"INNER\"},\"intervals\":{\"type\":\"intervals\",\"intervals\":[\"-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z\"]},\"granularity\":{\"type\":\"all\"},\"dimensions\":[{\"type\":\"default\",\"dimension\":\"dim2\",\"outputName\":\"d0\",\"outputType\":\"STRING\"}],\"limitSpec\":{\"type\":\"NoopLimitSpec\"},\"context\":{\"defaultTimeout\":300000,\"maxScatterGatherBytes\":9223372036854775807,\"sqlCurrentTimestamp\":\"2000-01-01T00:00:00Z\",\"sqlQueryId\":\"dummy\",\"vectorize\":\"false\",\"vectorizeVirtualColumns\":\"false\"}}}," - + "\"intervals\":{\"type\":\"intervals\",\"intervals\":[\"-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z\"]}," - + "\"granularity\":{\"type\":\"all\"}," - + "\"dimensions\":[]," - + "\"aggregations\":[{\"type\":\"count\",\"name\":\"a0\"}]," - + "\"limitSpec\":{\"type\":\"NoopLimitSpec\"}," - + "\"context\":{\"defaultTimeout\":300000,\"maxScatterGatherBytes\":9223372036854775807,\"sqlCurrentTimestamp\":\"2000-01-01T00:00:00Z\",\"sqlQueryId\":\"dummy\",\"vectorize\":\"false\",\"vectorizeVirtualColumns\":\"false\"}}," - + "\"signature\":[{\"name\":\"a0\",\"type\":\"LONG\"}]," - + "\"columnMappings\":[{\"queryColumn\":\"a0\",\"outputColumn\":\"EXPR$0\"}]" - + "}]" - : "[{\"query\":{\"queryType\":\"groupBy\",\"dataSource\":{\"type\":\"query\",\"query\":{\"queryType\":\"groupBy\",\"dataSource\":{\"type\":\"join\",\"left\":{\"type\":\"table\",\"name\":\"foo\"},\"right\":{\"type\":\"query\",\"query\":{\"queryType\":\"groupBy\",\"dataSource\":{\"type\":\"table\",\"name\":\"foo\"},\"intervals\":{\"type\":\"intervals\",\"intervals\":[\"-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z\"]},\"filter\":{\"type\":\"not\",\"field\":{\"type\":\"null\",\"column\":\"dim1\"}},\"granularity\":{\"type\":\"all\"},\"dimensions\":[{\"type\":\"extraction\",\"dimension\":\"dim1\",\"outputName\":\"d0\",\"outputType\":\"STRING\",\"extractionFn\":{\"type\":\"substring\",\"index\":0,\"length\":1}}],\"limitSpec\":{\"type\":\"NoopLimitSpec\"},\"context\":{\"defaultTimeout\":300000,\"maxScatterGatherBytes\":9223372036854775807,\"sqlCurrentTimestamp\":\"2000-01-01T00:00:00Z\",\"sqlQueryId\":\"dummy\",\"vectorize\":\"false\",\"vectorizeVirtualColumns\":\"false\"}}},\"rightPrefix\":\"j0.\",\"condition\":\"(substring(\\\"dim2\\\", 0, 1) == \\\"j0.d0\\\")\",\"joinType\":\"INNER\"},\"intervals\":{\"type\":\"intervals\",\"intervals\":[\"-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z\"]},\"granularity\":{\"type\":\"all\"},\"dimensions\":[{\"type\":\"default\",\"dimension\":\"dim2\",\"outputName\":\"d0\",\"outputType\":\"STRING\"}],\"limitSpec\":{\"type\":\"NoopLimitSpec\"},\"context\":{\"defaultTimeout\":300000,\"maxScatterGatherBytes\":9223372036854775807,\"sqlCurrentTimestamp\":\"2000-01-01T00:00:00Z\",\"sqlQueryId\":\"dummy\",\"vectorize\":\"false\",\"vectorizeVirtualColumns\":\"false\"}}},\"intervals\":{\"type\":\"intervals\",\"intervals\":[\"-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z\"]},\"granularity\":{\"type\":\"all\"},\"dimensions\":[],\"aggregations\":[{\"type\":\"count\",\"name\":\"a0\"}],\"limitSpec\":{\"type\":\"NoopLimitSpec\"},\"context\":{\"defaultTimeout\":300000,\"maxScatterGatherBytes\":9223372036854775807,\"sqlCurrentTimestamp\":\"2000-01-01T00:00:00Z\",\"sqlQueryId\":\"dummy\",\"vectorize\":\"false\",\"vectorizeVirtualColumns\":\"false\"}},\"signature\":[{\"name\":\"a0\",\"type\":\"LONG\"}],\"columnMappings\":[{\"queryColumn\":\"a0\",\"outputColumn\":\"EXPR$0\"}]}]"; + final String explanation = "[{\"query\":{\"queryType\":\"groupBy\",\"dataSource\":{\"type\":\"query\",\"query\":{\"queryType\":\"groupBy\",\"dataSource\":{\"type\":\"join\",\"left\":{\"type\":\"table\",\"name\":\"foo\"},\"right\":{\"type\":\"query\",\"query\":{\"queryType\":\"groupBy\",\"dataSource\":{\"type\":\"table\",\"name\":\"foo\"},\"intervals\":{\"type\":\"intervals\",\"intervals\":[\"-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z\"]},\"filter\":{\"type\":\"not\",\"field\":{\"type\":\"null\",\"column\":\"dim1\"}},\"granularity\":{\"type\":\"all\"},\"dimensions\":[{\"type\":\"extraction\",\"dimension\":\"dim1\",\"outputName\":\"d0\",\"outputType\":\"STRING\",\"extractionFn\":{\"type\":\"substring\",\"index\":0,\"length\":1}}],\"limitSpec\":{\"type\":\"NoopLimitSpec\"},\"context\":{\"defaultTimeout\":300000,\"maxScatterGatherBytes\":9223372036854775807,\"sqlCurrentTimestamp\":\"2000-01-01T00:00:00Z\",\"sqlQueryId\":\"dummy\",\"vectorize\":\"false\",\"vectorizeVirtualColumns\":\"false\"}}},\"rightPrefix\":\"j0.\",\"condition\":\"(substring(\\\"dim2\\\", 0, 1) == \\\"j0.d0\\\")\",\"joinType\":\"INNER\"},\"intervals\":{\"type\":\"intervals\",\"intervals\":[\"-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z\"]},\"granularity\":{\"type\":\"all\"},\"dimensions\":[{\"type\":\"default\",\"dimension\":\"dim2\",\"outputName\":\"d0\",\"outputType\":\"STRING\"}],\"limitSpec\":{\"type\":\"NoopLimitSpec\"},\"context\":{\"defaultTimeout\":300000,\"maxScatterGatherBytes\":9223372036854775807,\"sqlCurrentTimestamp\":\"2000-01-01T00:00:00Z\",\"sqlQueryId\":\"dummy\",\"vectorize\":\"false\",\"vectorizeVirtualColumns\":\"false\"}}},\"intervals\":{\"type\":\"intervals\",\"intervals\":[\"-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z\"]},\"granularity\":{\"type\":\"all\"},\"dimensions\":[],\"aggregations\":[{\"type\":\"count\",\"name\":\"a0\"}],\"limitSpec\":{\"type\":\"NoopLimitSpec\"},\"context\":{\"defaultTimeout\":300000,\"maxScatterGatherBytes\":9223372036854775807,\"sqlCurrentTimestamp\":\"2000-01-01T00:00:00Z\",\"sqlQueryId\":\"dummy\",\"vectorize\":\"false\",\"vectorizeVirtualColumns\":\"false\"}},\"signature\":[{\"name\":\"a0\",\"type\":\"LONG\"}],\"columnMappings\":[{\"queryColumn\":\"a0\",\"outputColumn\":\"EXPR$0\"}]}]"; final String resources = "[{\"name\":\"foo\",\"type\":\"DATASOURCE\"}]"; final String attributes = "{\"statementType\":\"SELECT\"}"; @@ -162,9 +136,7 @@ public void testExplainMultipleTopLevelUnionAllQueries() final String query = "EXPLAIN PLAN FOR SELECT dim1 FROM druid.foo\n" + "UNION ALL (SELECT dim1 FROM druid.foo WHERE dim1 = '42'\n" + "UNION ALL SELECT dim1 FROM druid.foo WHERE dim1 = '44')"; - final String explanation = NullHandling.replaceWithDefault() - ? "[{\"query\":{\"queryType\":\"scan\",\"dataSource\":{\"type\":\"table\",\"name\":\"foo\"},\"intervals\":{\"type\":\"intervals\",\"intervals\":[\"-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z\"]},\"resultFormat\":\"compactedList\",\"columns\":[\"dim1\"],\"context\":{\"defaultTimeout\":300000,\"maxScatterGatherBytes\":9223372036854775807,\"sqlCurrentTimestamp\":\"2000-01-01T00:00:00Z\",\"sqlQueryId\":\"dummy\",\"vectorize\":\"false\",\"vectorizeVirtualColumns\":\"false\"},\"columnTypes\":[\"STRING\"],\"granularity\":{\"type\":\"all\"},\"legacy\":false},\"signature\":[{\"name\":\"dim1\",\"type\":\"STRING\"}],\"columnMappings\":[{\"queryColumn\":\"dim1\",\"outputColumn\":\"dim1\"}]},{\"query\":{\"queryType\":\"scan\",\"dataSource\":{\"type\":\"table\",\"name\":\"foo\"},\"intervals\":{\"type\":\"intervals\",\"intervals\":[\"-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z\"]},\"resultFormat\":\"compactedList\",\"filter\":{\"type\":\"selector\",\"dimension\":\"dim1\",\"value\":\"42\"},\"columns\":[\"dim1\"],\"context\":{\"defaultTimeout\":300000,\"maxScatterGatherBytes\":9223372036854775807,\"sqlCurrentTimestamp\":\"2000-01-01T00:00:00Z\",\"sqlQueryId\":\"dummy\",\"vectorize\":\"false\",\"vectorizeVirtualColumns\":\"false\"},\"columnTypes\":[\"STRING\"],\"granularity\":{\"type\":\"all\"},\"legacy\":false},\"signature\":[{\"name\":\"dim1\",\"type\":\"STRING\"}],\"columnMappings\":[{\"queryColumn\":\"dim1\",\"outputColumn\":\"dim1\"}]},{\"query\":{\"queryType\":\"scan\",\"dataSource\":{\"type\":\"table\",\"name\":\"foo\"},\"intervals\":{\"type\":\"intervals\",\"intervals\":[\"-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z\"]},\"resultFormat\":\"compactedList\",\"filter\":{\"type\":\"selector\",\"dimension\":\"dim1\",\"value\":\"44\"},\"columns\":[\"dim1\"],\"context\":{\"defaultTimeout\":300000,\"maxScatterGatherBytes\":9223372036854775807,\"sqlCurrentTimestamp\":\"2000-01-01T00:00:00Z\",\"sqlQueryId\":\"dummy\",\"vectorize\":\"false\",\"vectorizeVirtualColumns\":\"false\"},\"columnTypes\":[\"STRING\"],\"granularity\":{\"type\":\"all\"},\"legacy\":false},\"signature\":[{\"name\":\"dim1\",\"type\":\"STRING\"}],\"columnMappings\":[{\"queryColumn\":\"dim1\",\"outputColumn\":\"dim1\"}]}]" - : "[{\"query\":{\"queryType\":\"scan\",\"dataSource\":{\"type\":\"table\",\"name\":\"foo\"},\"intervals\":{\"type\":\"intervals\",\"intervals\":[\"-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z\"]},\"resultFormat\":\"compactedList\",\"columns\":[\"dim1\"],\"context\":{\"defaultTimeout\":300000,\"maxScatterGatherBytes\":9223372036854775807,\"sqlCurrentTimestamp\":\"2000-01-01T00:00:00Z\",\"sqlQueryId\":\"dummy\",\"vectorize\":\"false\",\"vectorizeVirtualColumns\":\"false\"},\"columnTypes\":[\"STRING\"],\"granularity\":{\"type\":\"all\"},\"legacy\":false},\"signature\":[{\"name\":\"dim1\",\"type\":\"STRING\"}],\"columnMappings\":[{\"queryColumn\":\"dim1\",\"outputColumn\":\"dim1\"}]},{\"query\":{\"queryType\":\"scan\",\"dataSource\":{\"type\":\"table\",\"name\":\"foo\"},\"intervals\":{\"type\":\"intervals\",\"intervals\":[\"-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z\"]},\"resultFormat\":\"compactedList\",\"filter\":{\"type\":\"equals\",\"column\":\"dim1\",\"matchValueType\":\"STRING\",\"matchValue\":\"42\"},\"columns\":[\"dim1\"],\"context\":{\"defaultTimeout\":300000,\"maxScatterGatherBytes\":9223372036854775807,\"sqlCurrentTimestamp\":\"2000-01-01T00:00:00Z\",\"sqlQueryId\":\"dummy\",\"vectorize\":\"false\",\"vectorizeVirtualColumns\":\"false\"},\"columnTypes\":[\"STRING\"],\"granularity\":{\"type\":\"all\"},\"legacy\":false},\"signature\":[{\"name\":\"dim1\",\"type\":\"STRING\"}],\"columnMappings\":[{\"queryColumn\":\"dim1\",\"outputColumn\":\"dim1\"}]},{\"query\":{\"queryType\":\"scan\",\"dataSource\":{\"type\":\"table\",\"name\":\"foo\"},\"intervals\":{\"type\":\"intervals\",\"intervals\":[\"-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z\"]},\"resultFormat\":\"compactedList\",\"filter\":{\"type\":\"equals\",\"column\":\"dim1\",\"matchValueType\":\"STRING\",\"matchValue\":\"44\"},\"columns\":[\"dim1\"],\"context\":{\"defaultTimeout\":300000,\"maxScatterGatherBytes\":9223372036854775807,\"sqlCurrentTimestamp\":\"2000-01-01T00:00:00Z\",\"sqlQueryId\":\"dummy\",\"vectorize\":\"false\",\"vectorizeVirtualColumns\":\"false\"},\"columnTypes\":[\"STRING\"],\"granularity\":{\"type\":\"all\"},\"legacy\":false},\"signature\":[{\"name\":\"dim1\",\"type\":\"STRING\"}],\"columnMappings\":[{\"queryColumn\":\"dim1\",\"outputColumn\":\"dim1\"}]}]"; + final String explanation = "[{\"query\":{\"queryType\":\"scan\",\"dataSource\":{\"type\":\"table\",\"name\":\"foo\"},\"intervals\":{\"type\":\"intervals\",\"intervals\":[\"-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z\"]},\"resultFormat\":\"compactedList\",\"columns\":[\"dim1\"],\"context\":{\"defaultTimeout\":300000,\"maxScatterGatherBytes\":9223372036854775807,\"sqlCurrentTimestamp\":\"2000-01-01T00:00:00Z\",\"sqlQueryId\":\"dummy\",\"vectorize\":\"false\",\"vectorizeVirtualColumns\":\"false\"},\"columnTypes\":[\"STRING\"],\"granularity\":{\"type\":\"all\"},\"legacy\":false},\"signature\":[{\"name\":\"dim1\",\"type\":\"STRING\"}],\"columnMappings\":[{\"queryColumn\":\"dim1\",\"outputColumn\":\"dim1\"}]},{\"query\":{\"queryType\":\"scan\",\"dataSource\":{\"type\":\"table\",\"name\":\"foo\"},\"intervals\":{\"type\":\"intervals\",\"intervals\":[\"-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z\"]},\"resultFormat\":\"compactedList\",\"filter\":{\"type\":\"equals\",\"column\":\"dim1\",\"matchValueType\":\"STRING\",\"matchValue\":\"42\"},\"columns\":[\"dim1\"],\"context\":{\"defaultTimeout\":300000,\"maxScatterGatherBytes\":9223372036854775807,\"sqlCurrentTimestamp\":\"2000-01-01T00:00:00Z\",\"sqlQueryId\":\"dummy\",\"vectorize\":\"false\",\"vectorizeVirtualColumns\":\"false\"},\"columnTypes\":[\"STRING\"],\"granularity\":{\"type\":\"all\"},\"legacy\":false},\"signature\":[{\"name\":\"dim1\",\"type\":\"STRING\"}],\"columnMappings\":[{\"queryColumn\":\"dim1\",\"outputColumn\":\"dim1\"}]},{\"query\":{\"queryType\":\"scan\",\"dataSource\":{\"type\":\"table\",\"name\":\"foo\"},\"intervals\":{\"type\":\"intervals\",\"intervals\":[\"-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z\"]},\"resultFormat\":\"compactedList\",\"filter\":{\"type\":\"equals\",\"column\":\"dim1\",\"matchValueType\":\"STRING\",\"matchValue\":\"44\"},\"columns\":[\"dim1\"],\"context\":{\"defaultTimeout\":300000,\"maxScatterGatherBytes\":9223372036854775807,\"sqlCurrentTimestamp\":\"2000-01-01T00:00:00Z\",\"sqlQueryId\":\"dummy\",\"vectorize\":\"false\",\"vectorizeVirtualColumns\":\"false\"},\"columnTypes\":[\"STRING\"],\"granularity\":{\"type\":\"all\"},\"legacy\":false},\"signature\":[{\"name\":\"dim1\",\"type\":\"STRING\"}],\"columnMappings\":[{\"queryColumn\":\"dim1\",\"outputColumn\":\"dim1\"}]}]"; final String resources = "[{\"name\":\"foo\",\"type\":\"DATASOURCE\"}]"; final String attributes = "{\"statementType\":\"SELECT\"}"; testQuery( diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java index fb4be084efcf..2784f929df5a 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java @@ -22,7 +22,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; import org.apache.druid.error.DruidExceptionMatcher; import org.apache.druid.java.util.common.DateTimes; @@ -44,7 +43,6 @@ import org.apache.druid.query.LookupDataSource; import org.apache.druid.query.Order; import org.apache.druid.query.Query; -import org.apache.druid.query.QueryContext; import org.apache.druid.query.QueryContexts; import org.apache.druid.query.QueryDataSource; import org.apache.druid.query.QueryException; @@ -110,7 +108,6 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assumptions.assumeFalse; public class CalciteJoinQueryTest extends BaseCalciteQueryTest { @@ -188,7 +185,7 @@ public void testInnerJoinWithLimitAndAlias() // to compute the query with limit 1. @SqlTestFrameworkConfig.MinTopNThreshold(1) @Test - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.EQUIV_PLAN, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.EQUIV_PLAN) public void testExactTopNOnInnerJoinWithLimit() { Map context = new HashMap<>(QUERY_CONTEXT_DEFAULT); @@ -237,7 +234,7 @@ public void testExactTopNOnInnerJoinWithLimit() ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.EQUIV_PLAN_EXTRA_COLUMNS, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.EQUIV_PLAN_EXTRA_COLUMNS) @Test public void testJoinOuterGroupByAndSubqueryHasLimit() { @@ -282,12 +279,7 @@ public void testJoinOuterGroupByAndSubqueryHasLimit() .setDimensions(new DefaultDimensionSpec("dim2", "d0", ColumnType.STRING)) .setGranularity(Granularities.ALL) .setAggregatorSpecs( - useDefault - ? aggregators( - new DoubleSumAggregatorFactory("a0:sum", "m2"), - new CountAggregatorFactory("a0:count") - ) - : aggregators( + aggregators( new DoubleSumAggregatorFactory("a0:sum", "m2"), new FilteredAggregatorFactory( new CountAggregatorFactory("a0:count"), @@ -311,18 +303,12 @@ public void testJoinOuterGroupByAndSubqueryHasLimit() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.sqlCompatible() - ? ImmutableList.of( + ImmutableList.of( new Object[]{null, 4.0}, new Object[]{"", 3.0}, new Object[]{"a", 2.5}, new Object[]{"abc", 5.0} ) - : ImmutableList.of( - new Object[]{"", 3.6666666666666665}, - new Object[]{"a", 2.5}, - new Object[]{"abc", 5.0} - ) ); } @@ -366,12 +352,7 @@ public void testJoinOuterGroupByAndSubqueryNoLimit(Map queryCont .setDimensions(new DefaultDimensionSpec("dim2", "d0", ColumnType.STRING)) .setGranularity(Granularities.ALL) .setAggregatorSpecs( - useDefault - ? aggregators( - new DoubleSumAggregatorFactory("a0:sum", "m2"), - new CountAggregatorFactory("a0:count") - ) - : aggregators( + aggregators( new DoubleSumAggregatorFactory("a0:sum", "m2"), new FilteredAggregatorFactory( new CountAggregatorFactory("a0:count"), @@ -396,18 +377,12 @@ public void testJoinOuterGroupByAndSubqueryNoLimit(Map queryCont .build() .withOverriddenContext(queryContext) ), - NullHandling.sqlCompatible() - ? ImmutableList.of( + ImmutableList.of( new Object[]{null, 4.0}, new Object[]{"", 3.0}, new Object[]{"a", 2.5}, new Object[]{"abc", 5.0} ) - : ImmutableList.of( - new Object[]{"", 3.6666666666666665}, - new Object[]{"a", 2.5}, - new Object[]{"abc", 5.0} - ) ); } @@ -455,12 +430,7 @@ public void testJoinWithLimitBeforeJoining() .setDimensions(new DefaultDimensionSpec("dim2", "d0", ColumnType.STRING)) .setGranularity(Granularities.ALL) .setAggregatorSpecs( - useDefault - ? aggregators( - new DoubleSumAggregatorFactory("a0:sum", "m2"), - new CountAggregatorFactory("a0:count") - ) - : aggregators( + aggregators( new DoubleSumAggregatorFactory("a0:sum", "m2"), new FilteredAggregatorFactory( new CountAggregatorFactory("a0:count"), @@ -484,23 +454,17 @@ public void testJoinWithLimitBeforeJoining() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.sqlCompatible() - ? ImmutableList.of( + ImmutableList.of( new Object[]{null, 4.0}, new Object[]{"", 3.0}, new Object[]{"a", 2.5}, new Object[]{"abc", 5.0} ) - : ImmutableList.of( - new Object[]{"", 3.6666666666666665}, - new Object[]{"a", 2.5}, - new Object[]{"abc", 5.0} - ) ); } @Test - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.JOIN_FILTER_LOCATIONS, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.JOIN_FILTER_LOCATIONS) public void testJoinOnTimeseriesWithFloorOnTime() { // Cannot vectorize JOIN operator. @@ -555,7 +519,7 @@ public void testJoinOnTimeseriesWithFloorOnTime() } @Test - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.JOIN_FILTER_LOCATIONS, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.JOIN_FILTER_LOCATIONS) public void testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime() { // Cannot vectorize JOIN operator. @@ -622,7 +586,7 @@ public void testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime() } @Test - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.JOIN_FILTER_LOCATIONS, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.JOIN_FILTER_LOCATIONS) public void testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues() { // Cannot vectorize JOIN operator. @@ -688,7 +652,7 @@ public void testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMu ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND) @MethodSource("provideQueryContexts") @ParameterizedTest(name = "{0}") public void testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing(Map queryContext) @@ -764,13 +728,13 @@ public void testFilterAndGroupByLookupUsingJoinOperatorAllowNulls(Map queryContext) @@ -805,7 +769,7 @@ public void testFilterAndGroupByLookupUsingJoinOperatorBackwards(Map queryContext) { - assumeFalse( - isRunningMSQ() && isSortBasedJoin() && NullHandling.replaceWithDefault(), - "test disabled; returns incorrect results in this mode" - ); // Cannot vectorize JOIN operator. cannotVectorize(); @@ -853,7 +808,7 @@ public void testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter(Map queryContext) @@ -906,7 +856,7 @@ public void testJoinUnionTablesOnLookup(Map queryContext) new LookupDataSource("lookyloo"), "j0.", equalsCondition(makeColumnExpression("dim2"), makeColumnExpression("j0.k")), - NullHandling.sqlCompatible() ? JoinType.INNER : JoinType.LEFT + JoinType.INNER ) ) .setInterval(querySegmentSpec(Filtration.eternity())) @@ -917,18 +867,13 @@ public void testJoinUnionTablesOnLookup(Map queryContext) .setContext(queryContext) .build() ), - NullHandling.replaceWithDefault() - ? ImmutableList.of( - new Object[]{NULL_STRING, 6L}, - new Object[]{"xabc", 2L} - ) - : ImmutableList.of( + ImmutableList.of( new Object[]{"xabc", 2L} ) ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND) @MethodSource("provideQueryContexts") @ParameterizedTest(name = "{0}") public void testFilterAndGroupByLookupUsingJoinOperator(Map queryContext) @@ -1013,13 +958,9 @@ public void testFilterAndGroupByLookupUsingPostAggregationJoinOperator(Map queryCon ), sortIfSortBased( ImmutableList.of( - new Object[]{"", "a", NULL_STRING, "xa"}, - new Object[]{"10.1", NULL_STRING, NULL_STRING, NULL_STRING}, - new Object[]{"2", "", NULL_STRING, NULL_STRING}, - new Object[]{"1", "a", NULL_STRING, "xa"}, - new Object[]{"def", "abc", NULL_STRING, "xabc"}, - new Object[]{"abc", NULL_STRING, "xabc", NULL_STRING} + new Object[]{"", "a", null, "xa"}, + new Object[]{"10.1", null, null, null}, + new Object[]{"2", "", null, null}, + new Object[]{"1", "a", null, "xa"}, + new Object[]{"def", "abc", null, "xabc"}, + new Object[]{"abc", null, "xabc", null} ), 1 ) ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND) @MethodSource("provideQueryContexts") @ParameterizedTest(name = "{0}") public void testInnerJoinTableLookupLookupWithFilterWithOuterLimit(Map queryContext) @@ -1186,7 +1127,7 @@ public void testInnerJoinTableLookupLookupWithFilterWithOuterLimit(Map queryContext) @@ -1229,7 +1170,7 @@ public void testInnerJoinTableLookupLookupWithFilterWithoutLimit(Map queryContext) @@ -1275,7 +1216,7 @@ public void testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND) @MethodSource("provideQueryContexts") @ParameterizedTest(name = "{0}") public void testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns(Map queryContext) @@ -1318,7 +1259,7 @@ public void testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns(M ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN) @MethodSource("provideQueryContexts") @ParameterizedTest(name = "{0}") public void testManyManyInnerJoinOnManyManyLookup(Map queryContext) @@ -2079,25 +2020,17 @@ public void testCommaJoinTableLookupTableMismatchedTypes(Map que .build() ), "_j0.", - NullHandling.sqlCompatible() ? equalsCondition( DruidExpression.fromExpression("CAST(\"j0.k\", 'LONG')"), DruidExpression.ofColumn(ColumnType.LONG, "_j0.cnt") - ) - : "1", + ), JoinType.INNER ) ) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) .aggregators(new CountAggregatorFactory("a0")) - .filters( - NullHandling.sqlCompatible() ? - expressionFilter("(\"cnt\" == CAST(\"j0.k\", 'LONG'))") - : and( - expressionFilter("(\"cnt\" == CAST(\"j0.k\", 'LONG'))"), - expressionFilter("(CAST(\"j0.k\", 'LONG') == \"_j0.cnt\")") - )) + .filters(expressionFilter("(\"cnt\" == CAST(\"j0.k\", 'LONG'))")) .context(QUERY_CONTEXT_DEFAULT) .build() ), @@ -2180,7 +2113,7 @@ public void testJoinTableLookupTableMismatchedTypesWithoutComma(Map queryContext) @@ -2433,11 +2366,11 @@ public void testLeftJoinLookupOntoLookupUsingJoinOperator(Map qu sortIfSortBased( ImmutableList.of( new Object[]{"a", "xa", "xa"}, - new Object[]{NULL_STRING, NULL_STRING, NULL_STRING}, - new Object[]{"", NULL_STRING, NULL_STRING}, + new Object[]{null, null, null}, + new Object[]{"", null, null}, new Object[]{"a", "xa", "xa"}, new Object[]{"abc", "xabc", "xabc"}, - new Object[]{NULL_STRING, NULL_STRING, NULL_STRING} + new Object[]{null, null, null} ), 0 ) @@ -2486,12 +2419,12 @@ public void testLeftJoinThreeLookupsUsingJoinOperator(Map queryC ), sortIfSortBased( ImmutableList.of( - new Object[]{"", "a", NULL_STRING, "xa", "xa"}, - new Object[]{"10.1", NULL_STRING, NULL_STRING, NULL_STRING, NULL_STRING}, - new Object[]{"2", "", NULL_STRING, NULL_STRING, NULL_STRING}, - new Object[]{"1", "a", NULL_STRING, "xa", "xa"}, - new Object[]{"def", "abc", NULL_STRING, "xabc", "xabc"}, - new Object[]{"abc", NULL_STRING, "xabc", NULL_STRING, NULL_STRING} + new Object[]{"", "a", null, "xa", "xa"}, + new Object[]{"10.1", null, null, null, null}, + new Object[]{"2", "", null, null, null}, + new Object[]{"1", "a", null, "xa", "xa"}, + new Object[]{"def", "abc", null, "xabc", "xabc"}, + new Object[]{"abc", null, "xabc", null, null} ), 1, 0 @@ -2533,11 +2466,11 @@ public void testSelectOnLookupUsingLeftJoinOperator(Map queryCon ), sortIfSortBased( ImmutableList.of( - new Object[]{"", NULL_STRING, NULL_STRING}, - new Object[]{"10.1", NULL_STRING, NULL_STRING}, - new Object[]{"2", NULL_STRING, NULL_STRING}, - new Object[]{"1", NULL_STRING, NULL_STRING}, - new Object[]{"def", NULL_STRING, NULL_STRING}, + new Object[]{"", null, null}, + new Object[]{"10.1", null, null}, + new Object[]{"2", null, null}, + new Object[]{"1", null, null}, + new Object[]{"def", null, null}, new Object[]{"abc", "abc", "xabc"} ), 0 @@ -2545,7 +2478,7 @@ public void testSelectOnLookupUsingLeftJoinOperator(Map queryCon ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND) @MethodSource("provideQueryContexts") @ParameterizedTest(name = "{0}") public void testSelectOnLookupUsingRightJoinOperator(Map queryContext) @@ -2583,9 +2516,9 @@ public void testSelectOnLookupUsingRightJoinOperator(Map queryCo ), ImmutableList.of( new Object[]{"abc", "abc", "xabc"}, - new Object[]{NULL_STRING, "6", "x6"}, - new Object[]{NULL_STRING, "a", "xa"}, - new Object[]{NULL_STRING, "nosuchkey", "mysteryvalue"} + new Object[]{null, "6", "x6"}, + new Object[]{null, "a", "xa"}, + new Object[]{null, "nosuchkey", "mysteryvalue"} ) ); } @@ -2626,15 +2559,15 @@ public void testSelectOnLookupUsingFullJoinOperator(Map queryCon .build() ), ImmutableList.of( - new Object[]{"", 1f, 1L, NULL_STRING, NULL_STRING}, - new Object[]{"10.1", 2f, 1L, NULL_STRING, NULL_STRING}, - new Object[]{"2", 3f, 1L, NULL_STRING, NULL_STRING}, - new Object[]{"1", 4f, 1L, NULL_STRING, NULL_STRING}, - new Object[]{"def", 5f, 1L, NULL_STRING, NULL_STRING}, + new Object[]{"", 1f, 1L, null, null}, + new Object[]{"10.1", 2f, 1L, null, null}, + new Object[]{"2", 3f, 1L, null, null}, + new Object[]{"1", 4f, 1L, null, null}, + new Object[]{"def", 5f, 1L, null, null}, new Object[]{"abc", 6f, 1L, "abc", "xabc"}, - new Object[]{NULL_STRING, NULL_FLOAT, NULL_LONG, "6", "x6"}, - new Object[]{NULL_STRING, NULL_FLOAT, NULL_LONG, "a", "xa"}, - new Object[]{NULL_STRING, NULL_FLOAT, NULL_LONG, "nosuchkey", "mysteryvalue"} + new Object[]{null, null, null, "6", "x6"}, + new Object[]{null, null, null, "a", "xa"}, + new Object[]{null, null, null, "nosuchkey", "mysteryvalue"} ) ); } @@ -2725,12 +2658,10 @@ public void testNotInAggregationSubquery(Map queryContext) .setGranularity(Granularities.ALL) .setAggregatorSpecs( new CountAggregatorFactory("_a0"), - NullHandling.sqlCompatible() - ? new FilteredAggregatorFactory( + new FilteredAggregatorFactory( new CountAggregatorFactory("_a1"), notNull("a0") ) - : new CountAggregatorFactory("_a1") ) .setContext(queryContext) .build() @@ -2776,7 +2707,7 @@ public void testNotInAggregationSubquery(Map queryContext) ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.JOIN_FILTER_LOCATIONS, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.JOIN_FILTER_LOCATIONS) @MethodSource("provideQueryContexts") @ParameterizedTest(name = "{0}") public void testUsingSubqueryWithExtractionFns(Map queryContext) @@ -2837,7 +2768,7 @@ public void testUsingSubqueryWithExtractionFns(Map queryContext) ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.EQUIV_PLAN, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.EQUIV_PLAN) @MethodSource("provideQueryContexts") @ParameterizedTest(name = "{0}") public void testInnerJoinWithIsNullFilter(Map queryContext) @@ -2984,7 +2915,7 @@ public void testLeftJoinOnTwoInlineDataSourcesWithTimeFilter(Map ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.JOIN_LEFT_DIRECT_ACCESS, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.JOIN_LEFT_DIRECT_ACCESS) @MethodSource("provideQueryContexts") @ParameterizedTest(name = "{0}") public void testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess(Map queryContext) @@ -3101,7 +3032,7 @@ public void testLeftJoinOnTwoInlineDataSourcesWithOuterWhere(Map ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.JOIN_LEFT_DIRECT_ACCESS, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.JOIN_LEFT_DIRECT_ACCESS) @MethodSource("provideQueryContexts") @ParameterizedTest(name = "{0}") public void testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess(Map queryContext) @@ -3208,7 +3139,7 @@ public void testLeftJoinOnTwoInlineDataSources(Map queryContext) ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.JOIN_LEFT_DIRECT_ACCESS, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.JOIN_LEFT_DIRECT_ACCESS) @MethodSource("provideQueryContexts") @ParameterizedTest(name = "{0}") public void testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess(Map queryContext) @@ -3315,7 +3246,7 @@ public void testInnerJoinOnTwoInlineDataSourcesWithOuterWhere(Map queryContext) @@ -3424,7 +3355,7 @@ public void testInnerJoinOnTwoInlineDataSources(Map queryContext @MethodSource("provideQueryContexts") @ParameterizedTest(name = "{0}") - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.EQUIV_PLAN, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.EQUIV_PLAN) public void testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources(Map queryContext) { cannotVectorize(); @@ -3509,7 +3440,7 @@ public void testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources(Map queryContext) @@ -3640,13 +3571,7 @@ public void testLeftJoinRightTableCanBeEmpty() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - useDefault - ? ImmutableList.of( - new Object[]{"", 2L}, - new Object[]{"a", 1L}, - new Object[]{"abc", 1L} - ) - : ImmutableList.of( + ImmutableList.of( new Object[]{null, 1L}, new Object[]{"", 1L}, new Object[]{"a", 1L}, @@ -3659,73 +3584,9 @@ public void testLeftJoinRightTableCanBeEmpty() @ParameterizedTest(name = "{0}") public void testLeftJoinSubqueryWithNullKeyFilter(Map queryContext) { - // JoinFilterAnalyzer bug causes incorrect results on this test in replace-with-default mode. - // This test case was originally added in https://github.com/apache/druid/pull/11434 with a note about this. - assumeFalse(NullHandling.replaceWithDefault() && QueryContext.of(queryContext).getEnableJoinFilterRewrite()); - - assumeFalse( - testBuilder().isDecoupledMode() && NullHandling.replaceWithDefault(), - "join condition not support in decoupled mode" - ); - // Cannot vectorize due to 'concat' expression. cannotVectorize(); - ScanQuery nullCompatibleModePlan = newScanQueryBuilder() - .dataSource( - join( - new TableDataSource(CalciteTests.DATASOURCE1), - new QueryDataSource( - GroupByQuery - .builder() - .setDataSource(new LookupDataSource("lookyloo")) - .setInterval(querySegmentSpec(Filtration.eternity())) - .setGranularity(Granularities.ALL) - .setVirtualColumns( - expressionVirtualColumn("v0", "concat(\"k\",'')", ColumnType.STRING) - ) - .setDimensions(new DefaultDimensionSpec("v0", "d0")) - .build() - ), - "j0.", - equalsCondition(makeColumnExpression("dim1"), makeColumnExpression("j0.d0")), - JoinType.INNER - ) - ) - .intervals(querySegmentSpec(Filtration.eternity())) - .columns("dim1", "j0.d0") - .columnTypes(ColumnType.STRING, ColumnType.STRING) - .context(queryContext) - .build(); - - ScanQuery nonNullCompatibleModePlan = newScanQueryBuilder() - .dataSource( - join( - new TableDataSource(CalciteTests.DATASOURCE1), - new QueryDataSource( - GroupByQuery - .builder() - .setDataSource(new LookupDataSource("lookyloo")) - .setInterval(querySegmentSpec(Filtration.eternity())) - .setGranularity(Granularities.ALL) - .setVirtualColumns( - expressionVirtualColumn("v0", "concat(\"k\",'')", ColumnType.STRING) - ) - .setDimensions(new DefaultDimensionSpec("v0", "d0")) - .build() - ), - "j0.", - equalsCondition(makeColumnExpression("dim1"), makeColumnExpression("j0.d0")), - JoinType.LEFT - ) - ) - .intervals(querySegmentSpec(Filtration.eternity())) - .columns("dim1", "j0.d0") - .columnTypes(ColumnType.STRING, ColumnType.STRING) - .filters(notNull("j0.d0")) - .context(queryContext) - .build(); - boolean isJoinFilterRewriteEnabled = queryContext.getOrDefault(QueryContexts.JOIN_FILTER_REWRITE_ENABLE_KEY, true) .toString() .equals("true"); @@ -3735,23 +3596,41 @@ public void testLeftJoinSubqueryWithNullKeyFilter(Map queryConte + "LEFT JOIN (select k || '' as k from lookup.lookyloo group by 1) l1 ON foo.dim1 = l1.k\n" + "WHERE l1.k IS NOT NULL\n", queryContext, - ImmutableList.of(NullHandling.sqlCompatible() ? nullCompatibleModePlan : nonNullCompatibleModePlan), - NullHandling.sqlCompatible() || !isJoinFilterRewriteEnabled - ? ImmutableList.of(new Object[]{"abc", "abc"}) - : ImmutableList.of( - new Object[]{"10.1", ""}, - // this result is incorrect. TODO : fix this result when the JoinFilterAnalyzer bug is fixed - new Object[]{"2", ""}, - new Object[]{"1", ""}, - new Object[]{"def", ""}, - new Object[]{"abc", "abc"} - ) + ImmutableList.of( + newScanQueryBuilder() + .dataSource( + join( + new TableDataSource(CalciteTests.DATASOURCE1), + new QueryDataSource( + GroupByQuery + .builder() + .setDataSource(new LookupDataSource("lookyloo")) + .setInterval(querySegmentSpec(Filtration.eternity())) + .setGranularity(Granularities.ALL) + .setVirtualColumns( + expressionVirtualColumn("v0", "concat(\"k\",'')", ColumnType.STRING) + ) + .setDimensions(new DefaultDimensionSpec("v0", "d0")) + .build() + ), + "j0.", + equalsCondition(makeColumnExpression("dim1"), makeColumnExpression("j0.d0")), + JoinType.INNER + ) + ) + .intervals(querySegmentSpec(Filtration.eternity())) + .columns("dim1", "j0.d0") + .columnTypes(ColumnType.STRING, ColumnType.STRING) + .context(queryContext) + .build() + ), + ImmutableList.of(new Object[]{"abc", "abc"}) ); } @MethodSource("provideQueryContexts") @ParameterizedTest(name = "{0}") - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN) public void testLeftJoinSubqueryWithSelectorFilter(Map queryContext) { // Cannot vectorize due to 'concat' expression. @@ -3888,21 +3767,13 @@ public void testInnerJoin(Map queryContext) .build() ), sortIfSortBased( - NullHandling.sqlCompatible() - ? ImmutableList.of( + ImmutableList.of( new Object[]{"", ""}, new Object[]{"10.1", "10.1"}, new Object[]{"2", "2"}, new Object[]{"1", "1"}, new Object[]{"def", "def"}, new Object[]{"abc", "abc"} - ) - : ImmutableList.of( - new Object[]{"10.1", "10.1"}, - new Object[]{"2", "2"}, - new Object[]{"1", "1"}, - new Object[]{"def", "def"}, - new Object[]{"abc", "abc"} ), 0 ) @@ -3959,7 +3830,7 @@ public void testJoinWithExplicitIsNotDistinctFromCondition(Map q ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.FILTER_PUSHED_DOWN_FROM_JOIN_CAN_BE_MORE, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.FILTER_PUSHED_DOWN_FROM_JOIN_CAN_BE_MORE) @MethodSource("provideQueryContexts") @ParameterizedTest(name = "{0}") public void testInnerJoinSubqueryWithSelectorFilter(Map queryContext) @@ -4016,7 +3887,7 @@ public void testInnerJoinSubqueryWithSelectorFilter(Map queryCon ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND) @Test public void testSemiJoinWithOuterTimeExtractScan() { @@ -4065,7 +3936,7 @@ public void testSemiJoinWithOuterTimeExtractScan() ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND) @MethodSource("provideQueryContexts") @ParameterizedTest(name = "{0}") public void testTwoSemiJoinsSimultaneously(Map queryContext) @@ -4129,7 +4000,7 @@ public void testTwoSemiJoinsSimultaneously(Map queryContext) ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND) @MethodSource("provideQueryContexts") @ParameterizedTest(name = "{0}") public void testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery(Map queryContext) @@ -4184,12 +4055,10 @@ public void testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery(Map queryContext) @@ -4305,7 +4174,7 @@ public void testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins(Map queryContext) .build() ), ImmutableList.of( - new Object[]{NULL_STRING, 1L}, + new Object[]{null, 1L}, new Object[]{"1", 1L} ) ); @@ -4771,7 +4638,7 @@ public void testCountDistinctOfLookupUsingJoinOperator(Map query .build() ), ImmutableList.of( - new Object[]{NullHandling.replaceWithDefault() ? 2L : 1L} + new Object[]{1L} ) ); } @@ -4783,9 +4650,6 @@ public void testJoinWithNonEquiCondition(Map queryContext) // Native JOIN operator cannot handle the condition, so a SQL JOIN with greater-than is translated into a // cross join with a filter. - // We don't handle non-equi join conditions for non-sql compatible mode. - assumeFalse(NullHandling.replaceWithDefault()); - testQuery( "SELECT x.m1, y.m1 FROM foo x INNER JOIN foo y ON x.m1 > y.m1", queryContext, @@ -4846,9 +4710,6 @@ public void testJoinWithEquiAndNonEquiCondition(Map queryContext // Native JOIN operator cannot handle the condition, so a SQL JOIN with greater-than is translated into a // cross join with a filter. - // We don't handle non-equi join conditions for non-sql compatible mode. - assumeFalse(NullHandling.replaceWithDefault()); - testQuery( "SELECT x.m1, y.m1 FROM foo x INNER JOIN foo y ON x.m1 = y.m1 AND x.m1 + y.m1 = 6.0", queryContext, @@ -4885,7 +4746,7 @@ public void testJoinWithEquiAndNonEquiCondition(Map queryContext ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND) @MethodSource("provideQueryContexts") @ParameterizedTest(name = "{0}") public void testUsingSubqueryAsPartOfAndFilter(Map queryContext) @@ -4913,9 +4774,7 @@ public void testUsingSubqueryAsPartOfAndFilter(Map queryContext) .setGranularity(Granularities.ALL) .setDimFilter( not( - NullHandling.replaceWithDefault() - ? isNull("dim1") - : equality("dim1", "", ColumnType.STRING) + equality("dim1", "", ColumnType.STRING) ) ) .setDimensions(dimensions(new DefaultDimensionSpec("dim1", "d0"))) @@ -5043,7 +4902,7 @@ public void testUsingSubqueryAsPartOfOrFilter(Map queryContext) ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.SCAN_QUERY_ON_FILTERED_DS_DOING_FILTERING, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.SCAN_QUERY_ON_FILTERED_DS_DOING_FILTERING) @MethodSource("provideQueryContexts") @ParameterizedTest(name = "{0}") public void testNestedGroupByOnInlineDataSourceWithFilter(Map queryContext) @@ -5465,7 +5324,7 @@ public void testVirtualColumnOnMVFilterMultiJoinExpression(Map q ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND) @MethodSource("provideQueryContexts") @ParameterizedTest(name = "{0}") public void testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults(Map queryContext) @@ -5575,7 +5434,7 @@ public void testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults(Map queryContext) @@ -5751,12 +5610,6 @@ public void testPlanWithInFilterMoreThanInSubQueryThreshold() @ParameterizedTest(name = "{0}") public void testRegressionFilteredAggregatorsSubqueryJoins(Map queryContext) { - assumeFalse( - isRunningMSQ() && isSortBasedJoin() && NullHandling.replaceWithDefault(), - "test disabled; returns incorrect results in this mode" - ); - assumeFalse(testBuilder().isDecoupledMode() && NullHandling.replaceWithDefault(), "not support in decoupled mode"); - cannotVectorize(); testQuery( "select\n" + @@ -5765,85 +5618,6 @@ public void testRegressionFilteredAggregatorsSubqueryJoins(Map q "from foo as t0\n" + "where __time in (select __time from foo)", queryContext, - useDefault ? - ImmutableList.of( - Druids.newTimeseriesQueryBuilder() - .dataSource( - join( - join( - join( - new TableDataSource(CalciteTests.DATASOURCE1), - new QueryDataSource( - GroupByQuery.builder() - .setDataSource(CalciteTests.DATASOURCE1) - .setInterval(querySegmentSpec(Filtration.eternity())) - .setDimensions( - new DefaultDimensionSpec("__time", "d0", ColumnType.LONG) - ) - .setGranularity(Granularities.ALL) - .setLimitSpec(NoopLimitSpec.instance()) - .build() - ), - "j0.", - equalsCondition(makeColumnExpression("__time"), makeColumnExpression("j0.d0")), - JoinType.INNER - ), - new QueryDataSource( - GroupByQuery.builder() - .setDataSource(CalciteTests.DATASOURCE1) - .setInterval(querySegmentSpec(Filtration.eternity())) - .setDimensions( - new DefaultDimensionSpec("dim2", "d0", ColumnType.STRING) - ) - .setGranularity(Granularities.ALL) - .setPostAggregatorSpecs( - expressionPostAgg("a0", "1", ColumnType.LONG) - ) - .setLimitSpec(NoopLimitSpec.instance()) - .build() - ), - "_j0.", - "(trim(\"dim1\",' ') == \"_j0.d0\")", - JoinType.LEFT - ), - new QueryDataSource( - GroupByQuery.builder() - .setDataSource(CalciteTests.DATASOURCE1) - .setInterval(querySegmentSpec(Filtration.eternity())) - .setVirtualColumns(expressionVirtualColumn("v0", "1", ColumnType.LONG)) - .setDimFilter(equality("m2", "0.0", ColumnType.STRING)) - .setDimensions( - new DefaultDimensionSpec("v0", "d0", ColumnType.LONG) - ) - .setVirtualColumns(expressionVirtualColumn("v0", "1", ColumnType.LONG)) - .setGranularity(Granularities.ALL) - .setLimitSpec(NoopLimitSpec.instance()) - .build() - ), - "__j0.", - "1", - JoinType.LEFT - ) - ) - .intervals(querySegmentSpec(Filtration.eternity())) - .aggregators( - new FilteredAggregatorFactory( - new CountAggregatorFactory("a0"), - and( - notNull("_j0.a0"), - notNull("dim1") - ), - "a0" - ), - new FilteredAggregatorFactory( - new FloatMinAggregatorFactory("a1", "m1"), - isNull("__j0.d0"), - "a1" - ) - ) - .context(queryContext) - .build() - ) : ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource( @@ -5922,17 +5696,12 @@ public void testRegressionFilteredAggregatorsSubqueryJoins(Map q or( isNull("__j0.a0"), not( - NullHandling.sqlCompatible() - ? istrue( + istrue( or( not(expressionFilter("\"__j0.d0\"")), notNull("__j0.d0") ) ) - : or( - not(expressionFilter("\"__j0.d0\"")), - notNull("__j0.d0") - ) ) ), "a1" @@ -5942,7 +5711,7 @@ public void testRegressionFilteredAggregatorsSubqueryJoins(Map q .build() ), ImmutableList.of( - new Object[]{useDefault ? 1L : 2L, 1.0f} + new Object[]{2L, 1.0f} ) ); } @@ -5988,8 +5757,7 @@ public void testJoinWithAliasAndOrderByNoGroupBy() .context(context) .build() ), - NullHandling.sqlCompatible() - ? ImmutableList.of( + ImmutableList.of( new Object[]{946684800000L}, new Object[]{946684800000L}, new Object[]{946857600000L}, @@ -5997,13 +5765,6 @@ public void testJoinWithAliasAndOrderByNoGroupBy() new Object[]{978307200000L}, new Object[]{978393600000L} ) - : ImmutableList.of( - new Object[]{946684800000L}, - new Object[]{946684800000L}, - new Object[]{978307200000L}, - new Object[]{978307200000L}, - new Object[]{978393600000L} - ) ); } @@ -6051,9 +5812,7 @@ public void testJoinsWithTwoConditions() .setGranularity(Granularities.ALL) .setDataSource(new TableDataSource(CalciteTests.DATASOURCE1)) .setDimFilter( - NullHandling.replaceWithDefault() - ? in("m1", ImmutableList.of("1", "2")) - : in("m1", ColumnType.FLOAT, ImmutableList.of(1.0f, 2.0f)) + in("m1", ColumnType.FLOAT, ImmutableList.of(1.0f, 2.0f)) ) .setDimensions(new DefaultDimensionSpec("m1", "d0", ColumnType.FLOAT)) .setAggregatorSpecs(aggregators(new LongMaxAggregatorFactory("a0", "__time"))) @@ -6099,12 +5858,7 @@ public void testJoinsWithThreeConditions() .setGranularity(Granularities.ALL) .setDataSource(new TableDataSource(CalciteTests.DATASOURCE1)) .setDimFilter( - NullHandling.replaceWithDefault() - ? and( - in("m1", ImmutableList.of("1", "2")), - in("m2", ImmutableList.of("1", "2")) - ) - : and( + and( in("m1", ColumnType.FLOAT, ImmutableList.of(1.0f, 2.0f)), in("m2", ColumnType.DOUBLE, ImmutableList.of(1.0, 2.0)) ) @@ -6136,112 +5890,72 @@ public void testJoinsWithThreeConditions() } @Test - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.JOIN_FILTER_LOCATIONS, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.JOIN_FILTER_LOCATIONS) public void testJoinWithInputRefCondition() { cannotVectorize(); Map context = new HashMap<>(QUERY_CONTEXT_DEFAULT); - Query expectedQuery; - - if (!NullHandling.sqlCompatible()) { - expectedQuery = Druids.newTimeseriesQueryBuilder() - .dataSource( - join( - new TableDataSource(CalciteTests.DATASOURCE1), - new QueryDataSource( - GroupByQuery.builder() - .setInterval(querySegmentSpec(Filtration.eternity())) - .setGranularity(Granularities.ALL) - .setDataSource(new TableDataSource(CalciteTests.DATASOURCE1)) - .setDimensions( - new DefaultDimensionSpec("m1", "d0", ColumnType.FLOAT) - ) - .setPostAggregatorSpecs( - expressionPostAgg("a0", "1", ColumnType.LONG) - ) - .build() - ), - "j0.", - "(CAST(floor(100), 'DOUBLE') == \"j0.d0\")", - JoinType.LEFT - ) - ) - .granularity(Granularities.ALL) - .aggregators(aggregators( - new FilteredAggregatorFactory( - new CountAggregatorFactory("a0"), - isNull("j0.a0") - ) - )) - .context(getTimeseriesContextWithFloorTime(TIMESERIES_CONTEXT_BY_GRAN, "d0")) - .intervals(querySegmentSpec(Filtration.eternity())) - .context(context) - .build(); - - } else { - expectedQuery = Druids.newTimeseriesQueryBuilder() - .dataSource( - join( - join( - new TableDataSource("foo"), - new QueryDataSource( - Druids.newTimeseriesQueryBuilder() - .dataSource("foo") - .aggregators( - new CountAggregatorFactory("a0"), - new FilteredAggregatorFactory( - new CountAggregatorFactory("a1"), - notNull("m1"), - "a1" - ) - ) - .intervals(querySegmentSpec(Filtration.eternity())) - .context(context) - .build() - ), - "j0.", - "1", - JoinType.INNER - ), - new QueryDataSource( - GroupByQuery.builder() - .setInterval(querySegmentSpec(Filtration.eternity())) - .setGranularity(Granularities.ALL) - .setDataSource(new TableDataSource(CalciteTests.DATASOURCE1)) - .setDimensions( - new DefaultDimensionSpec("m1", "d0", ColumnType.FLOAT) - ) - .setPostAggregatorSpecs( - expressionPostAgg("a0", "1", ColumnType.LONG) - ) - .build() - ), - "_j0.", - "(CAST(floor(100), 'DOUBLE') == \"_j0.d0\")", - JoinType.LEFT - ) - ) - .granularity(Granularities.ALL) - .aggregators(aggregators( - new FilteredAggregatorFactory( - new CountAggregatorFactory("a0"), - or( - equality("j0.a0", 0L, ColumnType.LONG), - and( - isNull("_j0.a0"), - expressionFilter("(\"j0.a1\" >= \"j0.a0\")") - ) - - ) - ) - )) - .context(getTimeseriesContextWithFloorTime(TIMESERIES_CONTEXT_BY_GRAN, "d0")) - .intervals(querySegmentSpec(Filtration.eternity())) - .context(context) - .build(); - - } + Query expectedQuery = Druids.newTimeseriesQueryBuilder() + .dataSource( + join( + join( + new TableDataSource("foo"), + new QueryDataSource( + Druids.newTimeseriesQueryBuilder() + .dataSource("foo") + .aggregators( + new CountAggregatorFactory("a0"), + new FilteredAggregatorFactory( + new CountAggregatorFactory("a1"), + notNull("m1"), + "a1" + ) + ) + .intervals(querySegmentSpec(Filtration.eternity())) + .context(context) + .build() + ), + "j0.", + "1", + JoinType.INNER + ), + new QueryDataSource( + GroupByQuery.builder() + .setInterval(querySegmentSpec(Filtration.eternity())) + .setGranularity(Granularities.ALL) + .setDataSource(new TableDataSource(CalciteTests.DATASOURCE1)) + .setDimensions( + new DefaultDimensionSpec("m1", "d0", ColumnType.FLOAT) + ) + .setPostAggregatorSpecs( + expressionPostAgg("a0", "1", ColumnType.LONG) + ) + .build() + ), + "_j0.", + "(CAST(floor(100), 'DOUBLE') == \"_j0.d0\")", + JoinType.LEFT + ) + ) + .granularity(Granularities.ALL) + .aggregators(aggregators( + new FilteredAggregatorFactory( + new CountAggregatorFactory("a0"), + or( + equality("j0.a0", 0L, ColumnType.LONG), + and( + isNull("_j0.a0"), + expressionFilter("(\"j0.a1\" >= \"j0.a0\")") + ) + + ) + ) + )) + .context(getTimeseriesContextWithFloorTime(TIMESERIES_CONTEXT_BY_GRAN, "d0")) + .intervals(querySegmentSpec(Filtration.eternity())) + .context(context) + .build(); testQuery( "SELECT COUNT(*) FILTER (WHERE FLOOR(100) NOT IN (SELECT m1 FROM foo)) " @@ -6298,11 +6012,7 @@ public void testJoinsWithUnnestOnLeft() .context(context) .build() ), - useDefault ? ImmutableList.of( - new Object[]{"[\"a\",\"b\"]", "a", "a"}, - new Object[]{"[\"a\",\"b\"]", "a", "a"} - ) : ImmutableList.of( new Object[]{"[\"a\",\"b\"]", "a", "a"}, new Object[]{"[\"a\",\"b\"]", "a", "a"}, new Object[]{"", "", ""} @@ -6358,11 +6068,7 @@ public void testJoinsWithUnnestOverFilteredDSOnLeft() .context(context) .build() ), - useDefault ? ImmutableList.of( - new Object[]{"[\"a\",\"b\"]", "a", "a"}, - new Object[]{"[\"a\",\"b\"]", "a", "a"} - ) : ImmutableList.of( new Object[]{"[\"a\",\"b\"]", "a", "a"}, new Object[]{"[\"a\",\"b\"]", "a", "a"}, new Object[]{"", "", ""} @@ -6430,17 +6136,7 @@ public void testJoinsWithUnnestOverJoin() .context(context) .build() ), - useDefault ? ImmutableList.of( - new Object[]{"[\"a\",\"b\"]", "a", "a"}, - new Object[]{"[\"a\",\"b\"]", "a", "a"}, - new Object[]{"[\"a\",\"b\"]", "a", "a"}, - new Object[]{"[\"a\",\"b\"]", "a", "a"}, - new Object[]{"[\"a\",\"b\"]", "a", "a"}, - new Object[]{"[\"a\",\"b\"]", "a", "a"}, - new Object[]{"[\"a\",\"b\"]", "a", "a"}, - new Object[]{"[\"a\",\"b\"]", "a", "a"} - ) : ImmutableList.of( new Object[]{"[\"a\",\"b\"]", "a", "a"}, new Object[]{"[\"a\",\"b\"]", "a", "a"}, new Object[]{"[\"a\",\"b\"]", "a", "a"}, @@ -6505,16 +6201,7 @@ public void testSelfJoinsWithUnnestOnLeftAndRight() .context(context) .build() ), - useDefault ? ImmutableList.of( - new Object[]{"[\"a\",\"b\"]", "a", "a"}, - new Object[]{"[\"a\",\"b\"]", "b", "a"}, - new Object[]{"[\"a\",\"b\"]", "b", ""}, - new Object[]{"[\"b\",\"c\"]", "b", "a"}, - new Object[]{"[\"b\",\"c\"]", "b", ""}, - new Object[]{"[\"b\",\"c\"]", "c", ""}, - new Object[]{"d", "d", ""} - ) : ImmutableList.of( new Object[]{"[\"a\",\"b\"]", "a", "a"}, new Object[]{"[\"a\",\"b\"]", "b", "a"}, new Object[]{"[\"a\",\"b\"]", "b", null}, @@ -6571,9 +6258,7 @@ public void testJoinsOverUnnestOverFilterDSOverJoin() "(\"dim2\" == \"j0.dim2\")", JoinType.INNER ), - NullHandling.sqlCompatible() - ? in("m1", ColumnType.FLOAT, ImmutableList.of(1.0, 4.0)) - : in("m1", ImmutableList.of("1", "4")) + in("m1", ColumnType.FLOAT, ImmutableList.of(1.0, 4.0)) ), expressionVirtualColumn("_j0.unnest", "\"dim3\"", ColumnType.STRING), equality("_j0.unnest", "a", ColumnType.STRING) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteLookupFunctionQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteLookupFunctionQueryTest.java index b2146225e7e6..69413d622ad1 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteLookupFunctionQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteLookupFunctionQueryTest.java @@ -22,7 +22,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.granularity.Granularities; @@ -432,13 +431,9 @@ public void testFilterInOverMaxSize() testQuery( buildFilterTestSql("LOOKUP(dim1, 'lookyloo') IN ('xabc', 'x6', 'nonexistent')"), queryContext, - NullHandling.sqlCompatible() - ? buildFilterTestExpectedQuery( + buildFilterTestExpectedQuery( expressionVirtualColumn("v0", "lookup(\"dim1\",'lookyloo')", ColumnType.STRING), in("v0", ImmutableList.of("nonexistent", "x6", "xabc")) - ) - : buildFilterTestExpectedQuery( - in("dim1", ImmutableList.of("nonexistent", "x6", "xabc"), EXTRACTION_FN) ), ImmutableList.of(new Object[]{"xabc", 1L}) ); @@ -460,13 +455,9 @@ public void testFilterInOverMaxSize2() testQuery( buildFilterTestSql("LOOKUP(dim1, 'lookyloo') = 'xabc' OR LOOKUP(dim1, 'lookyloo') = 'x6'"), queryContext, - NullHandling.sqlCompatible() - ? buildFilterTestExpectedQuery( + buildFilterTestExpectedQuery( expressionVirtualColumn("v0", "lookup(\"dim1\",'lookyloo')", ColumnType.STRING), in("v0", ImmutableList.of("x6", "xabc")) - ) - : buildFilterTestExpectedQuery( - in("dim1", ImmutableList.of("x6", "xabc"), EXTRACTION_FN) ), ImmutableList.of(new Object[]{"xabc", 1L}) ); @@ -481,21 +472,14 @@ public void testFilterInOrIsNull() buildFilterTestSql( "LOOKUP(dim1, 'lookyloo') IN ('xabc', 'x6', 'nonexistent') OR LOOKUP(dim1, 'lookyloo') IS NULL"), QUERY_CONTEXT, - NullHandling.sqlCompatible() - ? buildFilterTestExpectedQuery( + buildFilterTestExpectedQuery( expressionVirtualColumn("v0", "lookup(\"dim1\",'lookyloo')", ColumnType.STRING), or( in("dim1", Arrays.asList("6", "abc")), isNull("v0") ) - ) - : buildFilterTestExpectedQuery( - or( - in("dim1", Arrays.asList("6", "abc")), - selector("dim1", null, EXTRACTION_FN) - ) ), - ImmutableList.of(new Object[]{NullHandling.defaultStringValue(), 5L}, new Object[]{"xabc", 1L}) + ImmutableList.of(new Object[]{null, 5L}, new Object[]{"xabc", 1L}) ); } @@ -511,19 +495,12 @@ public void testFilterInAndIsNotNull() buildFilterTestSql( "LOOKUP(dim1, 'lookyloo') IN ('xabc', 'x6', 'nonexistent') AND LOOKUP(dim1, 'lookyloo') IS NOT NULL"), QUERY_CONTEXT, - NullHandling.sqlCompatible() - ? buildFilterTestExpectedQuery( + buildFilterTestExpectedQuery( expressionVirtualColumn("v0", "lookup(\"dim1\",'lookyloo')", ColumnType.STRING), and( in("dim1", ImmutableList.of("6", "abc")), not(isNull("v0")) ) - ) - : buildFilterTestExpectedQuery( - and( - in("dim1", Arrays.asList("6", "abc")), - not(selector("dim1", null, EXTRACTION_FN)) - ) ), ImmutableList.of(new Object[]{"xabc", 1L}) ); @@ -532,21 +509,14 @@ public void testFilterInAndIsNotNull() @Test public void testFilterInOrIsNullInjective() { - if (NullHandling.sqlCompatible()) { - cannotVectorize(); - } + cannotVectorize(); testQuery( buildFilterTestSql( "LOOKUP(dim1, 'lookyloo121') IN ('xabc', 'x6', 'nonexistent') OR LOOKUP(dim1, 'lookyloo121') IS NULL"), QUERY_CONTEXT, - NullHandling.sqlCompatible() - ? buildFilterTestExpectedQuery( + buildFilterTestExpectedQuery( or(isNull("dim1"), equality("dim1", "abc", ColumnType.STRING)) - ) - : buildFilterTestExpectedQueryConstantDimension( - "'xabc'", - equality("dim1", "abc", ColumnType.STRING) ), ImmutableList.of(new Object[]{"xabc", 1L}) ); @@ -561,20 +531,13 @@ public void testFilterNotInAndIsNotNull() buildFilterTestSql( "LOOKUP(dim1, 'lookyloo') NOT IN ('x6', 'nonexistent') AND LOOKUP(dim1, 'lookyloo') IS NOT NULL"), QUERY_CONTEXT, - NullHandling.sqlCompatible() - ? buildFilterTestExpectedQuery( + buildFilterTestExpectedQuery( expressionVirtualColumn("v0", "lookup(\"dim1\",'lookyloo')", ColumnType.STRING), and( not(equality("v0", "x6", ColumnType.STRING)), not(equality("v0", "nonexistent", ColumnType.STRING)), notNull("v0") ) - ) - : buildFilterTestExpectedQuery( - and( - not(selector("dim1", "6", null)), - not(selector("dim1", null, EXTRACTION_FN)) - ) ), ImmutableList.of(new Object[]{"xabc", 1L}) ); @@ -590,19 +553,12 @@ public void testFilterInIsNotTrueAndIsNotNull() "(LOOKUP(dim1, 'lookyloo') IN ('xabc', 'x6', 'nonexistent')) IS NOT TRUE " + "AND LOOKUP(dim1, 'lookyloo') IS NOT NULL"), QUERY_CONTEXT, - NullHandling.sqlCompatible() - ? buildFilterTestExpectedQuery( + buildFilterTestExpectedQuery( expressionVirtualColumn("v0", "lookup(\"dim1\",'lookyloo')", ColumnType.STRING), and( not(istrue(in("dim1", ImmutableList.of("6", "abc")))), notNull("v0") ) - ) - : buildFilterTestExpectedQuery( - and( - not(in("dim1", ImmutableList.of("6", "abc"))), - not(selector("dim1", null, EXTRACTION_FN)) - ) ), ImmutableList.of() ); @@ -619,13 +575,12 @@ public void testFilterNotInAndIsNotNullInjective() + "AND LOOKUP(dim1, 'lookyloo121') IS NOT NULL"), QUERY_CONTEXT, buildFilterTestExpectedQuery( - NullHandling.sqlCompatible() - ? and( + and( not(isNull("dim1")), not(in("dim1", ImmutableList.of("abc", "def"))) ) - : not(in("dim1", ImmutableList.of("abc", "def")))), - ImmutableList.of(new Object[]{NULL_STRING, 4L}) + ), + ImmutableList.of(new Object[]{null, 4L}) ); } @@ -638,8 +593,7 @@ public void testFilterNotInOrIsNull() buildFilterTestSql( "LOOKUP(dim1, 'lookyloo') NOT IN ('x6', 'nonexistent') OR LOOKUP(dim1, 'lookyloo') IS NULL"), QUERY_CONTEXT, - NullHandling.sqlCompatible() - ? buildFilterTestExpectedQuery( + buildFilterTestExpectedQuery( expressionVirtualColumn("v0", "lookup(\"dim1\",'lookyloo')", ColumnType.STRING), or( and( @@ -648,15 +602,9 @@ public void testFilterNotInOrIsNull() ), isNull("v0") ) - ) - : buildFilterTestExpectedQuery( - or( - not(selector("dim1", "6", null)), - selector("dim1", null, EXTRACTION_FN) - ) ), ImmutableList.of( - new Object[]{NULL_STRING, 5L}, + new Object[]{null, 5L}, new Object[]{"xabc", 1L} ) ); @@ -671,22 +619,15 @@ public void testFilterInIsNotTrueOrIsNull() buildFilterTestSql( "(LOOKUP(dim1, 'lookyloo') IN ('x6', 'nonexistent')) IS NOT TRUE OR LOOKUP(dim1, 'lookyloo') IS NULL"), QUERY_CONTEXT, - NullHandling.sqlCompatible() - ? buildFilterTestExpectedQuery( + buildFilterTestExpectedQuery( expressionVirtualColumn("v0", "lookup(\"dim1\",'lookyloo')", ColumnType.STRING), or( not(istrue(equality("dim1", "6", ColumnType.STRING))), isNull("v0") ) - ) - : buildFilterTestExpectedQuery( - or( - not(selector("dim1", "6", null)), - selector("dim1", null, EXTRACTION_FN) - ) ), ImmutableList.of( - new Object[]{NULL_STRING, 5L}, + new Object[]{null, 5L}, new Object[]{"xabc", 1L} ) ); @@ -700,19 +641,11 @@ public void testFilterNotIn() testQuery( buildFilterTestSql("LOOKUP(dim1, 'lookyloo') NOT IN ('x6', 'nonexistent')"), QUERY_CONTEXT, - NullHandling.sqlCompatible() - ? buildFilterTestExpectedQuery( + buildFilterTestExpectedQuery( expressionVirtualColumn("v0", "lookup(\"dim1\",'lookyloo')", ColumnType.STRING), and(not(equality("v0", "x6", ColumnType.STRING)), not(equality("v0", "nonexistent", ColumnType.STRING))) - ) - : buildFilterTestExpectedQuery(not(equality("dim1", "6", ColumnType.STRING))), - // sql compatible mode expression filter (correctly) leaves out null values - NullHandling.sqlCompatible() - ? ImmutableList.of(new Object[]{"xabc", 1L}) - : ImmutableList.of( - new Object[]{NULL_STRING, 5L}, - new Object[]{"xabc", 1L} - ) + ), + ImmutableList.of(new Object[]{"xabc", 1L}) ); } @@ -725,12 +658,10 @@ public void testFilterInIsNotTrue() buildFilterTestSql("LOOKUP(dim1, 'lookyloo') IN ('x6', 'nonexistent') IS NOT TRUE"), QUERY_CONTEXT, buildFilterTestExpectedQuery( - NullHandling.sqlCompatible() - ? not(istrue(equality("dim1", "6", ColumnType.STRING))) - : not(equality("dim1", "6", ColumnType.STRING)) + not(istrue(equality("dim1", "6", ColumnType.STRING))) ), ImmutableList.of( - new Object[]{NULL_STRING, 5L}, + new Object[]{null, 5L}, new Object[]{"xabc", 1L} ) ); @@ -745,7 +676,7 @@ public void testFilterNotInInjective() buildFilterTestSql("LOOKUP(dim1, 'lookyloo121') NOT IN ('xabc', 'xdef', 'nonexistent')"), QUERY_CONTEXT, buildFilterTestExpectedQuery(not(in("dim1", ImmutableList.of("abc", "def")))), - ImmutableList.of(new Object[]{NULL_STRING, 4L}) + ImmutableList.of(new Object[]{null, 4L}) ); } @@ -758,7 +689,7 @@ public void testFilterNotInWithReplaceMissingValue() buildFilterTestSql("LOOKUP(dim1, 'lookyloo', 'xyzzy') NOT IN ('xabc', 'x6', 'nonexistent')"), QUERY_CONTEXT, buildFilterTestExpectedQuery(not(in("dim1", ImmutableList.of("6", "abc")))), - ImmutableList.of(new Object[]{NULL_STRING, 5L}) + ImmutableList.of(new Object[]{null, 5L}) ); } @@ -770,11 +701,8 @@ public void testFilterInIsNotTrueWithReplaceMissingValue() testQuery( buildFilterTestSql("LOOKUP(dim1, 'lookyloo', 'xyzzy') IN ('xabc', 'x6', 'nonexistent') IS NOT TRUE"), QUERY_CONTEXT, - buildFilterTestExpectedQuery( - NullHandling.sqlCompatible() - ? not(istrue(in("dim1", ImmutableList.of("6", "abc")))) - : not(in("dim1", ImmutableList.of("6", "abc")))), - ImmutableList.of(new Object[]{NULL_STRING, 5L}) + buildFilterTestExpectedQuery(not(istrue(in("dim1", ImmutableList.of("6", "abc"))))), + ImmutableList.of(new Object[]{null, 5L}) ); } @@ -807,17 +735,12 @@ public void testFilterMvContainsNull() @Test public void testFilterMvContainsNullInjective() { - if (NullHandling.sqlCompatible()) { - // cannotVectorize doesn't trip in default-value mode, due to buildFilterTestExpectedQueryAlwaysFalse. - cannotVectorize(); - } + cannotVectorize(); testQuery( buildFilterTestSql("MV_CONTAINS(LOOKUP(dim1, 'lookyloo121'), NULL)"), QUERY_CONTEXT, - NullHandling.sqlCompatible() - ? buildFilterTestExpectedQuery(expressionFilter("array_contains(mv_harmonize_nulls(\"dim1\"),null)")) - : buildFilterTestExpectedQueryAlwaysFalse(), + buildFilterTestExpectedQuery(expressionFilter("array_contains(mv_harmonize_nulls(\"dim1\"),null)")), ImmutableList.of() ); } @@ -847,7 +770,7 @@ public void testFilterMvOverlapNull() in("dim1", Arrays.asList(null, "nonexistent", "x6", "xabc"), EXTRACTION_FN) ), ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 5L}, + new Object[]{null, 5L}, new Object[]{"xabc", 1L} ) ); @@ -862,9 +785,7 @@ public void testFilterMvOverlapNullInjective() buildFilterTestSql("MV_OVERLAP(lookup(dim1, 'lookyloo121'), ARRAY['xabc', 'x6', 'nonexistent', NULL])"), QUERY_CONTEXT, buildFilterTestExpectedQuery( - NullHandling.sqlCompatible() - ? in("dim1", Arrays.asList(null, "abc")) - : equality("dim1", "abc", ColumnType.STRING) + in("dim1", Arrays.asList(null, "abc")) ), ImmutableList.of(new Object[]{"xabc", 1L}) ); @@ -878,17 +799,11 @@ public void testFilterNotMvContains() testQuery( buildFilterTestSql("NOT MV_CONTAINS(lookup(dim1, 'lookyloo'), 'xabc')"), QUERY_CONTEXT, - NullHandling.sqlCompatible() - ? buildFilterTestExpectedQuery( + buildFilterTestExpectedQuery( expressionVirtualColumn("v0", "lookup(\"dim1\",'lookyloo')", ColumnType.STRING), not(equality("v0", "xabc", ColumnType.STRING)) - ) - : buildFilterTestExpectedQuery( - not(equality("dim1", "abc", ColumnType.STRING)) ), - NullHandling.sqlCompatible() - ? ImmutableList.of() - : ImmutableList.of(new Object[]{"", 5L}) + ImmutableList.of() ); } @@ -901,11 +816,9 @@ public void testFilterMvContainsIsNotTrue() buildFilterTestSql("MV_CONTAINS(lookup(dim1, 'lookyloo'), 'xabc') IS NOT TRUE"), QUERY_CONTEXT, buildFilterTestExpectedQuery( - NullHandling.sqlCompatible() - ? not(istrue(equality("dim1", "abc", ColumnType.STRING))) - : not(equality("dim1", "abc", ColumnType.STRING)) + not(istrue(equality("dim1", "abc", ColumnType.STRING))) ), - ImmutableList.of(new Object[]{NullHandling.defaultStringValue(), 5L}) + ImmutableList.of(new Object[]{null, 5L}) ); } @@ -918,7 +831,7 @@ public void testFilterNotMvContainsInjective() buildFilterTestSql("NOT MV_CONTAINS(LOOKUP(dim1, 'lookyloo121'), 'xabc')"), QUERY_CONTEXT, buildFilterTestExpectedQuery(not(equality("dim1", "abc", ColumnType.STRING))), - ImmutableList.of(new Object[]{NULL_STRING, 5L}) + ImmutableList.of(new Object[]{null, 5L}) ); } @@ -931,13 +844,9 @@ public void testFilterNotMvOverlap() buildFilterTestSql("NOT MV_OVERLAP(lookup(dim1, 'lookyloo'), ARRAY['xabc', 'x6', 'nonexistent'])"), QUERY_CONTEXT, buildFilterTestExpectedQuery( - NullHandling.sqlCompatible() - ? not(in("dim1", ImmutableList.of("nonexistent", "x6", "xabc"), EXTRACTION_FN)) - : not(in("dim1", ImmutableList.of("6", "abc"))) + not(in("dim1", ImmutableList.of("nonexistent", "x6", "xabc"), EXTRACTION_FN)) ), - NullHandling.sqlCompatible() - ? Collections.emptyList() - : ImmutableList.of(new Object[]{NullHandling.defaultStringValue(), 5L}) + Collections.emptyList() ); } @@ -950,11 +859,9 @@ public void testFilterMvOverlapIsNotTrue() buildFilterTestSql("MV_OVERLAP(lookup(dim1, 'lookyloo'), ARRAY['xabc', 'x6', 'nonexistent']) IS NOT TRUE"), QUERY_CONTEXT, buildFilterTestExpectedQuery( - NullHandling.sqlCompatible() - ? not(istrue(in("dim1", ImmutableList.of("6", "abc")))) - : not(in("dim1", ImmutableList.of("6", "abc"))) + not(istrue(in("dim1", ImmutableList.of("6", "abc")))) ), - ImmutableList.of(new Object[]{NullHandling.defaultStringValue(), 5L}) + ImmutableList.of(new Object[]{null, 5L}) ); } @@ -967,7 +874,7 @@ public void testFilterNotMvOverlapInjective() buildFilterTestSql("NOT MV_OVERLAP(lookup(dim1, 'lookyloo121'), ARRAY['xabc', 'x6', 'nonexistent'])"), QUERY_CONTEXT, buildFilterTestExpectedQuery(not(equality("dim1", "abc", ColumnType.STRING))), - ImmutableList.of(new Object[]{NULL_STRING, 5L}) + ImmutableList.of(new Object[]{null, 5L}) ); } @@ -993,18 +900,13 @@ public void testFilterMultipleIsDistinctFrom() + "LOOKUP(dim1, 'lookyloo') IS DISTINCT FROM 'nonexistent'"), queryContext, buildFilterTestExpectedQuery( - NullHandling.sqlCompatible() - ? and( + and( not(istrue(equality("dim1", "abc", ColumnType.STRING))), not(istrue(equality("dim1", "6", ColumnType.STRING))) ) - : and( - not(equality("dim1", "abc", ColumnType.STRING)), - not(equality("dim1", "6", ColumnType.STRING)) - ) ), ImmutableList.of( - new Object[]{NULL_STRING, 5L} + new Object[]{null, 5L} ) ); } @@ -1017,30 +919,23 @@ public void testFilterIsNull() testQuery( buildFilterTestSql("LOOKUP(dim1, 'lookyloo') IS NULL"), QUERY_CONTEXT, - NullHandling.sqlCompatible() - ? buildFilterTestExpectedQuery( + buildFilterTestExpectedQuery( expressionVirtualColumn("v0", "lookup(\"dim1\",'lookyloo')", ColumnType.STRING), isNull("v0") - ) - : buildFilterTestExpectedQuery(selector("dim1", null, EXTRACTION_FN)), - ImmutableList.of(new Object[]{NULL_STRING, 5L}) + ), + ImmutableList.of(new Object[]{null, 5L}) ); } @Test public void testFilterIsNullInjective() { - if (NullHandling.sqlCompatible()) { - // cannotVectorize doesn't trip in default-value mode, due to buildFilterTestExpectedQueryAlwaysFalse. - cannotVectorize(); - } + cannotVectorize(); testQuery( buildFilterTestSql("LOOKUP(dim1, 'lookyloo121') IS NULL"), QUERY_CONTEXT, - NullHandling.sqlCompatible() - ? buildFilterTestExpectedQueryConstantDimension("null", isNull("dim1")) - : buildFilterTestExpectedQueryAlwaysFalse(), + buildFilterTestExpectedQueryConstantDimension("null", isNull("dim1")), ImmutableList.of() ); } @@ -1053,13 +948,9 @@ public void testFilterIsNotNull() testQuery( buildFilterTestSql("LOOKUP(dim1, 'lookyloo') IS NOT NULL"), QUERY_CONTEXT, - NullHandling.sqlCompatible() - ? buildFilterTestExpectedQuery( + buildFilterTestExpectedQuery( expressionVirtualColumn("v0", "lookup(\"dim1\",'lookyloo')", ColumnType.STRING), not(isNull("v0")) - ) - : buildFilterTestExpectedQuery( - not(selector("dim1", null, EXTRACTION_FN)) ), ImmutableList.of(new Object[]{"xabc", 1L}) ); @@ -1074,12 +965,10 @@ public void testFilterIsNotNullInjective() buildFilterTestSql("LOOKUP(dim1, 'lookyloo121') IS NOT NULL"), QUERY_CONTEXT, buildFilterTestExpectedQuery( - NullHandling.sqlCompatible() - ? not(isNull("dim1")) - : null + not(isNull("dim1")) ), ImmutableList.of( - new Object[]{NULL_STRING, 5L}, + new Object[]{null, 5L}, new Object[]{"xabc", 1L} ) ); @@ -1093,21 +982,11 @@ public void testFilterNotEquals() testQuery( buildFilterTestSql("LOOKUP(dim1, 'lookyloo') <> 'x6'"), QUERY_CONTEXT, - NullHandling.sqlCompatible() - ? buildFilterTestExpectedQuery( + buildFilterTestExpectedQuery( expressionVirtualColumn("v0", "lookup(\"dim1\",'lookyloo')", ColumnType.STRING), not(equality("v0", "x6", ColumnType.STRING)) - ) - : buildFilterTestExpectedQuery( - not(selector("dim1", "6", null)) ), - // sql compatible mode expression filter (correctly) leaves out null values - NullHandling.sqlCompatible() - ? ImmutableList.of(new Object[]{"xabc", 1L}) - : ImmutableList.of( - new Object[]{NULL_STRING, 5L}, - new Object[]{"xabc", 1L} - ) + ImmutableList.of(new Object[]{"xabc", 1L}) ); } @@ -1120,7 +999,7 @@ public void testFilterNotEqualsInjective() buildFilterTestSql("LOOKUP(dim1, 'lookyloo121') <> 'xabc'"), QUERY_CONTEXT, buildFilterTestExpectedQuery(not(equality("dim1", "abc", ColumnType.STRING))), - ImmutableList.of(new Object[]{NULL_STRING, 5L}) + ImmutableList.of(new Object[]{null, 5L}) ); } @@ -1133,12 +1012,10 @@ public void testFilterEqualsIsNotTrue() buildFilterTestSql("LOOKUP(dim1, 'lookyloo') = 'x6' IS NOT TRUE"), QUERY_CONTEXT, buildFilterTestExpectedQuery( - NullHandling.sqlCompatible() - ? not(istrue(equality("dim1", "6", ColumnType.STRING))) - : not(selector("dim1", "6", null)) + not(istrue(equality("dim1", "6", ColumnType.STRING))) ), ImmutableList.of( - new Object[]{NULL_STRING, 5L}, + new Object[]{null, 5L}, new Object[]{"xabc", 1L} ) ); @@ -1153,10 +1030,9 @@ public void testFilterEqualsIsNotTrueInjective() buildFilterTestSql("LOOKUP(dim1, 'lookyloo121') = 'xabc' IS NOT TRUE"), QUERY_CONTEXT, buildFilterTestExpectedQuery( - NullHandling.sqlCompatible() - ? not(istrue(equality("dim1", "abc", ColumnType.STRING))) - : not(equality("dim1", "abc", ColumnType.STRING))), - ImmutableList.of(new Object[]{NULL_STRING, 5L}) + not(istrue(equality("dim1", "abc", ColumnType.STRING))) + ), + ImmutableList.of(new Object[]{null, 5L}) ); } @@ -1169,12 +1045,10 @@ public void testFilterIsDistinctFrom() buildFilterTestSql("LOOKUP(dim1, 'lookyloo') IS DISTINCT FROM 'x6'"), QUERY_CONTEXT, buildFilterTestExpectedQuery( - NullHandling.sqlCompatible() - ? not(istrue(equality("dim1", "6", ColumnType.STRING))) - : not(equality("dim1", "6", ColumnType.STRING)) + not(istrue(equality("dim1", "6", ColumnType.STRING))) ), ImmutableList.of( - new Object[]{NULL_STRING, 5L}, + new Object[]{null, 5L}, new Object[]{"xabc", 1L} ) ); @@ -1191,13 +1065,9 @@ public void testFilterIsDistinctFromReplaceMissingValueWithSameLiteral() testQuery( buildFilterTestSql("LOOKUP(dim1, 'lookyloo', 'x6') IS DISTINCT FROM 'x6'"), QUERY_CONTEXT, - NullHandling.sqlCompatible() - ? buildFilterTestExpectedQuery( + buildFilterTestExpectedQuery( expressionVirtualColumn("v0", "lookup(\"dim1\",'lookyloo','x6')", ColumnType.STRING), not(istrue(equality("v0", "x6", ColumnType.STRING))) - ) - : buildFilterTestExpectedQuery( - not(selector("dim1", "x6", extractionFn)) ), ImmutableList.of(new Object[]{"xabc", 1L}) ); @@ -1211,27 +1081,14 @@ public void testFilterNotEquals2() testQuery( buildFilterTestSql("NOT (LOOKUP(dim1, 'lookyloo') = 'x6' OR cnt = 2)"), QUERY_CONTEXT, - NullHandling.sqlCompatible() - ? buildFilterTestExpectedQuery( + buildFilterTestExpectedQuery( expressionVirtualColumn("v0", "lookup(\"dim1\",'lookyloo')", ColumnType.STRING), and( not(equality("v0", "x6", ColumnType.STRING)), not(equality("cnt", 2L, ColumnType.LONG)) ) - ) - : buildFilterTestExpectedQuery( - and( - not(equality("dim1", "6", ColumnType.STRING)), - not(equality("cnt", 2L, ColumnType.LONG)) - ) ), - // sql compatible mode expression filter (correctly) leaves out null values - NullHandling.sqlCompatible() - ? ImmutableList.of(new Object[]{"xabc", 1L}) - : ImmutableList.of( - new Object[]{NULL_STRING, 5L}, - new Object[]{"xabc", 1L} - ) + ImmutableList.of(new Object[]{"xabc", 1L}) ); } @@ -1244,17 +1101,13 @@ public void testFilterEqualsIsNotTrue2() buildFilterTestSql("(LOOKUP(dim1, 'lookyloo') = 'x6' OR cnt = 2) IS NOT TRUE"), QUERY_CONTEXT, buildFilterTestExpectedQuery( - NullHandling.sqlCompatible() - ? not(istrue(or( + not(istrue(or( equality("dim1", "6", ColumnType.STRING), equality("cnt", 2L, ColumnType.LONG) ))) - : not(or( - equality("dim1", "6", ColumnType.STRING), - equality("cnt", 2L, ColumnType.LONG) - ))), + ), ImmutableList.of( - new Object[]{NULL_STRING, 5L}, + new Object[]{null, 5L}, new Object[]{"xabc", 1L} ) ); @@ -1273,7 +1126,7 @@ public void testFilterNotEquals2Injective() not(equality("cnt", 2L, ColumnType.LONG)) )), ImmutableList.of( - new Object[]{NULL_STRING, 4L}, + new Object[]{null, 4L}, new Object[]{"xabc", 1L} ) ); @@ -1287,32 +1140,23 @@ public void testFilterCoalesceSameLiteral() testQuery( buildFilterTestSql("COALESCE(LOOKUP(dim1, 'lookyloo'), 'x6') = 'x6'"), QUERY_CONTEXT, - NullHandling.sqlCompatible() - ? buildFilterTestExpectedQuery( + buildFilterTestExpectedQuery( expressionVirtualColumn("v0", "lookup(\"dim1\",'lookyloo','x6')", ColumnType.STRING), equality("v0", "x6", ColumnType.STRING) - ) - : buildFilterTestExpectedQuery( - selector("dim1", "x6", new RegisteredLookupExtractionFn(null, "lookyloo", false, "x6", null, false)) ), - ImmutableList.of(new Object[]{NULL_STRING, 5L}) + ImmutableList.of(new Object[]{null, 5L}) ); } @Test public void testFilterCoalesceSameLiteralInjective() { - if (NullHandling.sqlCompatible()) { - // cannotVectorize doesn't trip in default-value mode, due to buildFilterTestExpectedQueryAlwaysFalse. - cannotVectorize(); - } + cannotVectorize(); testQuery( buildFilterTestSql("COALESCE(LOOKUP(dim1, 'lookyloo121'), 'x6') = 'x6'"), QUERY_CONTEXT, - NullHandling.sqlCompatible() - ? buildFilterTestExpectedQueryConstantDimension("null", isNull("dim1")) - : buildFilterTestExpectedQueryAlwaysFalse(), + buildFilterTestExpectedQueryConstantDimension("null", isNull("dim1")), ImmutableList.of() ); } @@ -1328,21 +1172,14 @@ public void testFilterInCoalesceSameLiteral() testQuery( buildFilterTestSql("COALESCE(LOOKUP(dim1, 'lookyloo'), 'x6') IN ('xa', 'xabc', 'x6')"), QUERY_CONTEXT, - NullHandling.sqlCompatible() - ? buildFilterTestExpectedQuery( + buildFilterTestExpectedQuery( expressionVirtualColumn("v0", "lookup(\"dim1\",'lookyloo','x6')", ColumnType.STRING), or( in("dim1", Arrays.asList("a", "abc")), equality("v0", "x6", ColumnType.STRING) ) - ) - : buildFilterTestExpectedQuery( - or( - in("dim1", Arrays.asList("a", "abc")), - selector("dim1", "x6", extractionFn) - ) ), - ImmutableList.of(new Object[]{NullHandling.defaultStringValue(), 5L}, new Object[]{"xabc", 1L}) + ImmutableList.of(new Object[]{null, 5L}, new Object[]{"xabc", 1L}) ); } @@ -1355,11 +1192,9 @@ public void testFilterInCoalesceSameLiteralInjective() buildFilterTestSql("COALESCE(LOOKUP(dim1, 'lookyloo121'), 'x2') IN ('xabc', 'xdef', 'x2')"), QUERY_CONTEXT, buildFilterTestExpectedQuery( - NullHandling.sqlCompatible() - ? or(in("dim1", Arrays.asList("2", "abc", "def")), isNull("dim1")) - : in("dim1", Arrays.asList("2", "abc", "def")) + or(in("dim1", Arrays.asList("2", "abc", "def")), isNull("dim1")) ), - ImmutableList.of(new Object[]{NullHandling.defaultStringValue(), 2L}, new Object[]{"xabc", 1L}) + ImmutableList.of(new Object[]{null, 2L}, new Object[]{"xabc", 1L}) ); } @@ -1374,15 +1209,11 @@ public void testFilterMvContainsCoalesceSameLiteral() testQuery( buildFilterTestSql("MV_CONTAINS(COALESCE(LOOKUP(dim1, 'lookyloo'), 'x6'), 'x6')"), QUERY_CONTEXT, - NullHandling.sqlCompatible() - ? buildFilterTestExpectedQuery( + buildFilterTestExpectedQuery( expressionVirtualColumn("v0", "lookup(\"dim1\",'lookyloo','x6')", ColumnType.STRING), equality("v0", "x6", ColumnType.STRING) - ) - : buildFilterTestExpectedQuery( - selector("dim1", "x6", extractionFn) ), - ImmutableList.of(new Object[]{NULL_STRING, 5L}) + ImmutableList.of(new Object[]{null, 5L}) ); } @@ -1398,7 +1229,7 @@ public void testFilterMvOverlapCoalesceSameLiteral() buildFilterTestSql("MV_OVERLAP(COALESCE(LOOKUP(dim1, 'lookyloo'), 'x6'), ARRAY['xabc', 'x6', 'nonexistent'])"), QUERY_CONTEXT, buildFilterTestExpectedQuery(in("dim1", ImmutableList.of("xabc", "x6", "nonexistent"), extractionFn)), - ImmutableList.of(new Object[]{NULL_STRING, 5L}, new Object[]{"xabc", 1L}) + ImmutableList.of(new Object[]{null, 5L}, new Object[]{"xabc", 1L}) ); } @@ -1413,13 +1244,9 @@ public void testFilterCoalesceSameLiteralNotEquals() testQuery( buildFilterTestSql("COALESCE(LOOKUP(dim1, 'lookyloo'), 'x6') <> 'x6'"), QUERY_CONTEXT, - NullHandling.sqlCompatible() - ? buildFilterTestExpectedQuery( + buildFilterTestExpectedQuery( expressionVirtualColumn("v0", "lookup(\"dim1\",'lookyloo','x6')", ColumnType.STRING), not(equality("v0", "x6", ColumnType.STRING)) - ) - : buildFilterTestExpectedQuery( - not(selector("dim1", "x6", extractionFn)) ), ImmutableList.of(new Object[]{"xabc", 1L}) ); @@ -1434,7 +1261,7 @@ public void testFilterCoalesceSameLiteralNotEqualsInjective() buildFilterTestSql("COALESCE(LOOKUP(dim1, 'lookyloo121'), 'xabc') <> 'xabc'"), QUERY_CONTEXT, buildFilterTestExpectedQuery(not(equality("dim1", "abc", ColumnType.STRING))), - ImmutableList.of(new Object[]{NULL_STRING, 5L}) + ImmutableList.of(new Object[]{null, 5L}) ); } @@ -1524,7 +1351,7 @@ public void testFilterCoalesceDifferentLiteralNotEquals() QUERY_CONTEXT, buildFilterTestExpectedQuery(not(equality("dim1", "6", ColumnType.STRING))), ImmutableList.of( - new Object[]{NULL_STRING, 5L}, + new Object[]{null, 5L}, new Object[]{"xabc", 1L} ) ); @@ -1540,7 +1367,7 @@ public void testFilterCoalesceDifferentLiteralNotEqualsAlwaysTrue() QUERY_CONTEXT, buildFilterTestExpectedQuery(null), ImmutableList.of( - new Object[]{NULL_STRING, 5L}, + new Object[]{null, 5L}, new Object[]{"xabc", 1L} ) ); @@ -1575,7 +1402,7 @@ public void testFilterInCoalesceSameColumn() in("v0", ImmutableList.of("10.1", "xabc")) ), ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 1L}, + new Object[]{null, 1L}, new Object[]{"xabc", 1L} ) ); @@ -1683,7 +1510,7 @@ public void testLookupReplaceMissingValueWith() .build() ), ImmutableList.of( - new Object[]{"Missing_Value", "Missing_Value", NullHandling.defaultStringValue(), 5L}, + new Object[]{"Missing_Value", "Missing_Value", null, 5L}, new Object[]{"xabc", "xabc", "xabc", 1L} ) ); @@ -1716,7 +1543,7 @@ public void testCountDistinctOfLookup() .build() ), ImmutableList.of( - new Object[]{NullHandling.replaceWithDefault() ? 2L : 1L} + new Object[]{1L} ) ); } @@ -1724,19 +1551,10 @@ public void testCountDistinctOfLookup() @Test public void testLookupOnValueThatIsNull() { - List expected; - if (useDefault) { - expected = ImmutableList.builder().add( - new Object[]{NULL_STRING, NULL_STRING}, - new Object[]{NULL_STRING, NULL_STRING}, - new Object[]{NULL_STRING, NULL_STRING} - ).build(); - } else { - expected = ImmutableList.builder().add( - new Object[]{NULL_STRING, NULL_STRING}, - new Object[]{NULL_STRING, NULL_STRING} - ).build(); - } + List expected = ImmutableList.builder().add( + new Object[]{null, null}, + new Object[]{null, null} + ).build(); testQuery( "SELECT dim2 ,lookup(dim2,'lookyloo') from foo where dim2 is null", QUERY_CONTEXT, @@ -1761,19 +1579,10 @@ public void testLookupOnValueThatIsNull() @Test public void testLookupOnValueThatIsNotDistinctFromNull() { - List expected; - if (useDefault) { - expected = ImmutableList.builder().add( - new Object[]{NULL_STRING, NULL_STRING}, - new Object[]{NULL_STRING, NULL_STRING}, - new Object[]{NULL_STRING, NULL_STRING} - ).build(); - } else { - expected = ImmutableList.builder().add( - new Object[]{NULL_STRING, NULL_STRING}, - new Object[]{NULL_STRING, NULL_STRING} - ).build(); - } + List expected = ImmutableList.builder().add( + new Object[]{null, null}, + new Object[]{null, null} + ).build(); testQuery( "SELECT dim2 ,lookup(dim2,'lookyloo') from foo where dim2 is not distinct from null", QUERY_CONTEXT, @@ -1873,7 +1682,7 @@ public void testExactCountDistinct() .build() ), ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), NullHandling.replaceWithDefault() ? 2L : 3L, 5L}, + new Object[]{null, 3L, 5L}, new Object[]{"xabc", 0L, 1L} ) ); @@ -1938,9 +1747,7 @@ public void testPullUpAndReverseLookup() @Test public void testDontPullUpLookupWhenUsedByAggregation() { - if (NullHandling.sqlCompatible()) { - cannotVectorizeUnlessFallback(); - } + cannotVectorizeUnlessFallback(); testQuery( "SELECT LOOKUP(dim1, 'lookyloo121'), COUNT(LOOKUP(dim1, 'lookyloo121')) FROM druid.foo GROUP BY 1", ImmutableList.of( @@ -1949,24 +1756,20 @@ public void testDontPullUpLookupWhenUsedByAggregation() .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) .setVirtualColumns( - NullHandling.sqlCompatible() - ? new VirtualColumn[]{ + new VirtualColumn[]{ expressionVirtualColumn( "v0", "lookup(\"dim1\",'lookyloo121')", ColumnType.STRING ) } - : new VirtualColumn[0] ) .setDimensions(dimensions(new ExtractionDimensionSpec("dim1", "d0", EXTRACTION_FN_121))) .setAggregatorSpecs( aggregators( new FilteredAggregatorFactory( new CountAggregatorFactory("a0"), - NullHandling.sqlCompatible() - ? not(isNull("v0")) - : not(selector("dim1", null, EXTRACTION_FN_121)) + not(isNull("v0")) ) ) ) @@ -2035,9 +1838,9 @@ public void testPullUpLookupMoreDimensions() ImmutableList.of( new Object[]{1L, "a", "", "x"}, new Object[]{1L, "a", "1", "x1"}, - new Object[]{1L, NullHandling.defaultStringValue(), "10.1", "x10.1"}, + new Object[]{1L, null, "10.1", "x10.1"}, new Object[]{1L, "", "2", "x2"}, - new Object[]{1L, NullHandling.defaultStringValue(), "abc", "xabc"}, + new Object[]{1L, null, "abc", "xabc"}, new Object[]{1L, "abc", "def", "xdef"} ) ); @@ -2066,11 +1869,11 @@ public void testPullUpLookupOneInjectiveOneNot() .build() ), ImmutableList.of( - new Object[]{1L, NullHandling.defaultStringValue(), "x"}, - new Object[]{1L, NullHandling.defaultStringValue(), "x1"}, - new Object[]{1L, NullHandling.defaultStringValue(), "x10.1"}, - new Object[]{1L, NullHandling.defaultStringValue(), "x2"}, - new Object[]{1L, NullHandling.defaultStringValue(), "xdef"}, + new Object[]{1L, null, "x"}, + new Object[]{1L, null, "x1"}, + new Object[]{1L, null, "x10.1"}, + new Object[]{1L, null, "x2"}, + new Object[]{1L, null, "xdef"}, new Object[]{1L, "xabc", "xabc"} ) ); diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteMultiValueStringQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteMultiValueStringQueryTest.java index 765bbc4ef907..7d3342e56a85 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteMultiValueStringQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteMultiValueStringQueryTest.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.math.expr.ExpressionProcessing; @@ -33,7 +32,6 @@ import org.apache.druid.query.dimension.DefaultDimensionSpec; import org.apache.druid.query.dimension.ExtractionDimensionSpec; import org.apache.druid.query.expression.TestExprMacroTable; -import org.apache.druid.query.extraction.SubstringDimExtractionFn; import org.apache.druid.query.filter.LikeDimFilter; import org.apache.druid.query.filter.NullFilter; import org.apache.druid.query.groupby.GroupByQuery; @@ -69,26 +67,14 @@ public void testMultiValueStringWorksLikeStringGroupBy() cannotVectorize(); Map groupByOnMultiValueColumnEnabled = new HashMap<>(QUERY_CONTEXT_DEFAULT); groupByOnMultiValueColumnEnabled.put(GroupByQueryConfig.CTX_KEY_ENABLE_MULTI_VALUE_UNNESTING, true); - List expected; - if (NullHandling.replaceWithDefault()) { - expected = ImmutableList.of( - new Object[]{"bfoo", 2L}, - new Object[]{"foo", 2L}, - new Object[]{"", 1L}, - new Object[]{"afoo", 1L}, - new Object[]{"cfoo", 1L}, - new Object[]{"dfoo", 1L} - ); - } else { - expected = ImmutableList.of( - new Object[]{null, 2L}, - new Object[]{"bfoo", 2L}, - new Object[]{"afoo", 1L}, - new Object[]{"cfoo", 1L}, - new Object[]{"dfoo", 1L}, - new Object[]{"foo", 1L} - ); - } + List expected = ImmutableList.of( + new Object[]{null, 2L}, + new Object[]{"bfoo", 2L}, + new Object[]{"afoo", 1L}, + new Object[]{"cfoo", 1L}, + new Object[]{"dfoo", 1L}, + new Object[]{"foo", 1L} + ); testQuery( "SELECT concat(dim3, 'foo'), SUM(cnt) FROM druid.numfoo GROUP BY 1 ORDER BY 2 DESC", groupByOnMultiValueColumnEnabled, @@ -184,7 +170,6 @@ public void testMultiValueStringWorksLikeStringGroupByWithFilter() @Test public void testMultiValueStringWorksLikeStringScan() { - final String nullVal = NullHandling.replaceWithDefault() ? "foo" : null; testQuery( "SELECT concat(dim3, 'foo') FROM druid.numfoo", ImmutableList.of( @@ -203,8 +188,8 @@ public void testMultiValueStringWorksLikeStringScan() new Object[]{"[\"bfoo\",\"cfoo\"]"}, new Object[]{"dfoo"}, new Object[]{"foo"}, - new Object[]{nullVal}, - new Object[]{nullVal} + new Object[]{null}, + new Object[]{null} ) ); } @@ -212,7 +197,6 @@ public void testMultiValueStringWorksLikeStringScan() @Test public void testMultiValueStringWorksLikeStringSelfConcatScan() { - final String nullVal = NullHandling.replaceWithDefault() ? "-lol-" : null; testQuery( "SELECT concat(dim3, '-lol-', dim3) FROM druid.numfoo", ImmutableList.of( @@ -231,8 +215,8 @@ public void testMultiValueStringWorksLikeStringSelfConcatScan() new Object[]{"[\"b-lol-b\",\"c-lol-c\"]"}, new Object[]{"d-lol-d"}, new Object[]{"-lol-"}, - new Object[]{nullVal}, - new Object[]{nullVal} + new Object[]{null}, + new Object[]{null} ) ); } @@ -297,7 +281,7 @@ public void testMultiValueStringOverlapFilterNull() .dataSource(CalciteTests.DATASOURCE3) .eternityInterval() .filters( - NullHandling.sqlCompatible() ? NullFilter.forColumn("dim3") : selector("dim3", null) + NullFilter.forColumn("dim3") ) .columns("dim3") .columnTypes(ColumnType.STRING) @@ -306,16 +290,10 @@ public void testMultiValueStringOverlapFilterNull() .context(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.sqlCompatible() - ? ImmutableList.of( + ImmutableList.of( new Object[]{null}, new Object[]{null} ) - : ImmutableList.of( - new Object[]{""}, - new Object[]{""}, - new Object[]{""} - ) ); } @@ -338,7 +316,7 @@ public void testMultiValueStringOverlapFilterNonLiteral() ), ImmutableList.of( new Object[]{"[\"a\",\"b\"]"}, - new Object[]{NullHandling.defaultStringValue()} + new Object[]{null} ) ); } @@ -381,7 +359,7 @@ public void testMultiValueStringContainsFilterNull() .dataSource(CalciteTests.DATASOURCE3) .eternityInterval() .filters( - NullHandling.sqlCompatible() ? NullFilter.forColumn("dim3") : selector("dim3", null) + NullFilter.forColumn("dim3") ) .columns("dim3") .columnTypes(ColumnType.STRING) @@ -390,16 +368,10 @@ public void testMultiValueStringContainsFilterNull() .context(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.sqlCompatible() - ? ImmutableList.of( + ImmutableList.of( new Object[]{null}, new Object[]{null} ) - : ImmutableList.of( - new Object[]{""}, - new Object[]{""}, - new Object[]{""} - ) ); } @@ -445,7 +417,7 @@ public void testMultiValueStringContainsArrayOfNonLiteral() ), ImmutableList.of( new Object[]{"[\"a\",\"b\"]"}, - new Object[]{NullHandling.defaultStringValue()} + new Object[]{null} ) ); } @@ -470,9 +442,9 @@ public void testMultiValueStringSlice() new Object[]{"b"}, new Object[]{"c"}, new Object[]{"[]"}, - new Object[]{useDefault ? NULL_STRING : "[]"}, - new Object[]{NULL_STRING}, - new Object[]{NULL_STRING} + new Object[]{"[]"}, + new Object[]{null}, + new Object[]{null} ) ); } @@ -510,10 +482,10 @@ public void testMultiValueStringLength() ImmutableList.of( new Object[]{"", 2, 1L}, new Object[]{"10.1", 2, 1L}, - useDefault ? new Object[]{"2", 1, 1L} : new Object[]{"1", 1, 1L}, - useDefault ? new Object[]{"1", 0, 1L} : new Object[]{"2", 1, 1L}, - new Object[]{"abc", useDefault ? 0 : null, 1L}, - new Object[]{"def", useDefault ? 0 : null, 1L} + new Object[]{"1", 1, 1L}, + new Object[]{"2", 1, 1L}, + new Object[]{"abc", null, 1L}, + new Object[]{"def", null, 1L} ) ); } @@ -524,27 +496,15 @@ public void testMultiValueStringAppend() // Cannot vectorize due to usage of expressions. cannotVectorize(); - ImmutableList results; - if (useDefault) { - results = ImmutableList.of( - new Object[]{"", 3L}, - new Object[]{"foo", 3L}, - new Object[]{"b", 2L}, - new Object[]{"a", 1L}, - new Object[]{"c", 1L}, - new Object[]{"d", 1L} - ); - } else { - results = ImmutableList.of( - new Object[]{"foo", 4L}, - new Object[]{null, 2L}, - new Object[]{"b", 2L}, - new Object[]{"", 1L}, - new Object[]{"a", 1L}, - new Object[]{"c", 1L}, - new Object[]{"d", 1L} - ); - } + ImmutableList results = ImmutableList.of( + new Object[]{"foo", 4L}, + new Object[]{null, 2L}, + new Object[]{"b", 2L}, + new Object[]{"", 1L}, + new Object[]{"a", 1L}, + new Object[]{"c", 1L}, + new Object[]{"d", 1L} + ); testQuery( "SELECT MV_APPEND(dim3, 'foo'), SUM(cnt) FROM druid.numfoo GROUP BY 1 ORDER BY 2 DESC", ImmutableList.of( @@ -584,27 +544,15 @@ public void testMultiValueStringPrepend() // Cannot vectorize due to usage of expressions. cannotVectorize(); - ImmutableList results; - if (useDefault) { - results = ImmutableList.of( - new Object[]{"", 3L}, - new Object[]{"foo", 3L}, - new Object[]{"b", 2L}, - new Object[]{"a", 1L}, - new Object[]{"c", 1L}, - new Object[]{"d", 1L} - ); - } else { - results = ImmutableList.of( - new Object[]{"foo", 4L}, - new Object[]{null, 2L}, - new Object[]{"b", 2L}, - new Object[]{"", 1L}, - new Object[]{"a", 1L}, - new Object[]{"c", 1L}, - new Object[]{"d", 1L} - ); - } + ImmutableList results = ImmutableList.of( + new Object[]{"foo", 4L}, + new Object[]{null, 2L}, + new Object[]{"b", 2L}, + new Object[]{"", 1L}, + new Object[]{"a", 1L}, + new Object[]{"c", 1L}, + new Object[]{"d", 1L} + ); testQuery( "SELECT MV_PREPEND('foo', dim3), SUM(cnt) FROM druid.numfoo GROUP BY 1 ORDER BY 2 DESC", ImmutableList.of( @@ -642,23 +590,13 @@ public void testMultiValueStringPrepend() public void testMultiValueStringPrependAppend() { cannotVectorizeUnlessFallback(); - ImmutableList results; - if (useDefault) { - results = ImmutableList.of( - new Object[]{"", "", 3L}, - new Object[]{"foo,a,b", "a,b,foo", 1L}, - new Object[]{"foo,b,c", "b,c,foo", 1L}, - new Object[]{"foo,d", "d,foo", 1L} - ); - } else { - results = ImmutableList.of( - new Object[]{null, null, 2L}, - new Object[]{"foo,", ",foo", 1L}, - new Object[]{"foo,a,b", "a,b,foo", 1L}, - new Object[]{"foo,b,c", "b,c,foo", 1L}, - new Object[]{"foo,d", "d,foo", 1L} - ); - } + ImmutableList results = ImmutableList.of( + new Object[]{null, null, 2L}, + new Object[]{"foo,", ",foo", 1L}, + new Object[]{"foo,a,b", "a,b,foo", 1L}, + new Object[]{"foo,b,c", "b,c,foo", 1L}, + new Object[]{"foo,d", "d,foo", 1L} + ); testQuery( "SELECT MV_TO_STRING(MV_PREPEND('foo', dim3), ','), MV_TO_STRING(MV_APPEND(dim3, 'foo'), ','), SUM(cnt) FROM druid.numfoo GROUP BY 1,2 ORDER BY 3 DESC", ImmutableList.of( @@ -706,25 +644,14 @@ public void testMultiValueStringConcat() // Cannot vectorize due to usage of expressions. cannotVectorize(); - ImmutableList results; - if (useDefault) { - results = ImmutableList.of( - new Object[]{"b", 4L}, - new Object[]{"", 3L}, - new Object[]{"a", 2L}, - new Object[]{"c", 2L}, - new Object[]{"d", 2L} - ); - } else { - results = ImmutableList.of( - new Object[]{"b", 4L}, - new Object[]{null, 2L}, - new Object[]{"", 2L}, - new Object[]{"a", 2L}, - new Object[]{"c", 2L}, - new Object[]{"d", 2L} - ); - } + ImmutableList results = ImmutableList.of( + new Object[]{"b", 4L}, + new Object[]{null, 2L}, + new Object[]{"", 2L}, + new Object[]{"a", 2L}, + new Object[]{"c", 2L}, + new Object[]{"d", 2L} + ); testQuery( "SELECT MV_CONCAT(dim3, dim3), SUM(cnt) FROM druid.numfoo GROUP BY 1 ORDER BY 2 DESC", ImmutableList.of( @@ -766,25 +693,14 @@ public void testMultiValueStringConcatBackwardsCompat0dot22andOlder() // Cannot vectorize due to usage of expressions. cannotVectorize(); - ImmutableList results; - if (useDefault) { - results = ImmutableList.of( - new Object[]{"", 6L}, - new Object[]{"b", 4L}, - new Object[]{"a", 2L}, - new Object[]{"c", 2L}, - new Object[]{"d", 2L} - ); - } else { - results = ImmutableList.of( - new Object[]{null, 4L}, - new Object[]{"b", 4L}, - new Object[]{"", 2L}, - new Object[]{"a", 2L}, - new Object[]{"c", 2L}, - new Object[]{"d", 2L} - ); - } + ImmutableList results = ImmutableList.of( + new Object[]{null, 4L}, + new Object[]{"b", 4L}, + new Object[]{"", 2L}, + new Object[]{"a", 2L}, + new Object[]{"c", 2L}, + new Object[]{"d", 2L} + ); testQuery( "SELECT MV_CONCAT(dim3, dim3), SUM(cnt) FROM druid.numfoo GROUP BY 1 ORDER BY 2 DESC", ImmutableList.of( @@ -852,7 +768,7 @@ public void testMultiValueStringOffset() .build() ), ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 4L}, + new Object[]{null, 4L}, new Object[]{"b", 1L}, new Object[]{"c", 1L} ) @@ -893,7 +809,7 @@ public void testMultiValueStringOrdinal() .build() ), ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 4L}, + new Object[]{null, 4L}, new Object[]{"b", 1L}, new Object[]{"c", 1L} ) @@ -933,13 +849,7 @@ public void testMultiValueStringOffsetOf() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - useDefault - ? ImmutableList.of( - new Object[]{0, 4L}, - new Object[]{-1, 1L}, - new Object[]{1, 1L} - ) - : ImmutableList.of( + ImmutableList.of( new Object[]{null, 4L}, new Object[]{0, 1L}, new Object[]{1, 1L} @@ -980,14 +890,7 @@ public void testMultiValueStringOrdinalOf() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - useDefault - ? ImmutableList.of( - new Object[]{0, 3L}, - new Object[]{-1, 1L}, - new Object[]{1, 1L}, - new Object[]{2, 1L} - ) - : ImmutableList.of( + ImmutableList.of( new Object[]{null, 4L}, new Object[]{1, 1L}, new Object[]{2, 1L} @@ -999,23 +902,13 @@ public void testMultiValueStringOrdinalOf() public void testMultiValueStringToString() { cannotVectorizeUnlessFallback(); - ImmutableList results; - if (useDefault) { - results = ImmutableList.of( - new Object[]{"", 3L}, - new Object[]{"a,b", 1L}, - new Object[]{"b,c", 1L}, - new Object[]{"d", 1L} - ); - } else { - results = ImmutableList.of( - new Object[]{null, 2L}, - new Object[]{"", 1L}, - new Object[]{"a,b", 1L}, - new Object[]{"b,c", 1L}, - new Object[]{"d", 1L} - ); - } + ImmutableList results = ImmutableList.of( + new Object[]{null, 2L}, + new Object[]{"", 1L}, + new Object[]{"a,b", 1L}, + new Object[]{"b,c", 1L}, + new Object[]{"d", 1L} + ); testQuery( "SELECT MV_TO_STRING(dim3, ','), SUM(cnt) FROM druid.numfoo GROUP BY 1 ORDER BY 2 DESC", ImmutableList.of( @@ -1055,23 +948,13 @@ public void testMultiValueStringToStringToMultiValueString() // Cannot vectorize due to usage of expressions. cannotVectorize(); - ImmutableList results; - if (useDefault) { - results = ImmutableList.of( - new Object[]{"d", 4L}, - new Object[]{"b", 2L}, - new Object[]{"a", 1L}, - new Object[]{"c", 1L} - ); - } else { - results = ImmutableList.of( - new Object[]{"d", 5L}, - new Object[]{"b", 2L}, - new Object[]{"", 1L}, - new Object[]{"a", 1L}, - new Object[]{"c", 1L} - ); - } + ImmutableList results = ImmutableList.of( + new Object[]{"d", 5L}, + new Object[]{"b", 2L}, + new Object[]{"", 1L}, + new Object[]{"a", 1L}, + new Object[]{"c", 1L} + ); testQuery( "SELECT STRING_TO_MV(CONCAT(MV_TO_STRING(dim3, ','), ',d'), ','), SUM(cnt) FROM druid.numfoo WHERE MV_LENGTH(dim3) > 0 GROUP BY 1 ORDER BY 2 DESC, 1", ImmutableList.of( @@ -1137,19 +1020,11 @@ public void testSelectAndFilterByStringToMV() .build() ) .expectedResults( - NullHandling.sqlCompatible() ? ImmutableList.of( new Object[]{"[\"a\",\"b\",\"d\"]"}, new Object[]{"[\"b\",\"c\",\"d\"]"}, new Object[]{"[\"d\",\"d\"]"}, new Object[]{"[\"\",\"d\"]"} - ) : ImmutableList.of( - new Object[]{"[\"a\",\"b\",\"d\"]"}, - new Object[]{"[\"b\",\"c\",\"d\"]"}, - new Object[]{"[\"d\",\"d\"]"}, - new Object[]{"[\"\",\"d\"]"}, - new Object[]{"[\"\",\"d\"]"}, - new Object[]{"[\"\",\"d\"]"} ) ) .run(); @@ -1235,13 +1110,7 @@ public void testStringToMVOfStringAgg() // Cannot vectorize due to usage of expressions. cannotVectorize(); - final String expectedResult; - - if (NullHandling.sqlCompatible()) { - expectedResult = "[\"\",\"10.1\",\"2\",\"1\",\"def\",\"abc\"]"; - } else { - expectedResult = "[\"10.1\",\"2\",\"1\",\"def\",\"abc\"]"; - } + final String expectedResult = "[\"\",\"10.1\",\"2\",\"1\",\"def\",\"abc\"]"; testBuilder() .sql("SELECT STRING_TO_MV(STRING_AGG(dim1, ','), ',') AS mv, COUNT(*) cnt FROM druid.numfoo") @@ -1318,7 +1187,7 @@ public void testMultiValueListFilter() .build() ), ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 4L}, + new Object[]{null, 4L}, new Object[]{"b", 2L} ) ); @@ -1348,11 +1217,11 @@ public void testMultiValueListFilterNonLiteral() ), ImmutableList.of( new Object[]{"a"}, - new Object[]{NullHandling.defaultStringValue()}, - new Object[]{NullHandling.defaultStringValue()}, - new Object[]{NullHandling.defaultStringValue()}, - new Object[]{NullHandling.defaultStringValue()}, - new Object[]{NullHandling.defaultStringValue()} + new Object[]{null}, + new Object[]{null}, + new Object[]{null}, + new Object[]{null}, + new Object[]{null} ) ); } @@ -1395,15 +1264,8 @@ public void testMultiValueListFilterDeny() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - useDefault ? ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 3L}, - new Object[]{"a", 1L}, - new Object[]{"c", 1L}, - new Object[]{"d", 1L} - ) : - ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 2L}, + new Object[]{null, 2L}, new Object[]{"", 1L}, new Object[]{"a", 1L}, new Object[]{"c", 1L}, @@ -1439,8 +1301,8 @@ public void testMultiValueListFilterDenyNonLiteral() new Object[]{"[\"b\",\"c\"]"}, new Object[]{"d"}, new Object[]{""}, - new Object[]{NullHandling.defaultStringValue()}, - new Object[]{NullHandling.defaultStringValue()} + new Object[]{null}, + new Object[]{null} ) ); } @@ -1488,10 +1350,7 @@ public void testMultiValueListFilterComposed() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - useDefault ? ImmutableList.of( - new Object[]{0, 4L}, - new Object[]{1, 2L} - ) : ImmutableList.of( + ImmutableList.of( // the fallback expression would actually produce 3 rows, 2 nulls, 2 0's, and 2 1s // instead of 4 nulls and two 1's we get when using the 'native' list filtered virtual column // this is because of slight differences between filter and the native @@ -1559,10 +1418,7 @@ public void testMultiValueListFilterComposedNested() // where it doesn't use the deferred selector because it is no longer a single input expression, it would still // evaluate to null because the filter expression never returns null, only an empty array, which is not null, // so it evaluates 'v1' which of course is null because it is an empty row - useDefault ? ImmutableList.of( - new Object[]{"", 4L}, - new Object[]{"b", 2L} - ) : ImmutableList.of( + ImmutableList.of( new Object[]{null, 4L}, new Object[]{"b", 2L} ) @@ -1672,11 +1528,7 @@ public void testMultiValueListFilterComposedNestedNullLiteral() ), // unfortunately, unable to work around the strange behavior by adding nulls to the allow list, since not all of the values are actually // [], so some of them end up as 'no b' - useDefault ? ImmutableList.of( - new Object[]{"", 2L}, - new Object[]{"b", 2L}, - new Object[]{"no b", 2L} - ) : ImmutableList.of( + ImmutableList.of( new Object[]{null, 3L}, new Object[]{"b", 2L}, new Object[]{"no b", 1L} @@ -1727,9 +1579,7 @@ public void testMultiValueListFilterComposedDeny() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - useDefault - ? ImmutableList.of(new Object[]{0, 3L}, new Object[]{1, 3L}) - : ImmutableList.of(new Object[]{1, 4L}, new Object[]{null, 2L}) + ImmutableList.of(new Object[]{1, 4L}, new Object[]{null, 2L}) ); } @@ -1782,11 +1632,7 @@ public void testMultiValueListFilterComposedMultipleExpressions() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - useDefault ? ImmutableList.of( - new Object[]{0, 0, 3L}, - new Object[]{1, 2, 2L}, - new Object[]{0, 1, 1L} - ) : ImmutableList.of( + ImmutableList.of( new Object[]{null, null, 2L}, new Object[]{null, 1, 2L}, new Object[]{1, 2, 2L} @@ -1966,12 +1812,6 @@ public void testMultiValueToArrayGroupAsArrayWithMultiValueDimension() .setContext(QUERY_CONTEXT_NO_STRINGIFY_ARRAY) .build() ), - useDefault ? ImmutableList.of( - new Object[]{null, 3L}, - new Object[]{ImmutableList.of("a", "b"), 1L}, - new Object[]{ImmutableList.of("b", "c"), 1L}, - new Object[]{ImmutableList.of("d"), 1L} - ) : ImmutableList.of( new Object[]{null, 2L}, new Object[]{ImmutableList.of(""), 1L}, @@ -2018,14 +1858,6 @@ public void testMultiValueToArrayGroupAsArrayWithSingleValueDim() .setContext(QUERY_CONTEXT_NO_STRINGIFY_ARRAY) .build() ), - useDefault ? ImmutableList.of( - new Object[]{null, 1L}, - new Object[]{ImmutableList.of("1"), 1L}, - new Object[]{ImmutableList.of("10.1"), 1L}, - new Object[]{ImmutableList.of("2"), 1L}, - new Object[]{ImmutableList.of("abc"), 1L}, - new Object[]{ImmutableList.of("def"), 1L} - ) : ImmutableList.of( new Object[]{ImmutableList.of(""), 1L}, new Object[]{ImmutableList.of("1"), 1L}, @@ -2074,14 +1906,6 @@ public void testMultiValueToArrayGroupAsArrayWithSingleValueDimIsNotConvertedToT .setContext(QUERY_CONTEXT_NO_STRINGIFY_ARRAY) .build() ), - useDefault ? ImmutableList.of( - new Object[]{null, 1L}, - new Object[]{ImmutableList.of("1"), 1L}, - new Object[]{ImmutableList.of("10.1"), 1L}, - new Object[]{ImmutableList.of("2"), 1L}, - new Object[]{ImmutableList.of("abc"), 1L}, - new Object[]{ImmutableList.of("def"), 1L} - ) : ImmutableList.of( new Object[]{ImmutableList.of(""), 1L}, new Object[]{ImmutableList.of("1"), 1L}, @@ -2179,15 +2003,7 @@ public void testMultiValueStringOverlapFilterCoalesceNvl() .context(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() - ? ImmutableList.of( - new Object[]{"[\"a\",\"b\"]"}, - new Object[]{"[\"b\",\"c\"]"}, - new Object[]{"other"}, - new Object[]{"other"}, - new Object[]{"other"} - ) - : ImmutableList.of( + ImmutableList.of( new Object[]{"[\"a\",\"b\"]"}, new Object[]{"[\"b\",\"c\"]"}, new Object[]{"other"}, @@ -2226,15 +2042,7 @@ public void testMultiValueStringOverlapFilterCoalesceSingleValue() .context(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() - ? ImmutableList.of( - new Object[]{"[\"a\",\"b\"]"}, - new Object[]{"[\"b\",\"c\"]"}, - new Object[]{"other"}, - new Object[]{"other"}, - new Object[]{"other"} - ) - : ImmutableList.of( + ImmutableList.of( new Object[]{"[\"a\",\"b\"]"}, new Object[]{"[\"b\",\"c\"]"}, new Object[]{"other"}, @@ -2280,13 +2088,7 @@ public void testMultiValueStringOverlapFilterCoalesceSingleValueOtherColumn() .context(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() - ? ImmutableList.of( - new Object[]{"[\"a\",\"b\"]"}, - new Object[]{"[\"b\",\"c\"]"}, - new Object[]{"a"} - ) - : ImmutableList.of( + ImmutableList.of( new Object[]{"[\"a\",\"b\"]"}, new Object[]{"[\"b\",\"c\"]"} ) @@ -2334,7 +2136,7 @@ public void testMultiValuedFilterOnlyWhenLookupPullsInDuplicates() .setContext(QUERY_CONTEXT_DEFAULT) .build()) .expectedResults( - ImmutableList.of(new Object[]{NullHandling.defaultStringValue(), 7L})) + ImmutableList.of(new Object[]{null, 7L})) .run(); } @@ -2349,24 +2151,14 @@ public void testMvContainsFilterWithExtractionFn() .columnTypes(ColumnType.STRING) .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) .limit(5) - .context(QUERY_CONTEXT_DEFAULT); - - if (NullHandling.sqlCompatible()) { - builder = builder.virtualColumns(expressionVirtualColumn("v0", "substring(\"dim3\", 0, 1)", ColumnType.STRING)) - .filters( - and( - equality("v0", "a", ColumnType.STRING), - equality("v0", "b", ColumnType.STRING) - ) - ); - } else { - builder = builder.filters( - and( - selector("dim3", "a", new SubstringDimExtractionFn(0, 1)), - selector("dim3", "b", new SubstringDimExtractionFn(0, 1)) - ) - ); - } + .context(QUERY_CONTEXT_DEFAULT) + .virtualColumns(expressionVirtualColumn("v0", "substring(\"dim3\", 0, 1)", ColumnType.STRING)) + .filters( + and( + equality("v0", "a", ColumnType.STRING), + equality("v0", "b", ColumnType.STRING) + ) + ); testQuery( "SELECT dim3 FROM druid.numfoo WHERE MV_CONTAINS(SUBSTRING(dim3, 1, 1), ARRAY['a','b']) LIMIT 5", ImmutableList.of(builder.build()), diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteNestedDataQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteNestedDataQueryTest.java index 4ab531b74e29..6b2bd9bc5871 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteNestedDataQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteNestedDataQueryTest.java @@ -23,7 +23,6 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.inject.Injector; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.data.input.InputRowSchema; import org.apache.druid.data.input.ResourceInputSource; @@ -460,7 +459,7 @@ public void testGroupByPath() .build() ), ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 4L}, + new Object[]{null, 4L}, new Object[]{"100", 2L}, new Object[]{"200", 1L} ), @@ -497,7 +496,7 @@ public void testGroupJsonValueAny() .build() ), ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 4L}, + new Object[]{null, 4L}, new Object[]{"100", 2L}, new Object[]{"200", 1L} ), @@ -534,7 +533,7 @@ public void testGroupByJsonValue() .build() ), ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 4L}, + new Object[]{null, 4L}, new Object[]{"100", 2L}, new Object[]{"200", 1L} ), @@ -571,7 +570,7 @@ public void testTopNPath() .build() ), ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 4L}, + new Object[]{null, 4L}, new Object[]{"100", 2L}, new Object[]{"200", 1L} ), @@ -814,7 +813,7 @@ public void testGroupByRootPath() .build() ), ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 5L}, + new Object[]{null, 5L}, new Object[]{"2", 1L}, new Object[]{"hello", 1L} ), @@ -992,7 +991,7 @@ public void testGroupByRootSingleTypeStringMixed1Sparse() .build() ), ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 8L}, + new Object[]{null, 8L}, new Object[]{"10", 2L}, new Object[]{"yyy", 2L}, new Object[]{"zzz", 2L} @@ -1099,7 +1098,7 @@ public void testGroupByRootSingleTypeStringMixed2Sparse() .build() ), ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 8L}, + new Object[]{null, 8L}, new Object[]{"10", 2L}, new Object[]{"yyy", 2L}, new Object[]{"zzz", 2L} @@ -1141,7 +1140,7 @@ public void testGroupByRootSingleTypeStringMixed2SparseJsonValueNonExistentPath( .build() ), ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 14L} + new Object[]{null, 14L} ), RowSignature.builder() .add("EXPR$0", ColumnType.STRING) @@ -1338,19 +1337,19 @@ public void testUnnestRootSingleTypeArrayStringNulls() new Object[]{"a"}, new Object[]{"b"}, new Object[]{"d"}, - new Object[]{NullHandling.defaultStringValue()}, + new Object[]{null}, new Object[]{"b"}, - new Object[]{NullHandling.defaultStringValue()}, + new Object[]{null}, new Object[]{"b"}, new Object[]{"a"}, new Object[]{"b"}, new Object[]{"b"}, new Object[]{"b"}, - new Object[]{NullHandling.defaultStringValue()}, + new Object[]{null}, new Object[]{"d"}, - new Object[]{NullHandling.defaultStringValue()}, + new Object[]{null}, new Object[]{"b"}, - new Object[]{NullHandling.defaultStringValue()}, + new Object[]{null}, new Object[]{"b"} ) ) @@ -1621,10 +1620,6 @@ public void testGroupByRootSingleTypeLongJsonValueFilter() @Test public void testGroupByRootSingleTypeArrayLongNullsFilteredArrayEquality() { - if (NullHandling.replaceWithDefault()) { - // this fails in default value mode because it relies on equality filter and null filter to behave correctly - return; - } cannotVectorize(); testBuilder() .sql( @@ -1705,7 +1700,7 @@ public void testGroupByRootSingleTypeArrayLongNullsUnnest() ) .expectedResults( ImmutableList.of( - new Object[]{NullHandling.defaultLongValue(), 5L}, + new Object[]{null, 5L}, new Object[]{1L, 5L}, new Object[]{2L, 6L}, new Object[]{3L, 6L}, @@ -1973,7 +1968,7 @@ public void testGroupByRootSingleTypeArrayStringNullsUnnest() ) .expectedResults( ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 5L}, + new Object[]{null, 5L}, new Object[]{"a", 3L}, new Object[]{"b", 11L}, new Object[]{"d", 2L} @@ -2188,7 +2183,7 @@ public void testGroupByRootSingleTypeArrayDoubleNullsUnnest() ) .expectedResults( ImmutableList.of( - new Object[]{NullHandling.defaultDoubleValue(), 12L}, + new Object[]{null, 12L}, new Object[]{1.1D, 3L}, new Object[]{2.2D, 4L}, new Object[]{5.5D, 4L}, @@ -2299,7 +2294,7 @@ public void testGroupByRootSingleTypeArrayLongElement() ) .expectedResults( ImmutableList.of( - new Object[]{NullHandling.defaultLongValue(), 4L}, + new Object[]{null, 4L}, new Object[]{2L, 6L}, new Object[]{3L, 2L}, new Object[]{4L, 2L} @@ -2393,7 +2388,7 @@ public void testGroupByRootSingleTypeArrayLongElementDefault() ) .expectedResults( ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 4L}, + new Object[]{null, 4L}, new Object[]{"2", 6L}, new Object[]{"3", 2L}, new Object[]{"4", 2L} @@ -2440,7 +2435,7 @@ public void testGroupByRootSingleTypeArrayStringElement() ) .expectedResults( ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 7L}, + new Object[]{null, 7L}, new Object[]{"b", 7L} ) ) @@ -2625,7 +2620,7 @@ public void testGroupByJsonValues() .build() ), ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), NullHandling.defaultStringValue(), 4L}, + new Object[]{null, null, 4L}, new Object[]{"100", "100", 2L}, new Object[]{"200", "200", 1L} ), @@ -3478,12 +3473,7 @@ public void testGroupByPathBoundFilterLongNoLowerNumeric() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() - ? ImmutableList.of( - new Object[]{"", 4L}, - new Object[]{"100", 2L} - ) - : ImmutableList.of( + ImmutableList.of( new Object[]{"100", 2L} ), RowSignature.builder() @@ -3706,12 +3696,7 @@ public void testGroupByPathBoundFilterDoubleNoLowerNumeric() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() - ? ImmutableList.of( - new Object[]{"", 4L}, - new Object[]{"2.02", 2L} - ) - : ImmutableList.of( + ImmutableList.of( new Object[]{"2.02", 2L} ), RowSignature.builder() @@ -3823,12 +3808,7 @@ public void testGroupByPathBoundFilterStringNoLower() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() - ? ImmutableList.of( - new Object[]{"", 4L}, - new Object[]{"100", 2L} - ) - : ImmutableList.of( + ImmutableList.of( new Object[]{"100", 2L} ), RowSignature.builder() @@ -4797,7 +4777,7 @@ public void testGroupByNestedArrayPath() .build() ), ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 5L}, + new Object[]{null, 5L}, new Object[]{"b", 2L} ), RowSignature.builder() @@ -5006,12 +4986,12 @@ public void testCompositionTyping() ), ImmutableList.of( new Object[]{100L}, - new Object[]{NullHandling.defaultLongValue()}, + new Object[]{null}, new Object[]{200L}, - new Object[]{NullHandling.defaultLongValue()}, - new Object[]{NullHandling.defaultLongValue()}, + new Object[]{null}, + new Object[]{null}, new Object[]{100L}, - new Object[]{NullHandling.defaultLongValue()} + new Object[]{null} ), RowSignature.builder() .add("EXPR$0", ColumnType.LONG) @@ -5106,7 +5086,7 @@ public void testGroupByNegativeJsonPathIndex() .build() ), ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 5L}, + new Object[]{null, 5L}, new Object[]{"b", 2L} ), RowSignature.builder() @@ -5153,12 +5133,12 @@ public void testJsonPathNegativeIndex() ), ImmutableList.of( new Object[]{"b", "\"b\"", null}, - new Object[]{NullHandling.defaultStringValue(), null, null}, - new Object[]{NullHandling.defaultStringValue(), null, null}, - new Object[]{NullHandling.defaultStringValue(), null, null}, - new Object[]{NullHandling.defaultStringValue(), null, null}, + new Object[]{null, null, null}, + new Object[]{null, null, null}, + new Object[]{null, null, null}, + new Object[]{null, null, null}, new Object[]{"b", "\"b\"", null}, - new Object[]{NullHandling.defaultStringValue(), null, null} + new Object[]{null, null, null} ), RowSignature.builder() .add("EXPR$0", ColumnType.STRING) @@ -5319,9 +5299,9 @@ public void testGroupByPathSelectorFilterVariantNull() .build() ), ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), NullHandling.defaultLongValue(), 4L}, - new Object[]{"100", NullHandling.defaultLongValue(), 1L}, - new Object[]{"200", NullHandling.defaultLongValue(), 1L} + new Object[]{null, null, 4L}, + new Object[]{"100", null, 1L}, + new Object[]{"200", null, 1L} ), RowSignature.builder() .add("EXPR$0", ColumnType.STRING) @@ -5356,11 +5336,11 @@ public void testSelectPathSelectorFilterVariantNull() ), ImmutableList.of( new Object[]{"100", null}, - new Object[]{NullHandling.defaultStringValue(), null}, + new Object[]{null, null}, new Object[]{"200", null}, - new Object[]{NullHandling.defaultStringValue(), null}, - new Object[]{NullHandling.defaultStringValue(), null}, - new Object[]{NullHandling.defaultStringValue(), null} + new Object[]{null, null}, + new Object[]{null, null}, + new Object[]{null, null} ), RowSignature.builder() .add("EXPR$0", ColumnType.STRING) @@ -5498,49 +5478,10 @@ public void testJoinOnNestedColumnThrows() public void testScanStringNotNullCast() { skipVectorize(); - final List expectedResults; - if (NullHandling.sqlCompatible()) { - expectedResults = ImmutableList.of( - new Object[]{10L}, - new Object[]{10L} - ); - } else { - if (isRunningMSQ()) { - expectedResults = ImmutableList.of( - new Object[]{0L}, - new Object[]{0L}, - new Object[]{0L}, - new Object[]{0L}, - new Object[]{10L}, - new Object[]{10L}, - new Object[]{0L}, - new Object[]{0L}, - new Object[]{0L}, - new Object[]{0L}, - new Object[]{0L}, - new Object[]{0L}, - new Object[]{0L}, - new Object[]{0L} - ); - } else { - expectedResults = ImmutableList.of( - new Object[]{0L}, - new Object[]{0L}, - new Object[]{10L}, - new Object[]{0L}, - new Object[]{0L}, - new Object[]{0L}, - new Object[]{0L}, - new Object[]{0L}, - new Object[]{0L}, - new Object[]{10L}, - new Object[]{0L}, - new Object[]{0L}, - new Object[]{0L}, - new Object[]{0L} - ); - } - } + final List expectedResults = ImmutableList.of( + new Object[]{10L}, + new Object[]{10L} + ); testQuery( "SELECT " + "CAST(string_sparse as BIGINT)" @@ -5593,12 +5534,7 @@ public void testGroupByRootSingleTypeStringMixed1SparseNotNullCast2() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.sqlCompatible() ? - ImmutableList.of( - new Object[]{10L, 2L} - ) : ImmutableList.of( - new Object[]{0L, 12L}, new Object[]{10L, 2L} ), RowSignature.builder() @@ -5648,7 +5584,7 @@ public void testGroupByRootSingleTypeArrayLongNullsAsMvd() ImmutableList.of( // implicit mvd unnest treats null and empty as [null] so we get extra null matches than unnest // directly on the ARRAY - new Object[]{NullHandling.defaultStringValue(), 9L}, + new Object[]{null, 9L}, new Object[]{"1", 5L}, new Object[]{"2", 6L}, new Object[]{"3", 6L}, @@ -5700,7 +5636,7 @@ public void testGroupByRootSingleTypeArrayLongNullsAsMvdWithExpression() .expectedResults( // 9 isn't present in result because arrayLong rows are null in rows of arrayLongNulls that have value 9 ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 10L}, + new Object[]{null, 10L}, new Object[]{"1", 12L}, new Object[]{"2", 7L}, new Object[]{"3", 9L}, @@ -5773,7 +5709,7 @@ public void testGroupByRootSingleTypeArrayLongNullsAsMvdFiltered() ) .expectedResults( ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 2L, 6L}, + new Object[]{null, 2L, 6L}, new Object[]{"1", 5L, 13L}, new Object[]{"2", 2L, 6L}, new Object[]{"3", 4L, 12L} @@ -5834,7 +5770,7 @@ public void testGroupByRootSingleTypeArrayLongNullsAsMvdFilteredMore() .expectedResults( // since array is converted to a MVD, implicit unnesting occurs ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 4L}, + new Object[]{null, 4L}, new Object[]{"1", 5L}, new Object[]{"2", 6L}, new Object[]{"3", 6L}, @@ -5889,7 +5825,7 @@ public void testGroupByRootSingleTypeArrayStringNullsAsMvdUnnest() .expectedResults( ImmutableList.of( // count is 9 instead of 5 because implicit unnest treats null and empty as [null] - new Object[]{NullHandling.defaultStringValue(), 9L}, + new Object[]{null, 9L}, new Object[]{"a", 3L}, new Object[]{"b", 11L}, new Object[]{"d", 2L} @@ -5961,7 +5897,7 @@ public void testGroupByRootSingleTypeArrayStringNullsFilteredAsMvd() ) .expectedResults( ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 4L, 10L}, + new Object[]{null, 4L, 10L}, new Object[]{"a", 3L, 6L}, new Object[]{"b", 11L, 24L}, new Object[]{"d", 2L, 6L} @@ -6064,275 +6000,6 @@ public void testScanAllTypesAuto() .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) .build() ), - useDefault ? - ImmutableList.of( - new Object[]{ - 1672531200000L, - "", - 0L, - 0.0D, - 1L, - "51", - -0.13D, - "1", - "[]", - "[51,-35]", - "{\"a\":700,\"b\":{\"x\":\"g\",\"y\":1.1,\"z\":[9,null,9,9]},\"v\":[]}", - "{\"x\":400,\"y\":[{\"l\":[null],\"m\":100,\"n\":5},{\"l\":[\"a\",\"b\",\"c\"],\"m\":\"a\",\"n\":1}],\"z\":{}}", - null, - "[\"a\",\"b\"]", - null, - "[2,3]", - null, - "[null]", - null, - "[1,0,1]", - null, - "[{\"x\":1},{\"x\":2}]", - "", - "hello", - 1234L, - 1.234D, - "{\"x\":1,\"y\":\"hello\",\"z\":{\"a\":1.1,\"b\":1234,\"c\":[\"a\",\"b\",\"c\"],\"d\":[]}}", - "[\"a\",\"b\",\"c\"]", - "[1,2,3]", - "[1.1,2.2,3.3]", - "[]", - "{}", - "[null,null]", - "[{},{},{}]", - "[{\"a\":\"b\",\"x\":1,\"y\":1.3}]", - 1L - }, - new Object[]{ - 1672531200000L, - "", - 2L, - 0.0D, - 0L, - "b", - 1.1D, - "\"b\"", - "2", - "b", - "{\"a\":200,\"b\":{\"x\":\"b\",\"y\":1.1,\"z\":[2,4,6]},\"v\":[]}", - "{\"x\":10,\"y\":[{\"l\":[\"b\",\"b\",\"c\"],\"m\":\"b\",\"n\":2},[1,2,3]],\"z\":{\"a\":[5.5],\"b\":false}}", - "[\"a\",\"b\",\"c\"]", - "[null,\"b\"]", - "[2,3]", - null, - "[3.3,4.4,5.5]", - "[999.0,null,5.5]", - "[null,null,2.2]", - "[1,1]", - "[null,[null],[]]", - "[{\"x\":3},{\"x\":4}]", - "", - "hello", - 1234L, - 1.234D, - "{\"x\":1,\"y\":\"hello\",\"z\":{\"a\":1.1,\"b\":1234,\"c\":[\"a\",\"b\",\"c\"],\"d\":[]}}", - "[\"a\",\"b\",\"c\"]", - "[1,2,3]", - "[1.1,2.2,3.3]", - "[]", - "{}", - "[null,null]", - "[{},{},{}]", - "[{\"a\":\"b\",\"x\":1,\"y\":1.3}]", - 1L - }, - new Object[]{ - 1672531200000L, - "a", - 1L, - 1.0D, - 1L, - "1", - 1.0D, - "1", - "1", - "1", - "{\"a\":100,\"b\":{\"x\":\"a\",\"y\":1.1,\"z\":[1,2,3,4]},\"v\":[]}", - "{\"x\":1234,\"y\":[{\"l\":[\"a\",\"b\",\"c\"],\"m\":\"a\",\"n\":1},{\"l\":[\"a\",\"b\",\"c\"],\"m\":\"a\",\"n\":1}],\"z\":{\"a\":[1.1,2.2,3.3],\"b\":true}}", - "[\"a\",\"b\"]", - "[\"a\",\"b\"]", - "[1,2,3]", - "[1,null,3]", - "[1.1,2.2,3.3]", - "[1.1,2.2,null]", - "[\"a\",\"1\",\"2.2\"]", - "[1,0,1]", - "[[1,2,null],[3,4]]", - "[{\"x\":1},{\"x\":2}]", - "", - "hello", - 1234L, - 1.234D, - "{\"x\":1,\"y\":\"hello\",\"z\":{\"a\":1.1,\"b\":1234,\"c\":[\"a\",\"b\",\"c\"],\"d\":[]}}", - "[\"a\",\"b\",\"c\"]", - "[1,2,3]", - "[1.1,2.2,3.3]", - "[]", - "{}", - "[null,null]", - "[{},{},{}]", - "[{\"a\":\"b\",\"x\":1,\"y\":1.3}]", - 1L - }, - new Object[]{ - 1672531200000L, - "b", - 4L, - 3.3D, - 1L, - "1", - 0.0D, - "{}", - "4", - "1", - "{\"a\":400,\"b\":{\"x\":\"d\",\"y\":1.1,\"z\":[3,4]},\"v\":[]}", - "{\"x\":1234,\"z\":{\"a\":[1.1,2.2,3.3],\"b\":true}}", - "[\"d\",\"e\"]", - "[\"b\",\"b\"]", - "[1,4]", - "[1]", - "[2.2,3.3,4.0]", - null, - "[\"a\",\"b\",\"c\"]", - "[null,0,1]", - "[[1,2],[3,4],[5,6,7]]", - "[{\"x\":null},{\"x\":2}]", - "", - "hello", - 1234L, - 1.234D, - "{\"x\":1,\"y\":\"hello\",\"z\":{\"a\":1.1,\"b\":1234,\"c\":[\"a\",\"b\",\"c\"],\"d\":[]}}", - "[\"a\",\"b\",\"c\"]", - "[1,2,3]", - "[1.1,2.2,3.3]", - "[]", - "{}", - "[null,null]", - "[{},{},{}]", - "[{\"a\":\"b\",\"x\":1,\"y\":1.3}]", - 1L - }, - new Object[]{ - 1672531200000L, - "c", - 0L, - 4.4D, - 1L, - "hello", - -1000.0D, - "{}", - "[]", - "hello", - "{\"a\":500,\"b\":{\"x\":\"e\",\"z\":[1,2,3,4]},\"v\":\"a\"}", - "{\"x\":11,\"y\":[],\"z\":{\"a\":[null],\"b\":false}}", - null, - null, - "[1,2,3]", - "[]", - "[1.1,2.2,3.3]", - null, - null, - "[0]", - null, - "[{\"x\":1000},{\"y\":2000}]", - "", - "hello", - 1234L, - 1.234D, - "{\"x\":1,\"y\":\"hello\",\"z\":{\"a\":1.1,\"b\":1234,\"c\":[\"a\",\"b\",\"c\"],\"d\":[]}}", - "[\"a\",\"b\",\"c\"]", - "[1,2,3]", - "[1.1,2.2,3.3]", - "[]", - "{}", - "[null,null]", - "[{},{},{}]", - "[{\"a\":\"b\",\"x\":1,\"y\":1.3}]", - 1L - }, - new Object[]{ - 1672531200000L, - "d", - 5L, - 5.9D, - 0L, - "", - 3.33D, - "\"a\"", - "6", - null, - "{\"a\":600,\"b\":{\"x\":\"f\",\"y\":1.1,\"z\":[6,7,8,9]},\"v\":\"b\"}", - null, - "[\"a\",\"b\"]", - null, - null, - "[null,2,9]", - null, - "[999.0,5.5,null]", - "[\"a\",\"1\",\"2.2\"]", - "[]", - "[[1],[1,2,null]]", - "[{\"a\":1},{\"b\":2}]", - "", - "hello", - 1234L, - 1.234D, - "{\"x\":1,\"y\":\"hello\",\"z\":{\"a\":1.1,\"b\":1234,\"c\":[\"a\",\"b\",\"c\"],\"d\":[]}}", - "[\"a\",\"b\",\"c\"]", - "[1,2,3]", - "[1.1,2.2,3.3]", - "[]", - "{}", - "[null,null]", - "[{},{},{}]", - "[{\"a\":\"b\",\"x\":1,\"y\":1.3}]", - 1L - }, - new Object[]{ - 1672531200000L, - "null", - 3L, - 2.0D, - 0L, - "3.0", - 1.0D, - "3.3", - "3", - "3.0", - "{\"a\":300}", - "{\"x\":4.4,\"y\":[{\"l\":[],\"m\":100,\"n\":3},{\"l\":[\"a\"]},{\"l\":[\"b\"],\"n\":[]}],\"z\":{\"a\":[],\"b\":true}}", - "[\"b\",\"c\"]", - "[\"d\",null,\"b\"]", - "[1,2,3,4]", - "[1,2,3]", - "[1.1,3.3]", - "[null,2.2,null]", - "[1,null,1]", - "[1,null,1]", - "[[1],null,[1,2,3]]", - "[null,{\"x\":2}]", - "", - "hello", - 1234L, - 1.234D, - "{\"x\":1,\"y\":\"hello\",\"z\":{\"a\":1.1,\"b\":1234,\"c\":[\"a\",\"b\",\"c\"],\"d\":[]}}", - "[\"a\",\"b\",\"c\"]", - "[1,2,3]", - "[1.1,2.2,3.3]", - "[]", - "{}", - "[null,null]", - "[{},{},{}]", - "[{\"a\":\"b\",\"x\":1,\"y\":1.3}]", - 1L - } - ) : ImmutableList.of( new Object[]{ 1672531200000L, @@ -6658,9 +6325,7 @@ public void testFilterJsonIsNotNull() .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) .build() ), - NullHandling.replaceWithDefault() - ? ImmutableList.of() - : ImmutableList.of( + ImmutableList.of( new Object[]{"{\"x\":100,\"y\":2.02,\"z\":\"300\",\"mixed\":1,\"mixed2\":\"1\"}"}, new Object[]{"{\"x\":200,\"y\":3.03,\"z\":\"abcdef\",\"mixed\":1.1,\"mixed2\":1}"}, new Object[]{"{\"x\":100,\"y\":2.02,\"z\":\"400\",\"mixed2\":1.1}"} @@ -6688,24 +6353,7 @@ public void testFilterJsonIsNull() .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) .build() ), - // selector filter is wrong - NullHandling.replaceWithDefault() - ? ImmutableList.of( - new Object[]{ - "{\"x\":100,\"y\":2.02,\"z\":\"300\",\"mixed\":1,\"mixed2\":\"1\"}", - "{\"array\":[\"a\",\"b\"],\"n\":{\"x\":\"hello\"}}" - }, - new Object[]{null, "\"hello\""}, - new Object[]{"{\"x\":200,\"y\":3.03,\"z\":\"abcdef\",\"mixed\":1.1,\"mixed2\":1}", null}, - new Object[]{null, null}, - new Object[]{null, null}, - new Object[]{ - "{\"x\":100,\"y\":2.02,\"z\":\"400\",\"mixed2\":1.1}", - "{\"array\":[\"a\",\"b\"],\"n\":{\"x\":1}}" - }, - new Object[]{null, "2"} - ) - : ImmutableList.of( + ImmutableList.of( new Object[]{null, "\"hello\""}, new Object[]{null, null}, new Object[]{null, null}, @@ -6748,16 +6396,14 @@ public void testCoalesceOnNestedColumns() ) .expectedResults( ImmutableList.of( - // with NullHandling.replaceWithDefault; isNull is not handled - // so COALESCE may never see `null` - new Object[]{null, 2L, NullHandling.sqlCompatible() ? 2L : 0L}, + new Object[]{null, 2L, 2L}, new Object[]{3L, 1L, 3L}, new Object[]{4L, 1L, 4L}, new Object[]{3L, 4L, 3L}, new Object[]{4L, 4L, 4L}, new Object[]{1L, 5L, 1L}, new Object[]{2L, 5L, 2L}, - new Object[]{null, 5L, NullHandling.sqlCompatible() ? 5L : 0L} + new Object[]{null, 5L, 5L} ) ) .expectedSignature( @@ -6778,21 +6424,6 @@ public void testCoalesceOnNestedColumnsLater() testQuery( "select coalesce(long,c) as col " + " from druid.all_auto, unnest(json_value(arrayNestedLong, '$[1]' returning bigint array)) as u(c) ", - useDefault ? - ImmutableList.of( - Druids.newScanQueryBuilder() - .dataSource(UnnestDataSource.create( - new TableDataSource(DATA_SOURCE_ALL), - new NestedFieldVirtualColumn("arrayNestedLong", "$[1]", "j0.unnest", ColumnType.LONG_ARRAY), - null - )) - .intervals(querySegmentSpec(Filtration.eternity())) - .columns("long") - .columnTypes(ColumnType.LONG) - .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) - .context(QUERY_CONTEXT_DEFAULT) - .build() - ) : ImmutableList.of( Druids.newScanQueryBuilder() .dataSource(UnnestDataSource.create( @@ -6855,7 +6486,7 @@ public void testGroupByPathDynamicArg() .build() ), ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 4L}, + new Object[]{null, 4L}, new Object[]{"100", 2L}, new Object[]{"200", 1L} ), @@ -6992,8 +6623,7 @@ public void testJsonQueryArrayNullArray() ) ) .expectedResults( - NullHandling.replaceWithDefault() ? - ImmutableList.of(new Object[]{null}) : ImmutableList.of() + ImmutableList.of() ) .expectedSignature( RowSignature.builder() @@ -7115,7 +6745,7 @@ public void testUnnestJsonQueryArraysJsonValue() ) .expectedResults( ImmutableList.of( - new Object[]{NullHandling.defaultLongValue(), 10L}, + new Object[]{null, 10L}, new Object[]{1L, 4L}, new Object[]{2L, 8L}, new Object[]{3L, 2L}, @@ -7249,15 +6879,13 @@ public void testNvlJsonValueDoubleMissingColumn() ), expressionVirtualColumn("v2", "notnull(nvl(\"v1\",1.0))", ColumnType.LONG) ) - .filters(range("v0", ColumnType.LONG, NullHandling.sqlCompatible() ? 0.0 : "0", null, true, false)) + .filters(range("v0", ColumnType.LONG, 0.0, null, true, false)) .limit(1) .columns("v1", "v0", "v2") .columnTypes(ColumnType.DOUBLE, ColumnType.DOUBLE, ColumnType.LONG) .build() ), - NullHandling.sqlCompatible() - ? ImmutableList.of(new Object[]{null, 1.0, true}) - : ImmutableList.of(), + ImmutableList.of(new Object[]{null, 1.0, true}), RowSignature.builder() .add("EXPR$0", ColumnType.DOUBLE) .add("EXPR$1", ColumnType.DOUBLE) @@ -7290,8 +6918,7 @@ public void testNvlJsonValueDoubleSometimesMissing() .columnTypes(ColumnType.DOUBLE, ColumnType.DOUBLE, ColumnType.LONG, ColumnType.LONG) .build() ), - NullHandling.sqlCompatible() - ? ImmutableList.of( + ImmutableList.of( new Object[]{2.02, 2.02, true, false}, new Object[]{null, 1.0, true, true}, new Object[]{3.03, 3.03, true, false}, @@ -7299,15 +6926,6 @@ public void testNvlJsonValueDoubleSometimesMissing() new Object[]{null, 1.0, true, true}, new Object[]{2.02, 2.02, true, false}, new Object[]{null, 1.0, true, true} - ) - : ImmutableList.of( - new Object[]{2.02, 2.02, true, false}, - new Object[]{null, 0.0, false, false}, - new Object[]{3.03, 3.03, true, false}, - new Object[]{null, 0.0, false, false}, - new Object[]{null, 0.0, false, false}, - new Object[]{2.02, 2.02, true, false}, - new Object[]{null, 0.0, false, false} ), RowSignature.builder() .add("EXPR$0", ColumnType.DOUBLE) @@ -7337,13 +6955,12 @@ public void testNvlJsonValueDoubleSometimesMissingRangeFilter() new NestedFieldVirtualColumn("nest", "$.y", "v1", ColumnType.DOUBLE), expressionVirtualColumn("v2", "notnull(nvl(\"v1\",1.0))", ColumnType.LONG) ) - .filters(range("v0", ColumnType.LONG, NullHandling.sqlCompatible() ? 0.0 : "0", null, true, false)) + .filters(range("v0", ColumnType.LONG, 0.0, null, true, false)) .columns("v1", "v0", "v2") .columnTypes(ColumnType.DOUBLE, ColumnType.DOUBLE, ColumnType.LONG) .build() ), - NullHandling.sqlCompatible() - ? ImmutableList.of( + ImmutableList.of( new Object[]{2.02, 2.02, true}, new Object[]{null, 1.0, true}, new Object[]{3.03, 3.03, true}, @@ -7351,11 +6968,6 @@ public void testNvlJsonValueDoubleSometimesMissingRangeFilter() new Object[]{null, 1.0, true}, new Object[]{2.02, 2.02, true}, new Object[]{null, 1.0, true} - ) - : ImmutableList.of( - new Object[]{2.02, 2.02, true}, - new Object[]{3.03, 3.03, true}, - new Object[]{2.02, 2.02, true} ), RowSignature.builder() .add("EXPR$0", ColumnType.DOUBLE) @@ -7416,14 +7028,12 @@ public void testNvlJsonValueDoubleSometimesMissingEqualityFilter() .columnTypes(ColumnType.DOUBLE, ColumnType.DOUBLE, ColumnType.LONG) .build() ), - NullHandling.sqlCompatible() - ? ImmutableList.of( + ImmutableList.of( new Object[]{null, 1.0, true}, new Object[]{null, 1.0, true}, new Object[]{null, 1.0, true}, new Object[]{null, 1.0, true} - ) - : ImmutableList.of(), + ), RowSignature.builder() .add("EXPR$0", ColumnType.DOUBLE) .add("EXPR$1", ColumnType.DOUBLE) @@ -7435,27 +7045,15 @@ public void testNvlJsonValueDoubleSometimesMissingEqualityFilter() @Test public void testGroupByAutoString() { - final List expected; - if (NullHandling.sqlCompatible()) { - expected = ImmutableList.of( - new Object[]{null, 1L}, - new Object[]{"", 1L}, - new Object[]{"a", 1L}, - new Object[]{"b", 1L}, - new Object[]{"c", 1L}, - new Object[]{"d", 1L}, - new Object[]{"null", 1L} - ); - } else { - expected = ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 2L}, - new Object[]{"a", 1L}, - new Object[]{"b", 1L}, - new Object[]{"c", 1L}, - new Object[]{"d", 1L}, - new Object[]{"null", 1L} - ); - } + final List expected = ImmutableList.of( + new Object[]{null, 1L}, + new Object[]{"", 1L}, + new Object[]{"a", 1L}, + new Object[]{"b", 1L}, + new Object[]{"c", 1L}, + new Object[]{"d", 1L}, + new Object[]{"null", 1L} + ); testQuery( "SELECT " + "str, " @@ -7515,7 +7113,7 @@ public void testGroupByAutoString() public void testGroupByAutoLong() { final List expected = ImmutableList.of( - new Object[]{NullHandling.defaultLongValue(), 2L}, + new Object[]{null, 2L}, new Object[]{1L, 1L}, new Object[]{2L, 1L}, new Object[]{3L, 1L}, @@ -7581,7 +7179,7 @@ public void testGroupByAutoLong() public void testGroupByAutoDouble() { final List expected = ImmutableList.of( - new Object[]{NullHandling.defaultDoubleValue(), 2L}, + new Object[]{null, 2L}, new Object[]{1.0D, 1L}, new Object[]{2.0D, 1L}, new Object[]{3.3D, 1L}, @@ -7666,7 +7264,7 @@ public void testToJsonString() .build() ), ImmutableList.of( - new Object[]{NullHandling.defaultStringValue()}, + new Object[]{null}, new Object[]{"\"hello\""}, new Object[]{"2"}, new Object[]{"{\"array\":[\"a\",\"b\"],\"n\":{\"x\":\"hello\"}}"}, diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteParameterQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteParameterQueryTest.java index a023e731e58c..154c8bd41888 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteParameterQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteParameterQueryTest.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableList; import org.apache.calcite.avatica.SqlType; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; import org.apache.druid.error.DruidExceptionMatcher; import org.apache.druid.java.util.common.DateTimes; @@ -34,7 +33,6 @@ import org.apache.druid.query.aggregation.FilteredAggregatorFactory; import org.apache.druid.query.dimension.DefaultDimensionSpec; import org.apache.druid.query.groupby.GroupByQuery; -import org.apache.druid.query.ordering.StringComparators; import org.apache.druid.query.scan.ScanQuery; import org.apache.druid.query.scan.ScanQuery.ResultFormat; import org.apache.druid.segment.column.ColumnType; @@ -127,7 +125,7 @@ public void testParametersInSelectAndFilter() ImmutableList.of(Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE1) .intervals(querySegmentSpec(Filtration.eternity())) - .filters(numericEquality("dim2", 0L, ColumnType.LONG)) + .filters(equality("dim2", 0L, ColumnType.LONG)) .granularity(Granularities.ALL) .aggregators(aggregators( new CountAggregatorFactory("a0"), @@ -139,7 +137,7 @@ public void testParametersInSelectAndFilter() .context(QUERY_CONTEXT_DEFAULT) .build()), ImmutableList.of( - new Object[]{11.0, NullHandling.defaultDoubleValue()} + new Object[]{11.0, null} ) ); } @@ -256,7 +254,7 @@ public void testParamsInSelectExpressionAndLimit() ), ImmutableList.of( new Object[]{"a"}, - new Object[]{NULL_STRING} + new Object[]{null} ), ImmutableList.of( new SqlParameter(SqlType.INTEGER, 1), @@ -285,11 +283,6 @@ public void testParamsTuckedInACast() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{"", 1.0f, 1L}, - new Object[]{"2", 3.0f, 1L} - ) : ImmutableList.of( new Object[]{"2", 3.0f, 1L} ), @@ -329,14 +322,7 @@ public void testParametersInStrangePlaces() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() - ? ImmutableList.of( - new Object[]{"10.1", 1L}, - new Object[]{"2", 1L}, - new Object[]{"abc", 1L}, - new Object[]{"def", 1L} - ) - : ImmutableList.of( + ImmutableList.of( new Object[]{"2", 1L}, new Object[]{"def", 1L} ), @@ -413,7 +399,7 @@ public void testTimestamp() .context(QUERY_CONTEXT_DEFAULT) .build()), ImmutableList.of( - new Object[]{11.0, NullHandling.defaultDoubleValue()} + new Object[]{11.0, null} ) ); @@ -450,7 +436,7 @@ public void testTimestampString() .context(QUERY_CONTEXT_DEFAULT) .build()), ImmutableList.of( - new Object[]{11.0, NullHandling.defaultDoubleValue()} + new Object[]{11.0, null} ) ); } @@ -487,7 +473,7 @@ public void testDate() .context(QUERY_CONTEXT_DEFAULT) .build()), ImmutableList.of( - new Object[]{11.0, NullHandling.defaultDoubleValue()} + new Object[]{11.0, null} ) ); } @@ -503,9 +489,7 @@ public void testDoubles() .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) .filters( - NullHandling.replaceWithDefault() - ? bound("cnt", "1.1", "100000001", true, true, null, StringComparators.NUMERIC) - : range("cnt", ColumnType.DOUBLE, 1.1, 100000001.0, true, true) + range("cnt", ColumnType.DOUBLE, 1.1, 100000001.0, true, true) ) .aggregators(aggregators(new CountAggregatorFactory("a0"))) .context(QUERY_CONTEXT_DEFAULT) @@ -527,9 +511,7 @@ public void testDoubles() .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) .filters( - NullHandling.replaceWithDefault() - ? in("cnt", ImmutableList.of("1.0", "100000001")) - : in("cnt", ColumnType.DOUBLE, ImmutableList.of(1.0, 1.00000001E8)) + in("cnt", ColumnType.DOUBLE, ImmutableList.of(1.0, 1.00000001E8)) ) .aggregators(aggregators(new CountAggregatorFactory("a0"))) .context(QUERY_CONTEXT_DEFAULT) @@ -658,23 +640,7 @@ public void testWrongTypeParameter() "SELECT COUNT(*)\n" + "FROM druid.numfoo\n" + "WHERE l1 > ? AND f1 = ?", - useDefault - ? ImmutableList.of( - Druids.newTimeseriesQueryBuilder() - .dataSource(CalciteTests.DATASOURCE3) - .intervals(querySegmentSpec(Filtration.eternity())) - .granularity(Granularities.ALL) - .filters( - and( - bound("l1", "3", null, true, false, null, StringComparators.NUMERIC), - selector("f1", "0.0", null) - ) - ) - .aggregators(aggregators(new CountAggregatorFactory("a0"))) - .context(QUERY_CONTEXT_DEFAULT) - .build() - ) - : ImmutableList.of( + ImmutableList.of( Druids.newScanQueryBuilder() .dataSource( InlineDataSource.fromIterable( @@ -722,12 +688,6 @@ public void testNullParameter() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{"a", 2L}, - new Object[]{"abc", 1L}, - new Object[]{"parameter", 3L} - ) : ImmutableList.of( new Object[]{"", 1L}, new Object[]{"a", 2L}, @@ -757,12 +717,6 @@ public void testNullParameter() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{"a", 2L}, - new Object[]{"abc", 1L}, - new Object[]{"parameter", 3L} - ) : ImmutableList.of( new Object[]{"", 1L}, new Object[]{"a", 2L}, diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java index ed5fbe7c2069..4323d7d54314 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java @@ -23,11 +23,8 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; import org.apache.calcite.rel.RelNode; import org.apache.calcite.runtime.CalciteContextException; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.HumanReadableBytes; @@ -140,7 +137,6 @@ import org.joda.time.Period; import org.junit.Assert; import org.junit.internal.matchers.ThrowableMessageMatcher; -import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -156,8 +152,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assumptions.assumeFalse; -import static org.junit.jupiter.api.Assumptions.assumeTrue; public class CalciteQueryTest extends BaseCalciteQueryTest { @@ -279,9 +273,9 @@ public void testInformationSchemaColumnsOnTable() new Object[]{"dim1", "VARCHAR", "YES"}, new Object[]{"dim2", "VARCHAR", "YES"}, new Object[]{"dim3", "VARCHAR", "YES"}, - new Object[]{"cnt", "BIGINT", useDefault ? "NO" : "YES"}, - new Object[]{"m1", "FLOAT", useDefault ? "NO" : "YES"}, - new Object[]{"m2", "DOUBLE", useDefault ? "NO" : "YES"}, + new Object[]{"cnt", "BIGINT", "YES"}, + new Object[]{"m1", "FLOAT", "YES"}, + new Object[]{"m2", "DOUBLE", "YES"}, new Object[]{"unique_dim1", "COMPLEX", "YES"} ) ); @@ -310,9 +304,9 @@ public void testInformationSchemaColumnsOnForbiddenTable() new Object[]{"__time", "TIMESTAMP", "NO"}, new Object[]{"dim1", "VARCHAR", "YES"}, new Object[]{"dim2", "VARCHAR", "YES"}, - new Object[]{"cnt", "BIGINT", useDefault ? "NO" : "YES"}, - new Object[]{"m1", "FLOAT", useDefault ? "NO" : "YES"}, - new Object[]{"m2", "DOUBLE", useDefault ? "NO" : "YES"}, + new Object[]{"cnt", "BIGINT", "YES"}, + new Object[]{"m1", "FLOAT", "YES"}, + new Object[]{"m2", "DOUBLE", "YES"}, new Object[]{"unique_dim1", "COMPLEX", "YES"} ) ); @@ -345,7 +339,7 @@ public void testInformationSchemaColumnsOnAnotherView() ImmutableList.of( new Object[]{"dim1_firstchar", "VARCHAR", "YES"}, new Object[]{"dim2", "VARCHAR", "YES"}, - new Object[]{"l2", "BIGINT", useDefault ? "NO" : "YES"} + new Object[]{"l2", "BIGINT", "YES"} ) ); } @@ -458,18 +452,10 @@ public void testNonExistentSchemaOnInformationSchemaRoutines() public void testTopNLimitWrapping() { msqIncompatible(); - List expected; - if (NullHandling.replaceWithDefault()) { - expected = ImmutableList.of( - new Object[]{"", 1L}, - new Object[]{"def", 1L} - ); - } else { - expected = ImmutableList.of( - new Object[]{"def", 1L}, - new Object[]{"abc", 1L} - ); - } + List expected = ImmutableList.of( + new Object[]{"def", 1L}, + new Object[]{"abc", 1L} + ); testQuery( "SELECT dim1, COUNT(*) FROM druid.foo GROUP BY dim1 ORDER BY dim1 DESC", OUTER_LIMIT_CONTEXT, @@ -516,18 +502,10 @@ public void testTopNLimitWrappingOrderByAgg() @Test public void testGroupByLimitWrapping() { - List expected; - if (NullHandling.replaceWithDefault()) { - expected = ImmutableList.of( - new Object[]{"def", "abc", 1L}, - new Object[]{"abc", "", 1L} - ); - } else { - expected = ImmutableList.of( - new Object[]{"def", "abc", 1L}, - new Object[]{"abc", null, 1L} - ); - } + List expected = ImmutableList.of( + new Object[]{"def", "abc", 1L}, + new Object[]{"abc", null, 1L} + ); testQuery( "SELECT dim1, dim2, COUNT(*) FROM druid.foo GROUP BY dim1, dim2 ORDER BY dim1 DESC", OUTER_LIMIT_CONTEXT, @@ -1138,19 +1116,12 @@ public void testAnyAggregatorsOffHeapNumericNulls() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - - NullHandling.sqlCompatible() - ? ImmutableList.of( + ImmutableList.of( new Object[]{325323L, 1.7, 0.1f}, new Object[]{0L, 0.0, 0.0f}, new Object[]{7L, 1.0, 1.0f}, new Object[]{null, null, null} ) - : ImmutableList.of( - new Object[]{325323L, 1.7, 0.1f}, - new Object[]{7L, 1.0, 1.0f}, - new Object[]{0L, 0.0, 0.0f} - ) ); } @@ -1197,9 +1168,7 @@ public void testPrimitiveLatestInSubquery() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.sqlCompatible() - ? ImmutableList.of(new Object[]{18.0, 4L, 18.0}) - : ImmutableList.of(new Object[]{15.0, 3L, 15.0}) + ImmutableList.of(new Object[]{18.0, 4L, 18.0}) ); } @@ -1222,19 +1191,12 @@ public void testPrimitiveLatestInSubqueryGroupBy() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.sqlCompatible() - ? ImmutableList.of( + ImmutableList.of( new Object[]{null, 6.0f}, new Object[]{"", 3.0f}, new Object[]{"a", 4.0f}, new Object[]{"abc", 5.0f} ) - : ImmutableList.of( - new Object[]{"", 6.0f}, - new Object[]{"a", 4.0f}, - new Object[]{"abc", 5.0f} - - ) ); } @@ -1256,18 +1218,12 @@ public void testStringLatestGroupBy() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.sqlCompatible() - ? ImmutableList.of( + ImmutableList.of( new Object[]{null, "b"}, new Object[]{"", "a"}, new Object[]{"a", "b"}, new Object[]{"abc", "b"} ) - : ImmutableList.of( - new Object[]{"", "b"}, - new Object[]{"a", "b"}, - new Object[]{"abc", "b"} - ) ); } @@ -1432,9 +1388,7 @@ public void testPrimitiveEarliestInSubquery() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.sqlCompatible() - ? ImmutableList.of(new Object[]{11.0, 4L, 11.0}) - : ImmutableList.of(new Object[]{8.0, 3L, 8.0}) + ImmutableList.of(new Object[]{11.0, 4L, 11.0}) ); } @@ -1481,7 +1435,7 @@ public void testStringLatestInSubquery() .build() ), ImmutableList.of( - new Object[]{NullHandling.sqlCompatible() ? 3 : 1.0} + new Object[]{3.0} ) ); } @@ -1538,7 +1492,7 @@ public void testStringEarliestInSubquery() //[, 2] //[a, ] //[abc, def] - new Object[]{NullHandling.sqlCompatible() ? 12.1 : 10.1} + new Object[]{12.1} ) ); } @@ -1591,9 +1545,7 @@ public void testPrimitiveAnyInSubquery() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.sqlCompatible() - ? ImmutableList.of(new Object[]{11.0, 4L, 11.0}) - : ImmutableList.of(new Object[]{8.0, 3L, 8.0}) + ImmutableList.of(new Object[]{11.0, 4L, 11.0}) ); } @@ -1617,16 +1569,11 @@ public void testStringEarliestSingleStringDim() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.sqlCompatible() ? ImmutableList.of( new Object[]{null, "10.1"}, new Object[]{"", "2"}, new Object[]{"a", ""}, new Object[]{"abc", "def"} - ) : ImmutableList.of( - new Object[]{"", "10.1"}, - new Object[]{"a", ""}, - new Object[]{"abc", "def"} ) ); } @@ -1651,16 +1598,11 @@ public void testStringEarliestMultiStringDim() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.sqlCompatible() ? ImmutableList.of( new Object[]{null, "[b, c]"}, new Object[]{"", "d"}, new Object[]{"a", "[a, b]"}, new Object[]{"abc", null} - ) : ImmutableList.of( - new Object[]{"", "[b, c]"}, - new Object[]{"a", "[a, b]"}, - new Object[]{"abc", ""} ) ); } @@ -1707,7 +1649,7 @@ public void testStringAnyInSubquery() .build() ), ImmutableList.of( - new Object[]{NullHandling.sqlCompatible() ? 12.1 : 10.1} + new Object[]{12.1} ) ); } @@ -1760,11 +1702,7 @@ public void testLatestAggregatorsNumericNull() .build() ), ImmutableList.of( - new Object[]{ - NullHandling.defaultLongValue(), - NullHandling.defaultDoubleValue(), - NullHandling.defaultFloatValue() - } + new Object[]{null, null, null} ) ); } @@ -1772,17 +1710,12 @@ public void testLatestAggregatorsNumericNull() @Test public void testFirstLatestAggregatorsSkipNulls() { - final DimFilter filter; - if (useDefault) { - filter = notNull("dim1"); - } else { - filter = and( - notNull("dim1"), - notNull("l1"), - notNull("dbl1"), - notNull("f1") - ); - } + final DimFilter filter = and( + notNull("dim1"), + notNull("l1"), + notNull("dbl1"), + notNull("f1") + ); testQuery( "SELECT EARLIEST(dim1, 32), LATEST(l1), LATEST(dbl1), LATEST(f1) " + "FROM druid.numfoo " @@ -1805,8 +1738,7 @@ public void testFirstLatestAggregatorsSkipNulls() .build() ), ImmutableList.of( - // first row of dim1 is empty string, which is null in default mode, last non-null numeric rows are zeros - new Object[]{useDefault ? "10.1" : "", 0L, 0.0, 0.0f} + new Object[]{"", 0L, 0.0, 0.0f} ) ); } @@ -1832,9 +1764,8 @@ public void testAnyAggregatorsDoesNotSkipNulls() .context(QUERY_CONTEXT_DEFAULT) .build() ), - // first row has null for l2, d2, f2 and dim1 as empty string (which is null in default mode) ImmutableList.of( - useDefault ? new Object[]{"", 0L, 0.0, 0f} : new Object[]{"", null, null, null} + new Object[]{"", null, null, null} ) ); } @@ -1842,17 +1773,12 @@ public void testAnyAggregatorsDoesNotSkipNulls() @Test public void testAnyAggregatorsSkipNullsWithFilter() { - final DimFilter filter; - if (useDefault) { - filter = notNull("dim1"); - } else { - filter = and( - notNull("dim1"), - notNull("l2"), - notNull("dbl2"), - notNull("f2") - ); - } + final DimFilter filter = and( + notNull("dim1"), + notNull("l2"), + notNull("dbl2"), + notNull("f2") + ); testQuery( "SELECT ANY_VALUE(dim1, 32), ANY_VALUE(l2), ANY_VALUE(dbl2), ANY_VALUE(f2) " + "FROM druid.numfoo " @@ -1884,26 +1810,14 @@ public void testAnyAggregatorsSkipNullsWithFilter() @Test public void testOrderByEarliestFloat() { - List expected; - if (NullHandling.replaceWithDefault()) { - expected = ImmutableList.of( - new Object[]{"1", 0.0f}, - new Object[]{"2", 0.0f}, - new Object[]{"abc", 0.0f}, - new Object[]{"def", 0.0f}, - new Object[]{"10.1", 0.1f}, - new Object[]{"", 1.0f} - ); - } else { - expected = ImmutableList.of( - new Object[]{"1", null}, - new Object[]{"abc", null}, - new Object[]{"def", null}, - new Object[]{"2", 0.0f}, - new Object[]{"10.1", 0.1f}, - new Object[]{"", 1.0f} - ); - } + List expected = ImmutableList.of( + new Object[]{"1", null}, + new Object[]{"abc", null}, + new Object[]{"def", null}, + new Object[]{"2", 0.0f}, + new Object[]{"10.1", 0.1f}, + new Object[]{"", 1.0f} + ); testQuery( "SELECT dim1, EARLIEST(f1) FROM druid.numfoo GROUP BY 1 ORDER BY 2 LIMIT 10", ImmutableList.of( @@ -1929,26 +1843,14 @@ public void testOrderByEarliestFloat() @Test public void testOrderByEarliestDouble() { - List expected; - if (NullHandling.replaceWithDefault()) { - expected = ImmutableList.of( - new Object[]{"1", 0.0}, - new Object[]{"2", 0.0}, - new Object[]{"abc", 0.0}, - new Object[]{"def", 0.0}, - new Object[]{"", 1.0}, - new Object[]{"10.1", 1.7} - ); - } else { - expected = ImmutableList.of( - new Object[]{"1", null}, - new Object[]{"abc", null}, - new Object[]{"def", null}, - new Object[]{"2", 0.0}, - new Object[]{"", 1.0}, - new Object[]{"10.1", 1.7} - ); - } + List expected = ImmutableList.of( + new Object[]{"1", null}, + new Object[]{"abc", null}, + new Object[]{"def", null}, + new Object[]{"2", 0.0}, + new Object[]{"", 1.0}, + new Object[]{"10.1", 1.7} + ); testQuery( "SELECT dim1, EARLIEST(dbl1) FROM druid.numfoo GROUP BY 1 ORDER BY 2 LIMIT 10", ImmutableList.of( @@ -1974,26 +1876,14 @@ public void testOrderByEarliestDouble() @Test public void testOrderByEarliestLong() { - List expected; - if (NullHandling.replaceWithDefault()) { - expected = ImmutableList.of( - new Object[]{"1", 0L}, - new Object[]{"2", 0L}, - new Object[]{"abc", 0L}, - new Object[]{"def", 0L}, - new Object[]{"", 7L}, - new Object[]{"10.1", 325323L} - ); - } else { - expected = ImmutableList.of( - new Object[]{"1", null}, - new Object[]{"abc", null}, - new Object[]{"def", null}, - new Object[]{"2", 0L}, - new Object[]{"", 7L}, - new Object[]{"10.1", 325323L} - ); - } + List expected = ImmutableList.of( + new Object[]{"1", null}, + new Object[]{"abc", null}, + new Object[]{"def", null}, + new Object[]{"2", 0L}, + new Object[]{"", 7L}, + new Object[]{"10.1", 325323L} + ); testQuery( "SELECT dim1, EARLIEST(l1) FROM druid.numfoo GROUP BY 1 ORDER BY 2 LIMIT 10", ImmutableList.of( @@ -2020,26 +1910,14 @@ public void testOrderByEarliestLong() public void testOrderByLatestFloat() { msqIncompatible(); - List expected; - if (NullHandling.replaceWithDefault()) { - expected = ImmutableList.of( - new Object[]{"1", 0.0f}, - new Object[]{"2", 0.0f}, - new Object[]{"abc", 0.0f}, - new Object[]{"def", 0.0f}, - new Object[]{"10.1", 0.1f}, - new Object[]{"", 1.0f} - ); - } else { - expected = ImmutableList.of( - new Object[]{"1", null}, - new Object[]{"abc", null}, - new Object[]{"def", null}, - new Object[]{"2", 0.0f}, - new Object[]{"10.1", 0.1f}, - new Object[]{"", 1.0f} - ); - } + List expected = ImmutableList.of( + new Object[]{"1", null}, + new Object[]{"abc", null}, + new Object[]{"def", null}, + new Object[]{"2", 0.0f}, + new Object[]{"10.1", 0.1f}, + new Object[]{"", 1.0f} + ); testQuery( "SELECT dim1, LATEST(f1) FROM druid.numfoo GROUP BY 1 ORDER BY 2 LIMIT 10", @@ -2067,26 +1945,14 @@ public void testOrderByLatestFloat() public void testOrderByLatestDouble() { msqIncompatible(); - List expected; - if (NullHandling.replaceWithDefault()) { - expected = ImmutableList.of( - new Object[]{"1", 0.0}, - new Object[]{"2", 0.0}, - new Object[]{"abc", 0.0}, - new Object[]{"def", 0.0}, - new Object[]{"", 1.0}, - new Object[]{"10.1", 1.7} - ); - } else { - expected = ImmutableList.of( - new Object[]{"1", null}, - new Object[]{"abc", null}, - new Object[]{"def", null}, - new Object[]{"2", 0.0}, - new Object[]{"", 1.0}, - new Object[]{"10.1", 1.7} - ); - } + List expected = ImmutableList.of( + new Object[]{"1", null}, + new Object[]{"abc", null}, + new Object[]{"def", null}, + new Object[]{"2", 0.0}, + new Object[]{"", 1.0}, + new Object[]{"10.1", 1.7} + ); testQuery( "SELECT dim1, LATEST(dbl1) FROM druid.numfoo GROUP BY 1 ORDER BY 2 LIMIT 10", ImmutableList.of( @@ -2113,26 +1979,14 @@ public void testOrderByLatestDouble() public void testOrderByLatestLong() { msqIncompatible(); - List expected; - if (NullHandling.replaceWithDefault()) { - expected = ImmutableList.of( - new Object[]{"1", 0L}, - new Object[]{"2", 0L}, - new Object[]{"abc", 0L}, - new Object[]{"def", 0L}, - new Object[]{"", 7L}, - new Object[]{"10.1", 325323L} - ); - } else { - expected = ImmutableList.of( - new Object[]{"1", null}, - new Object[]{"abc", null}, - new Object[]{"def", null}, - new Object[]{"2", 0L}, - new Object[]{"", 7L}, - new Object[]{"10.1", 325323L} - ); - } + List expected = ImmutableList.of( + new Object[]{"1", null}, + new Object[]{"abc", null}, + new Object[]{"def", null}, + new Object[]{"2", 0L}, + new Object[]{"", 7L}, + new Object[]{"10.1", 325323L} + ); testQuery( "SELECT dim1, LATEST(l1) FROM druid.numfoo GROUP BY 1 ORDER BY 2 LIMIT 10", ImmutableList.of( @@ -2158,31 +2012,19 @@ public void testOrderByLatestLong() @Test public void testOrderByAnyFloat() { - List expected; - if (NullHandling.replaceWithDefault()) { - expected = ImmutableList.of( - new Object[]{"1", 0.0f}, - new Object[]{"2", 0.0f}, - new Object[]{"abc", 0.0f}, - new Object[]{"def", 0.0f}, - new Object[]{"10.1", 0.1f}, - new Object[]{"", 1.0f} - ); - } else { - // Disabled test in MSQ with SQL-compatible mode till https://github.com/apache/druid/issues/13951 is resolved - msqIncompatible(); - - expected = ImmutableList.of( - new Object[]{"2", 0.0f}, - new Object[]{"10.1", 0.1f}, - new Object[]{"", 1.0f}, - // Nulls are last because of the null first wrapped Comparator in InvertedTopNMetricSpec which is then - // reversed by TopNNumericResultBuilder.build() - new Object[]{"1", null}, - new Object[]{"abc", null}, - new Object[]{"def", null} - ); - } + // Disabled test in MSQ with SQL-compatible mode till https://github.com/apache/druid/issues/13951 is resolved + msqIncompatible(); + + List expected = ImmutableList.of( + new Object[]{"2", 0.0f}, + new Object[]{"10.1", 0.1f}, + new Object[]{"", 1.0f}, + // Nulls are last because of the null first wrapped Comparator in InvertedTopNMetricSpec which is then + // reversed by TopNNumericResultBuilder.build() + new Object[]{"1", null}, + new Object[]{"abc", null}, + new Object[]{"def", null} + ); testQuery( "SELECT dim1, ANY_VALUE(f1) FROM druid.numfoo GROUP BY 1 ORDER BY 2 LIMIT 10", @@ -2209,31 +2051,18 @@ public void testOrderByAnyFloat() @Test public void testOrderByAnyDouble() { - List expected; - if (NullHandling.replaceWithDefault()) { - expected = ImmutableList.of( - new Object[]{"1", 0.0}, - new Object[]{"2", 0.0}, - new Object[]{"abc", 0.0}, - new Object[]{"def", 0.0}, - new Object[]{"", 1.0}, - new Object[]{"10.1", 1.7} - ); - } else { - // Disabled test in MSQ with SQL-compatible mode till https://github.com/apache/druid/issues/13951 is resolved - msqIncompatible(); - - expected = ImmutableList.of( - new Object[]{"2", 0.0}, - new Object[]{"", 1.0}, - new Object[]{"10.1", 1.7}, - // Nulls are last because of the null first wrapped Comparator in InvertedTopNMetricSpec which is then - // reversed by TopNNumericResultBuilder.build() - new Object[]{"1", null}, - new Object[]{"abc", null}, - new Object[]{"def", null} - ); - } + // Disabled test in MSQ with SQL-compatible mode till https://github.com/apache/druid/issues/13951 is resolved + msqIncompatible(); + List expected = ImmutableList.of( + new Object[]{"2", 0.0}, + new Object[]{"", 1.0}, + new Object[]{"10.1", 1.7}, + // Nulls are last because of the null first wrapped Comparator in InvertedTopNMetricSpec which is then + // reversed by TopNNumericResultBuilder.build() + new Object[]{"1", null}, + new Object[]{"abc", null}, + new Object[]{"def", null} + ); testQuery( "SELECT dim1, ANY_VALUE(dbl1) FROM druid.numfoo GROUP BY 1 ORDER BY 2 LIMIT 10", ImmutableList.of( @@ -2259,31 +2088,19 @@ public void testOrderByAnyDouble() @Test public void testOrderByAnyLong() { - List expected; - if (NullHandling.replaceWithDefault()) { - expected = ImmutableList.of( - new Object[]{"1", 0L}, - new Object[]{"2", 0L}, - new Object[]{"abc", 0L}, - new Object[]{"def", 0L}, - new Object[]{"", 7L}, - new Object[]{"10.1", 325323L} - ); - } else { - // Disabled test in MSQ with SQL-compatible mode till https://github.com/apache/druid/issues/13951 is resolved - msqIncompatible(); - - expected = ImmutableList.of( - new Object[]{"2", 0L}, - new Object[]{"", 7L}, - new Object[]{"10.1", 325323L}, - // Nulls are last because of the null first wrapped Comparator in InvertedTopNMetricSpec which is then - // reversed by TopNNumericResultBuilder.build() - new Object[]{"1", null}, - new Object[]{"abc", null}, - new Object[]{"def", null} - ); - } + // Disabled test in MSQ with SQL-compatible mode till https://github.com/apache/druid/issues/13951 is resolved + msqIncompatible(); + + List expected = ImmutableList.of( + new Object[]{"2", 0L}, + new Object[]{"", 7L}, + new Object[]{"10.1", 325323L}, + // Nulls are last because of the null first wrapped Comparator in InvertedTopNMetricSpec which is then + // reversed by TopNNumericResultBuilder.build() + new Object[]{"1", null}, + new Object[]{"abc", null}, + new Object[]{"def", null} + ); testQuery( "SELECT dim1, ANY_VALUE(l1) FROM druid.numfoo GROUP BY 1 ORDER BY 2 LIMIT 10", ImmutableList.of( @@ -2579,9 +2396,7 @@ public void testHavingOnGrandTotal() .setAggregatorSpecs(aggregators(new DoubleSumAggregatorFactory("a0", "m1"))) .setHavingSpec( having( - NullHandling.replaceWithDefault() - ? selector("a0", "21") - : equality("a0", 21.0, ColumnType.DOUBLE) + equality("a0", 21.0, ColumnType.DOUBLE) ) ) .setContext(QUERY_CONTEXT_DEFAULT) @@ -2669,11 +2484,6 @@ public void testHavingOnApproximateCountDistinct() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{"", 3L}, - new Object[]{"a", 2L} - ) : ImmutableList.of( new Object[]{null, 2L}, new Object[]{"a", 2L} @@ -2711,9 +2521,7 @@ public void testHavingOnExactCountDistinct() .setDimensions(dimensions(new DefaultDimensionSpec("d0", "_d0", ColumnType.STRING))) .setAggregatorSpecs( aggregators( - useDefault - ? new CountAggregatorFactory("a0") - : new FilteredAggregatorFactory( + new FilteredAggregatorFactory( new CountAggregatorFactory("a0"), notNull("d1") ) @@ -2734,11 +2542,6 @@ public void testHavingOnExactCountDistinct() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{"", 3L}, - new Object[]{"a", 2L} - ) : ImmutableList.of( new Object[]{null, 2L}, new Object[]{"a", 2L} @@ -2767,7 +2570,7 @@ public void testExactCountDistinctWithFilter() .authResult(CalciteTests.REGULAR_USER_AUTH_RESULT) .expectedResults( ImmutableList.of( - new Object[] {NullHandling.replaceWithDefault() ? 5L : 6L, 6L} + new Object[] {6L, 6L} ) ) .run(); @@ -2777,9 +2580,7 @@ public void testExactCountDistinctWithFilter() @Test public void testExactCountDistinctWithFilter2() { - if (NullHandling.sqlCompatible()) { - cannotVectorizeUnlessFallback(); - } + cannotVectorizeUnlessFallback(); final String sqlQuery = "SELECT COUNT(DISTINCT foo.dim1) FILTER(WHERE foo.cnt = 1), SUM(foo.cnt) FROM druid.foo"; testQuery( @@ -2801,9 +2602,7 @@ public void testExactCountDistinctWithFilter2() .setGranularity(Granularities.ALL) .setVirtualColumns(expressionVirtualColumn( "v0", - NullHandling.sqlCompatible() - ? "istrue((\"cnt\" == 1))" - : "(\"cnt\" == 1)", + "istrue((\"cnt\" == 1))", ColumnType.LONG )) .setDimensions(dimensions( @@ -2848,7 +2647,7 @@ public void testExactCountDistinctWithFilter2() .build() ), ImmutableList.of( - new Object[]{NullHandling.replaceWithDefault() ? 5L : 6L, 6L} + new Object[]{6L, 6L} ) ); } @@ -2909,11 +2708,6 @@ public void testColumnComparison() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{"", 1.0f, 1L}, - new Object[]{"2", 3.0f, 1L} - ) : ImmutableList.of( new Object[]{"2", 3.0f, 1L} ) @@ -2952,14 +2746,7 @@ public void testHavingOnRatio() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() - ? ImmutableList.of( - new Object[]{"10.1", 1L}, - new Object[]{"2", 1L}, - new Object[]{"abc", 1L}, - new Object[]{"def", 1L} - ) - : ImmutableList.of( + ImmutableList.of( new Object[]{"2", 1L}, new Object[]{"def", 1L} ) @@ -2988,10 +2775,10 @@ public void testGroupByWithSelectProjections() .build() ), ImmutableList.of( - new Object[]{"", NULL_STRING}, - new Object[]{"1", NULL_STRING}, + new Object[]{"", null}, + new Object[]{"1", null}, new Object[]{"10.1", "0.1"}, - new Object[]{"2", NULL_STRING}, + new Object[]{"2", null}, new Object[]{"abc", "bc"}, new Object[]{"def", "ef"} ) @@ -3042,9 +2829,9 @@ public void testGroupByWithSelectAndOrderByProjections() new Object[]{"10.1", "0.1"}, new Object[]{"abc", "bc"}, new Object[]{"def", "ef"}, - new Object[]{"1", NULL_STRING}, - new Object[]{"2", NULL_STRING}, - new Object[]{"", NULL_STRING} + new Object[]{"1", null}, + new Object[]{"2", null}, + new Object[]{"", null} ) ); } @@ -3072,10 +2859,10 @@ public void testTopNWithSelectProjections() .build() ), ImmutableList.of( - new Object[]{"", NULL_STRING}, - new Object[]{"1", NULL_STRING}, + new Object[]{"", null}, + new Object[]{"1", null}, new Object[]{"10.1", "0.1"}, - new Object[]{"2", NULL_STRING}, + new Object[]{"2", null}, new Object[]{"abc", "bc"}, new Object[]{"def", "ef"} ) @@ -3112,9 +2899,9 @@ public void testTopNWithSelectAndOrderByProjections() new Object[]{"10.1", "0.1"}, new Object[]{"abc", "bc"}, new Object[]{"def", "ef"}, - new Object[]{"1", NULL_STRING}, - new Object[]{"2", NULL_STRING}, - new Object[]{"", NULL_STRING} + new Object[]{"1", null}, + new Object[]{"2", null}, + new Object[]{"", null} ) ); } @@ -3257,9 +3044,7 @@ public void testPruneDeadAggregatorsThroughHaving() .setAggregatorSpecs(aggregators(new DoubleSumAggregatorFactory("a0", "m1"))) .setHavingSpec( having( - NullHandling.replaceWithDefault() - ? selector("a0", "21") - : equality("a0", 21.0, ColumnType.DOUBLE) + equality("a0", 21.0, ColumnType.DOUBLE) ) ) .setContext(QUERY_CONTEXT_DEFAULT) @@ -3313,7 +3098,7 @@ public void testGroupByCaseWhen() .build() ), ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 2L}, + new Object[]{null, 2L}, new Object[]{"match-cnt", 1L}, new Object[]{"match-m1", 3L} ) @@ -3345,9 +3130,7 @@ public void testDecomposeCaseWhenThreeArg() equality("dim1", "abc", ColumnType.STRING), and( equality("dim2", "abc", ColumnType.STRING), - NullHandling.sqlCompatible() - ? not(istrue(equality("dim1", "abc", ColumnType.STRING))) - : not(equality("dim1", "abc", ColumnType.STRING)) + not(istrue(equality("dim1", "abc", ColumnType.STRING))) ) ) ) @@ -3357,7 +3140,7 @@ public void testDecomposeCaseWhenThreeArg() ), ImmutableList.of( new Object[]{"def", "abc", "abc"}, - new Object[]{"abc", NullHandling.defaultStringValue(), "abc"} + new Object[]{"abc", null, "abc"} ) ); } @@ -3423,7 +3206,7 @@ public void testGroupByCaseWhenOfTripleAnd() .build() ), ImmutableList.of( - new Object[]{NullHandling.defaultStringValue(), 3L}, + new Object[]{null, 3L}, new Object[]{"x", 3L} ) ); @@ -3449,9 +3232,7 @@ public void testNullEmptyStringEquality() equality("dim2", "a", ColumnType.STRING), and( isNull("dim2"), - NullHandling.sqlCompatible() - ? not(istrue(equality("dim2", "a", ColumnType.STRING))) - : not(selector("dim2", "a")) + not(istrue(equality("dim2", "a", ColumnType.STRING))) ) ) ) @@ -3460,11 +3241,7 @@ public void testNullEmptyStringEquality() .build() ), ImmutableList.of( - NullHandling.replaceWithDefault() - // Matches everything but "abc" - ? new Object[]{5L} - // match only null values - : new Object[]{4L} + new Object[]{4L} ) ); } @@ -3476,22 +3253,7 @@ public void testNullLongFilter() "SELECT COUNT(*)\n" + "FROM druid.numfoo\n" + "WHERE l1 IS NULL", - useDefault - ? ImmutableList.of( - Druids.newScanQueryBuilder() - .dataSource( - InlineDataSource.fromIterable( - ImmutableList.of(new Object[]{0L}), - RowSignature.builder().add("EXPR$0", ColumnType.LONG).build() - ) - ) - .intervals(querySegmentSpec(Filtration.eternity())) - .columns("EXPR$0") - .columnTypes(ColumnType.LONG) - .resultFormat(ResultFormat.RESULT_FORMAT_COMPACTED_LIST) - .build() - ) - : ImmutableList.of( + ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) @@ -3502,7 +3264,7 @@ public void testNullLongFilter() .build() ), ImmutableList.of( - useDefault ? new Object[]{0L} : new Object[]{3L} + new Object[]{3L} ) ); } @@ -3514,22 +3276,7 @@ public void testNullDoubleFilter() "SELECT COUNT(*)\n" + "FROM druid.numfoo\n" + "WHERE dbl1 IS NULL", - useDefault - ? ImmutableList.of( - Druids.newScanQueryBuilder() - .dataSource( - InlineDataSource.fromIterable( - ImmutableList.of(new Object[]{0L}), - RowSignature.builder().add("EXPR$0", ColumnType.LONG).build() - ) - ) - .intervals(querySegmentSpec(Filtration.eternity())) - .columns("EXPR$0") - .columnTypes(ColumnType.LONG) - .resultFormat(ResultFormat.RESULT_FORMAT_COMPACTED_LIST) - .build() - ) - : ImmutableList.of( + ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) @@ -3540,7 +3287,7 @@ public void testNullDoubleFilter() .build() ), ImmutableList.of( - useDefault ? new Object[]{0L} : new Object[]{3L} + new Object[]{3L} ) ); } @@ -3552,22 +3299,7 @@ public void testNullFloatFilter() "SELECT COUNT(*)\n" + "FROM druid.numfoo\n" + "WHERE f1 IS NULL", - useDefault - ? ImmutableList.of( - Druids.newScanQueryBuilder() - .dataSource( - InlineDataSource.fromIterable( - ImmutableList.of(new Object[]{0L}), - RowSignature.builder().add("EXPR$0", ColumnType.LONG).build() - ) - ) - .intervals(querySegmentSpec(Filtration.eternity())) - .columns("EXPR$0") - .columnTypes(ColumnType.LONG) - .resultFormat(ResultFormat.RESULT_FORMAT_COMPACTED_LIST) - .build() - ) - : ImmutableList.of( + ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) @@ -3578,7 +3310,7 @@ public void testNullFloatFilter() .build() ), ImmutableList.of( - useDefault ? new Object[]{0L} : new Object[]{3L} + new Object[]{3L} ) ); } @@ -3674,10 +3406,6 @@ public void testExactCountDistinctUsingSubqueryOnUnionAllTables() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{12L, 3L} - ) : ImmutableList.of( new Object[]{12L, 4L} ) @@ -3687,25 +3415,14 @@ public void testExactCountDistinctUsingSubqueryOnUnionAllTables() @Test public void testNullDoubleTopN() { - // Disabled test in MSQ with SQL-compatible mode till https://github.com/apache/druid/issues/13951 is resolved - if (NullHandling.sqlCompatible()) { - msqIncompatible(); - } - List expected; - if (useDefault) { - expected = ImmutableList.of( - new Object[]{1.7, 1L}, - new Object[]{1.0, 1L}, - new Object[]{0.0, 4L} - ); - } else { - expected = ImmutableList.of( - new Object[]{null, 3L}, - new Object[]{1.7, 1L}, - new Object[]{1.0, 1L}, - new Object[]{0.0, 1L} - ); - } + // Disabled test in MSQ till https://github.com/apache/druid/issues/13951 is resolved + msqIncompatible(); + List expected = ImmutableList.of( + new Object[]{null, 3L}, + new Object[]{1.7, 1L}, + new Object[]{1.0, 1L}, + new Object[]{0.0, 1L} + ); testQuery( "SELECT dbl1, COUNT(*) FROM druid.numfoo GROUP BY dbl1 ORDER BY dbl1 DESC LIMIT 10", QUERY_CONTEXT_DEFAULT, @@ -3731,25 +3448,14 @@ public void testNullDoubleTopN() @Test public void testNullFloatTopN() { - // Disabled test in MSQ with SQL-compatible mode till https://github.com/apache/druid/issues/13951 is resolved - if (NullHandling.sqlCompatible()) { - msqIncompatible(); - } - List expected; - if (useDefault) { - expected = ImmutableList.of( - new Object[]{1.0f, 1L}, - new Object[]{0.1f, 1L}, - new Object[]{0.0f, 4L} - ); - } else { - expected = ImmutableList.of( - new Object[]{null, 3L}, - new Object[]{1.0f, 1L}, - new Object[]{0.1f, 1L}, - new Object[]{0.0f, 1L} - ); - } + // Disabled test in MSQ till https://github.com/apache/druid/issues/13951 is resolved + msqIncompatible(); + List expected = ImmutableList.of( + new Object[]{null, 3L}, + new Object[]{1.0f, 1L}, + new Object[]{0.1f, 1L}, + new Object[]{0.0f, 1L} + ); testQuery( "SELECT f1, COUNT(*) FROM druid.numfoo GROUP BY f1 ORDER BY f1 DESC LIMIT 10", QUERY_CONTEXT_DEFAULT, @@ -3775,25 +3481,14 @@ public void testNullFloatTopN() @Test public void testNullLongTopN() { - // Disabled test in MSQ with SQL-compatible mode till https://github.com/apache/druid/issues/13951 is resolved - if (NullHandling.sqlCompatible()) { - msqIncompatible(); - } - List expected; - if (useDefault) { - expected = ImmutableList.of( - new Object[]{325323L, 1L}, - new Object[]{7L, 1L}, - new Object[]{0L, 4L} - ); - } else { - expected = ImmutableList.of( - new Object[]{null, 3L}, - new Object[]{325323L, 1L}, - new Object[]{7L, 1L}, - new Object[]{0L, 1L} - ); - } + // Disabled test in MSQ till https://github.com/apache/druid/issues/13951 is resolved + msqIncompatible(); + List expected = ImmutableList.of( + new Object[]{null, 3L}, + new Object[]{325323L, 1L}, + new Object[]{7L, 1L}, + new Object[]{0L, 1L} + ); testQuery( "SELECT l1, COUNT(*) FROM druid.numfoo GROUP BY l1 ORDER BY l1 DESC LIMIT 10", QUERY_CONTEXT_DEFAULT, @@ -3830,22 +3525,13 @@ public void testLongPredicateIsNull() .virtualColumns( expressionVirtualColumn( "v0", - NullHandling.replaceWithDefault() ? "0" : "isnull(\"l1\")", + "isnull(\"l1\")", ColumnType.LONG ) ) .context(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{false}, - new Object[]{false}, - new Object[]{false}, - new Object[]{false}, - new Object[]{false}, - new Object[]{false} - ) : ImmutableList.of( new Object[]{false}, new Object[]{false}, @@ -3923,47 +3609,25 @@ public void testFloatPredicateFilterNulls() @Test public void testEmptyStringEquality() { - if (NullHandling.replaceWithDefault()) { - testQuery( - "SELECT COUNT(*)\n" - + "FROM druid.foo\n" - + "WHERE NULLIF(dim2, 'a') = ''", - ImmutableList.of( - Druids.newTimeseriesQueryBuilder() - .dataSource(CalciteTests.DATASOURCE1) - .intervals(querySegmentSpec(Filtration.eternity())) - .granularity(Granularities.ALL) - .filters(in("dim2", ImmutableList.of("", "a"))) - .aggregators(aggregators(new CountAggregatorFactory("a0"))) - .context(QUERY_CONTEXT_DEFAULT) - .build() - ), - ImmutableList.of( - // Matches everything but "abc" - new Object[]{5L} - ) - ); - } else { - testQuery( - "SELECT COUNT(*)\n" - + "FROM druid.foo\n" - + "WHERE NULLIF(dim2, 'a') = ''", - ImmutableList.of( - Druids.newTimeseriesQueryBuilder() - .dataSource(CalciteTests.DATASOURCE1) - .intervals(querySegmentSpec(Filtration.eternity())) - .granularity(Granularities.ALL) - .filters(equality("dim2", "", ColumnType.STRING)) - .aggregators(aggregators(new CountAggregatorFactory("a0"))) - .context(QUERY_CONTEXT_DEFAULT) - .build() - ), - ImmutableList.of( - // match only empty string - new Object[]{1L} - ) - ); - } + testQuery( + "SELECT COUNT(*)\n" + + "FROM druid.foo\n" + + "WHERE NULLIF(dim2, 'a') = ''", + ImmutableList.of( + Druids.newTimeseriesQueryBuilder() + .dataSource(CalciteTests.DATASOURCE1) + .intervals(querySegmentSpec(Filtration.eternity())) + .granularity(Granularities.ALL) + .filters(equality("dim2", "", ColumnType.STRING)) + .aggregators(aggregators(new CountAggregatorFactory("a0"))) + .context(QUERY_CONTEXT_DEFAULT) + .build() + ), + ImmutableList.of( + // match only empty string + new Object[]{1L} + ) + ); } @Test @@ -4015,13 +3679,6 @@ public void testCoalesceColumns() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{"10.1", 1L}, - new Object[]{"2", 1L}, - new Object[]{"a", 2L}, - new Object[]{"abc", 2L} - ) : ImmutableList.of( new Object[]{"", 1L}, new Object[]{"10.1", 1L}, @@ -4136,14 +3793,6 @@ public void testCoalesceMoreColumns() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{"10.1", "b", 1L}, - new Object[]{"10.1", "c", 1L}, - new Object[]{"2", "d", 1L}, - new Object[]{"a", "a", 3L}, - new Object[]{"abc", "abc", 2L} - ) : ImmutableList.of( new Object[]{"", "", 1L}, new Object[]{"10.1", "b", 1L}, @@ -4172,7 +3821,7 @@ public void testColumnIsNull() .build() ), ImmutableList.of( - new Object[]{NullHandling.replaceWithDefault() ? 3L : 2L} + new Object[]{2L} ) ); } @@ -4364,7 +4013,7 @@ public void testGroupByWithFilterMatchingNothing() .build() ), ImmutableList.of( - new Object[]{0L, NullHandling.sqlCompatible() ? null : Long.MIN_VALUE} + new Object[]{0L, null} ) ); } @@ -4425,9 +4074,7 @@ public void testCountNonNullColumn() .granularity(Granularities.ALL) .aggregators( aggregators( - useDefault - ? new CountAggregatorFactory("a0") - : new FilteredAggregatorFactory( + new FilteredAggregatorFactory( new CountAggregatorFactory("a0"), notNull("cnt") ) @@ -4461,10 +4108,6 @@ public void testCountNullableColumn() .context(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{3L} - ) : ImmutableList.of( new Object[]{4L} ) @@ -4519,39 +4162,27 @@ public void testCountStar() @Test public void testCountStarOnCommonTableExpression() { - if (NullHandling.sqlCompatible()) { - cannotVectorizeUnlessFallback(); - } + cannotVectorizeUnlessFallback(); Druids.TimeseriesQueryBuilder builder = Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE1) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) .aggregators(aggregators(new CountAggregatorFactory("a0"))) - .context(QUERY_CONTEXT_DEFAULT); - if (NullHandling.sqlCompatible()) { - builder = builder.virtualColumns(expressionVirtualColumn("v0", "substring(\"dim1\", 0, 1)", ColumnType.STRING)) - .filters( - and( - equality("dim2", "a", ColumnType.STRING), - not(equality("v0", "z", ColumnType.STRING)) - ) - ); - } else { - builder = builder.filters( - and( - equality("dim2", "a", ColumnType.STRING), - not(selector("dim1", "z", new SubstringDimExtractionFn(0, 1))) - ) - ); - } + .context(QUERY_CONTEXT_DEFAULT) + .virtualColumns(expressionVirtualColumn("v0", "substring(\"dim1\", 0, 1)", ColumnType.STRING)) + .filters( + and( + equality("dim2", "a", ColumnType.STRING), + not(equality("v0", "z", ColumnType.STRING)) + ) + ); testQuery( "WITH beep (dim1_firstchar) AS (SELECT SUBSTRING(dim1, 1, 1) FROM foo WHERE dim2 = 'a')\n" + "SELECT COUNT(*) FROM beep WHERE dim1_firstchar <> 'z'", ImmutableList.of(builder.build()), ImmutableList.of( - // in sql compatible mode, the expression filter causes us to correctly not match null - new Object[]{NullHandling.replaceWithDefault() ? 2L : 1L} + new Object[]{1L} ) ); } @@ -4559,38 +4190,26 @@ public void testCountStarOnCommonTableExpression() @Test public void testCountStarOnView() { - if (NullHandling.sqlCompatible()) { - cannotVectorizeUnlessFallback(); - } + cannotVectorizeUnlessFallback(); Druids.TimeseriesQueryBuilder builder = Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE1) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) .aggregators(aggregators(new CountAggregatorFactory("a0"))) - .context(QUERY_CONTEXT_DEFAULT); - if (NullHandling.sqlCompatible()) { - builder = builder.virtualColumns(expressionVirtualColumn("v0", "substring(\"dim1\", 0, 1)", ColumnType.STRING)) - .filters( - and( - equality("dim2", "a", ColumnType.STRING), - not(equality("v0", "z", ColumnType.STRING)) - ) - ); - } else { - builder = builder.filters( - and( - equality("dim2", "a", ColumnType.STRING), - not(selector("dim1", "z", new SubstringDimExtractionFn(0, 1))) - ) - ); - } + .context(QUERY_CONTEXT_DEFAULT) + .virtualColumns(expressionVirtualColumn("v0", "substring(\"dim1\", 0, 1)", ColumnType.STRING)) + .filters( + and( + equality("dim2", "a", ColumnType.STRING), + not(equality("v0", "z", ColumnType.STRING)) + ) + ); testQuery( "SELECT COUNT(*) FROM view.aview WHERE dim1_firstchar <> 'z'", ImmutableList.of(builder.build()), ImmutableList.of( - // in sql compatible mode, the expression filter causes us to correctly not match null - new Object[]{NullHandling.replaceWithDefault() ? 2L : 1L} + new Object[]{1L} ) ); } @@ -4598,38 +4217,28 @@ public void testCountStarOnView() @Test public void testConfusedView() { + cannotVectorizeUnlessFallback(); Druids.TimeseriesQueryBuilder builder = Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE1) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) .aggregators(aggregators(new CountAggregatorFactory("a0"))) - .context(QUERY_CONTEXT_DEFAULT); - if (NullHandling.sqlCompatible()) { - cannotVectorizeUnlessFallback(); - builder = builder.virtualColumns( - expressionVirtualColumn("v0", "substring(\"dim1\", 0, 1)", ColumnType.STRING) - ) - .filters( - and( - equality("dim2", "a", ColumnType.STRING), - not(equality("v0", "z", ColumnType.STRING)) - ) - ); - } else { - builder = builder.filters( - and( - equality("dim2", "a", ColumnType.STRING), - not(selector("dim1", "z", new SubstringDimExtractionFn(0, 1))) - ) - ); - } + .context(QUERY_CONTEXT_DEFAULT) + .virtualColumns( + expressionVirtualColumn("v0", "substring(\"dim1\", 0, 1)", ColumnType.STRING) + ) + .filters( + and( + equality("dim2", "a", ColumnType.STRING), + not(equality("v0", "z", ColumnType.STRING)) + ) + ); testQuery( "SELECT COUNT(*) FROM view.dview as druid WHERE druid.numfoo <> 'z'", ImmutableList.of(builder.build()), ImmutableList.of( - // in sql compatible mode, the expression filter causes us to correctly not match null - new Object[]{NullHandling.replaceWithDefault() ? 2L : 1L} + new Object[]{1L} ) ); } @@ -4728,9 +4337,7 @@ public void testCountStarWithLongColumnFiltersOnFloatLiterals() .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) .filters( - NullHandling.replaceWithDefault() - ? bound("cnt", "1.1", "100000001.0", true, true, null, StringComparators.NUMERIC) - : range("cnt", ColumnType.DOUBLE, 1.1, 100000001.0, true, true) + range("cnt", ColumnType.DOUBLE, 1.1, 100000001.0, true, true) ) .aggregators(aggregators(new CountAggregatorFactory("a0"))) .context(QUERY_CONTEXT_DEFAULT) @@ -4768,9 +4375,7 @@ public void testCountStarWithLongColumnFiltersOnFloatLiterals() .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) .filters( - NullHandling.replaceWithDefault() - ? selector("cnt", "100000001.0") - : equality("cnt", 100000001.0, ColumnType.DOUBLE) + equality("cnt", 100000001.0, ColumnType.DOUBLE) ) .aggregators(aggregators(new CountAggregatorFactory("a0"))) .context(QUERY_CONTEXT_DEFAULT) @@ -4789,9 +4394,7 @@ public void testCountStarWithLongColumnFiltersOnFloatLiterals() .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) .filters( - NullHandling.sqlCompatible() - ? in("cnt", ColumnType.DOUBLE, ImmutableList.of(1.0, 100000001.0)) - : in("cnt", ImmutableList.of("1.0", "100000001.0"), null) + in("cnt", ColumnType.DOUBLE, ImmutableList.of(1.0, 100000001.0)) ) .aggregators(aggregators(new CountAggregatorFactory("a0"))) .context(QUERY_CONTEXT_DEFAULT) @@ -4845,15 +4448,7 @@ public void testFilterOnStringAsNumber() ) ) .setDimFilter( - NullHandling.replaceWithDefault() - ? or( - numericSelector("dim1", "10"), - and( - selector("v0", "10.00"), - bound("dim1", "9", "10.5", true, false, null, StringComparators.NUMERIC) - ) - ) - : or( + or( equality("dim1", 10L, ColumnType.LONG), and( equality("v0", 10.0, ColumnType.DOUBLE), @@ -4882,9 +4477,7 @@ public void testFilterOnStringAsNumber2() .setGranularity(Granularities.ALL) .setDimensions(dimensions(new DefaultDimensionSpec("dim1", "d0"))) .setDimFilter( - NullHandling.replaceWithDefault() - ? bound("dim1", "9", "10.5", true, false, null, StringComparators.NUMERIC) - : range("dim1", ColumnType.DOUBLE, 9.0, 10.5, true, false) + range("dim1", ColumnType.DOUBLE, 9.0, 10.5, true, false) ) .setContext(QUERY_CONTEXT_DEFAULT) .build() @@ -4977,26 +4570,7 @@ public void testSimpleAggregations() .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) .aggregators( - useDefault - ? aggregators( - new CountAggregatorFactory("a0"), - new FilteredAggregatorFactory( - new CountAggregatorFactory("a1"), - notNull("dim1") - ), - new DoubleSumAggregatorFactory("a2:sum", "cnt"), - new CountAggregatorFactory("a2:count"), - new LongSumAggregatorFactory("a3", "cnt"), - new LongMinAggregatorFactory("a4", "cnt"), - new LongMaxAggregatorFactory("a5", "cnt"), - new FilteredAggregatorFactory( - new CountAggregatorFactory("a6"), - notNull("dim2") - ), - new DoubleSumAggregatorFactory("a7:sum", "dbl1"), - new CountAggregatorFactory("a7:count") - ) - : aggregators( + aggregators( new CountAggregatorFactory("a0"), new FilteredAggregatorFactory( new CountAggregatorFactory("a1"), @@ -5031,34 +4605,30 @@ public void testSimpleAggregations() ) .postAggregators( new ArithmeticPostAggregator( - useDefault ? "a2" : "a3", + "a3", "quotient", ImmutableList.of( - new FieldAccessPostAggregator(null, useDefault ? "a2:sum" : "a3:sum"), - new FieldAccessPostAggregator(null, useDefault ? "a2:count" : "a3:count") + new FieldAccessPostAggregator(null, "a3:sum"), + new FieldAccessPostAggregator(null, "a3:count") ) ), new ArithmeticPostAggregator( - useDefault ? "a7" : "a9", + "a9", "quotient", ImmutableList.of( - new FieldAccessPostAggregator(null, useDefault ? "a7:sum" : "a9:sum"), - new FieldAccessPostAggregator(null, useDefault ? "a7:count" : "a9:count") + new FieldAccessPostAggregator(null, "a9:sum"), + new FieldAccessPostAggregator(null, "a9:count") ) ), expressionPostAgg( "p0", - useDefault ? "((\"a3\" + \"a4\") + \"a5\")" : "((\"a4\" + \"a5\") + \"a6\")", + "((\"a4\" + \"a5\") + \"a6\")", ColumnType.LONG ) ) .context(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{6L, 6L, 5L, 1.0, 6L, 8L, 3L, 6L, ((1 + 1.7) / 6)} - ) : ImmutableList.of( new Object[]{6L, 6L, 6L, 1.0, 6L, 8L, 4L, 3L, ((1 + 1.7) / 3)} ) @@ -5189,155 +4759,83 @@ public void testGroupByWithSortOnPostAggregationNoTopNContext() @Test public void testFilteredAggregations() { + cannotVectorizeUnlessFallback(); Druids.TimeseriesQueryBuilder builder = Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE1) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .context(QUERY_CONTEXT_DEFAULT); - if (NullHandling.sqlCompatible()) { - cannotVectorizeUnlessFallback(); - builder = builder.virtualColumns( - expressionVirtualColumn("v0", "substring(\"dim1\", 0, 1)", ColumnType.STRING) - ) - .aggregators( - aggregators( - new FilteredAggregatorFactory( - new LongSumAggregatorFactory("a0", "cnt"), - equality("dim1", "abc", ColumnType.STRING) - ), - new FilteredAggregatorFactory( - new LongSumAggregatorFactory("a1", "cnt"), - not(istrue(equality("dim1", "abc", ColumnType.STRING))) - ), - new FilteredAggregatorFactory( - new LongSumAggregatorFactory("a2", "cnt"), - equality("v0", "a", ColumnType.STRING) - ), - new FilteredAggregatorFactory( - new CountAggregatorFactory("a3"), - and( - notNull("dim2"), - not(equality("dim1", "1", ColumnType.STRING)) - ) - ), - new FilteredAggregatorFactory( - new CountAggregatorFactory("a4"), - not(equality("dim1", "1", ColumnType.STRING)) - ), - new FilteredAggregatorFactory( - new CountAggregatorFactory("a5"), - not(equality("dim1", "1", ColumnType.STRING)) - ), - new FilteredAggregatorFactory( - new LongSumAggregatorFactory("a6", "cnt"), - equality("dim2", "a", ColumnType.STRING) - ), - new FilteredAggregatorFactory( - new LongSumAggregatorFactory("a7", "cnt"), - and( - equality("dim2", "a", ColumnType.STRING), - not(equality("dim1", "1", ColumnType.STRING)) - ) - ), - new FilteredAggregatorFactory( - new LongSumAggregatorFactory("a8", "cnt"), - not(equality("dim1", "1", ColumnType.STRING)) - ), - new FilteredAggregatorFactory( - new LongMaxAggregatorFactory("a9", "cnt"), - not(equality("dim1", "1", ColumnType.STRING)) - ), - new FilteredAggregatorFactory( - new CardinalityAggregatorFactory( - "a10", - null, - dimensions(new DefaultDimensionSpec("m1", "m1", ColumnType.FLOAT)), - false, - true - ), - not(equality("dim1", "1", ColumnType.STRING)) - ), - new FilteredAggregatorFactory( - new LongSumAggregatorFactory("a11", "cnt"), - and( - equality("dim2", "a", ColumnType.STRING), - equality("dim1", "b", ColumnType.STRING) - ) - ) - ) - ); - } else { - builder = builder.virtualColumns( - ) - .aggregators( - aggregators( - new FilteredAggregatorFactory( - new LongSumAggregatorFactory("a0", "cnt"), - equality("dim1", "abc", ColumnType.STRING) - ), - new FilteredAggregatorFactory( - new LongSumAggregatorFactory("a1", "cnt"), - not(selector("dim1", "abc")) - ), - new FilteredAggregatorFactory( - new LongSumAggregatorFactory("a2", "cnt"), - selector("dim1", "a", new SubstringDimExtractionFn(0, 1)) - ), - new FilteredAggregatorFactory( - new CountAggregatorFactory("a3"), - and( - notNull("dim2"), - not(equality("dim1", "1", ColumnType.STRING)) - ) - ), - new FilteredAggregatorFactory( - new CountAggregatorFactory("a4"), - not(equality("dim1", "1", ColumnType.STRING)) - ), - new FilteredAggregatorFactory( - new CountAggregatorFactory("a5"), - not(equality("dim1", "1", ColumnType.STRING)) - ), - new FilteredAggregatorFactory( - new LongSumAggregatorFactory("a6", "cnt"), - equality("dim2", "a", ColumnType.STRING) - ), - new FilteredAggregatorFactory( - new LongSumAggregatorFactory("a7", "cnt"), - and( - equality("dim2", "a", ColumnType.STRING), - not(equality("dim1", "1", ColumnType.STRING)) - ) - ), - new FilteredAggregatorFactory( - new LongSumAggregatorFactory("a8", "cnt"), - not(equality("dim1", "1", ColumnType.STRING)) - ), - new FilteredAggregatorFactory( - new LongMaxAggregatorFactory("a9", "cnt"), - not(equality("dim1", "1", ColumnType.STRING)) - ), - new FilteredAggregatorFactory( - new CardinalityAggregatorFactory( - "a10", - null, - dimensions(new DefaultDimensionSpec("m1", "m1", ColumnType.FLOAT)), - false, - true - ), - not(equality("dim1", "1", ColumnType.STRING)) - ), - new FilteredAggregatorFactory( - new LongSumAggregatorFactory("a11", "cnt"), - and( - equality("dim2", "a", ColumnType.STRING), - equality("dim1", "b", ColumnType.STRING) - ) + .context(QUERY_CONTEXT_DEFAULT) + .virtualColumns( + expressionVirtualColumn("v0", "substring(\"dim1\", 0, 1)", ColumnType.STRING) ) - ) - ); - } + .aggregators( + aggregators( + new FilteredAggregatorFactory( + new LongSumAggregatorFactory("a0", "cnt"), + equality("dim1", "abc", ColumnType.STRING) + ), + new FilteredAggregatorFactory( + new LongSumAggregatorFactory("a1", "cnt"), + not(istrue(equality("dim1", "abc", ColumnType.STRING))) + ), + new FilteredAggregatorFactory( + new LongSumAggregatorFactory("a2", "cnt"), + equality("v0", "a", ColumnType.STRING) + ), + new FilteredAggregatorFactory( + new CountAggregatorFactory("a3"), + and( + notNull("dim2"), + not(equality("dim1", "1", ColumnType.STRING)) + ) + ), + new FilteredAggregatorFactory( + new CountAggregatorFactory("a4"), + not(equality("dim1", "1", ColumnType.STRING)) + ), + new FilteredAggregatorFactory( + new CountAggregatorFactory("a5"), + not(equality("dim1", "1", ColumnType.STRING)) + ), + new FilteredAggregatorFactory( + new LongSumAggregatorFactory("a6", "cnt"), + equality("dim2", "a", ColumnType.STRING) + ), + new FilteredAggregatorFactory( + new LongSumAggregatorFactory("a7", "cnt"), + and( + equality("dim2", "a", ColumnType.STRING), + not(equality("dim1", "1", ColumnType.STRING)) + ) + ), + new FilteredAggregatorFactory( + new LongSumAggregatorFactory("a8", "cnt"), + not(equality("dim1", "1", ColumnType.STRING)) + ), + new FilteredAggregatorFactory( + new LongMaxAggregatorFactory("a9", "cnt"), + not(equality("dim1", "1", ColumnType.STRING)) + ), + new FilteredAggregatorFactory( + new CardinalityAggregatorFactory( + "a10", + null, + dimensions(new DefaultDimensionSpec("m1", "m1", ColumnType.FLOAT)), + false, + true + ), + not(equality("dim1", "1", ColumnType.STRING)) + ), + new FilteredAggregatorFactory( + new LongSumAggregatorFactory("a11", "cnt"), + and( + equality("dim2", "a", ColumnType.STRING), + equality("dim1", "b", ColumnType.STRING) + ) + ) + ) + ); testQuery( "SELECT " + "SUM(case dim1 when 'abc' then cnt end), " @@ -5354,10 +4852,6 @@ public void testFilteredAggregations() + "SUM(cnt) filter(WHERE dim2 = 'a' AND dim1 = 'b') " + "FROM druid.foo", ImmutableList.of(builder.build()), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{1L, 5L, 1L, 2L, 5L, 5L, 2L, 1L, 5L, 1L, 5L, 0L} - ) : ImmutableList.of( new Object[]{1L, 5L, 1L, 3L, 5L, 5L, 2L, 1L, 5L, 1L, 5L, null} ) @@ -5475,10 +4969,6 @@ public void testFilteredAggregationWithNotIn() .context(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{5L, 2L} - ) : ImmutableList.of( new Object[]{5L, 3L} ) @@ -5526,7 +5016,7 @@ public void testExpressionAggregations() .build() ), ImmutableList.of( - new Object[]{18L, 3.295836866004329, 2, 12L, 3f + (Math.log(5.0)), useDefault ? 0.6931471805599453 : 1.0} + new Object[]{18L, 3.295836866004329, 2, 12L, 3f + (Math.log(5.0)), 1.0} ) ); } @@ -5668,12 +5158,6 @@ public void testExpressionFilteringAndGroupingOnStringCastToNumber() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{10.0f, 1L}, - new Object[]{2.0f, 1L}, - new Object[]{0.0f, 4L} - ) : ImmutableList.of( new Object[]{10.0f, 1L}, new Object[]{2.0f, 1L}, @@ -5750,9 +5234,8 @@ public void testInIsNotTrueFilter() .setGranularity(Granularities.ALL) .setDimensions(dimensions(new DefaultDimensionSpec("dim1", "d0"))) .setDimFilter( - NullHandling.sqlCompatible() - ? not(istrue(in("dim1", ImmutableList.of("abc", "def", "ghi")))) - : not(in("dim1", ImmutableList.of("abc", "def", "ghi")))) + not(istrue(in("dim1", ImmutableList.of("abc", "def", "ghi")))) + ) .setAggregatorSpecs( aggregators( new CountAggregatorFactory("a0") @@ -5827,18 +5310,12 @@ public void testNotInAndIsNotNullFilter() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.sqlCompatible() - ? ImmutableList.of( + ImmutableList.of( new Object[]{"", 1L}, new Object[]{"1", 1L}, new Object[]{"10.1", 1L}, new Object[]{"2", 1L} ) - : ImmutableList.of( - new Object[]{"1", 1L}, - new Object[]{"10.1", 1L}, - new Object[]{"2", 1L} - ) ); } @@ -5889,15 +5366,10 @@ public void testInIsNotTrueAndLessThanFilter() .setGranularity(Granularities.ALL) .setDimensions(dimensions(new DefaultDimensionSpec("dim1", "d0"))) .setDimFilter( - NullHandling.sqlCompatible() - ? and( + and( not(istrue(in("dim1", ImmutableList.of("abc", "def", "ghi")))), range("dim1", ColumnType.STRING, null, "zzz", false, true) ) - : and( - not(in("dim1", ImmutableList.of("abc", "def", "ghi"))), - range("dim1", ColumnType.STRING, null, "zzz", false, true) - ) ) .setAggregatorSpecs( aggregators( @@ -6006,8 +5478,8 @@ public void testInOrIsNullExpression() .build() ), ImmutableList.of( - new Object[]{false, NullHandling.sqlCompatible() ? 4L : 3L}, - new Object[]{true, NullHandling.sqlCompatible() ? 2L : 3L} + new Object[]{false, 4L}, + new Object[]{true, 2L} ) ); } @@ -6038,8 +5510,8 @@ public void testNotInOrIsNullExpression() .build() ), ImmutableList.of( - new Object[]{false, NullHandling.sqlCompatible() ? 2L : 3L}, - new Object[]{true, NullHandling.sqlCompatible() ? 4L : 3L} + new Object[]{false, 2L}, + new Object[]{true, 4L} ) ); } @@ -6070,8 +5542,8 @@ public void testNotInAndIsNotNullExpression() .build() ), ImmutableList.of( - new Object[]{false, NullHandling.sqlCompatible() ? 2L : 3L}, - new Object[]{true, NullHandling.sqlCompatible() ? 4L : 3L} + new Object[]{false, 2L}, + new Object[]{true, 4L} ) ); } @@ -6185,9 +5657,7 @@ public void testSqlIsNullToInFilter() .setGranularity(Granularities.ALL) .setDimensions(dimensions(new DefaultDimensionSpec("dim1", "d0"))) .setDimFilter( - NullHandling.replaceWithDefault() - ? in("dim1", Arrays.asList("abc", "def", "ghi", "")) - : or( + or( in("dim1", Arrays.asList("abc", "def", "ghi")), isNull("dim1") ) @@ -6200,11 +5670,7 @@ public void testSqlIsNullToInFilter() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.sqlCompatible() ? ImmutableList.of( - new Object[]{"abc", 1L}, - new Object[]{"def", 1L} - ) : ImmutableList.of( - new Object[]{"", 1L}, + ImmutableList.of( new Object[]{"abc", 1L}, new Object[]{"def", 1L} ) @@ -6236,21 +5702,10 @@ public void testInFilterWith23Elements() .setGranularity(Granularities.ALL) .setDimensions(dimensions(new DefaultDimensionSpec("dim1", "d0"))) .setDimFilter( - NullHandling.sqlCompatible() - ? or( + or( in("dim1", ImmutableSet.builder().addAll(elements).add("xyz").build()), isNull("dim1") ) - : in( - "dim1", - Lists.newArrayList( - Iterables.concat( - Collections.singleton(null), - elements, - Collections.singleton("xyz") - ) - ) - ) ) .setAggregatorSpecs( aggregators( @@ -6260,13 +5715,7 @@ public void testInFilterWith23Elements() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.sqlCompatible() - ? ImmutableList.of( - new Object[]{"abc", 1L}, - new Object[]{"def", 1L} - ) - : ImmutableList.of( - new Object[]{"", 1L}, + ImmutableList.of( new Object[]{"abc", 1L}, new Object[]{"def", 1L} ) @@ -6298,18 +5747,11 @@ public void testInFilterWith23Elements_overScalarInArrayThreshold() .setGranularity(Granularities.ALL) .setDimensions(dimensions(new DefaultDimensionSpec("dim1", "d0"))) .setDimFilter( - // [dim1 = xyz] is not combined into the IN filter, because SCALAR_IN_ARRAY was used, - // and it is opaque to most optimizations. (That's its main purpose.) - NullHandling.sqlCompatible() - ? or( + or( in("dim1", elements), isNull("dim1"), equality("dim1", "xyz", ColumnType.STRING) ) - : or( - in("dim1", Arrays.asList(null, "xyz")), - in("dim1", elements) - ) ) .setAggregatorSpecs( aggregators( @@ -6319,13 +5761,7 @@ public void testInFilterWith23Elements_overScalarInArrayThreshold() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.sqlCompatible() - ? ImmutableList.of( - new Object[]{"abc", 1L}, - new Object[]{"def", 1L} - ) - : ImmutableList.of( - new Object[]{"", 1L}, + ImmutableList.of( new Object[]{"abc", 1L}, new Object[]{"def", 1L} ) @@ -6365,18 +5801,11 @@ public void testInFilterWith23Elements_overBothScalarInArrayAndInSubQueryThresho .setGranularity(Granularities.ALL) .setDimensions(dimensions(new DefaultDimensionSpec("dim1", "d0"))) .setDimFilter( - // [dim1 = xyz] is not combined into the IN filter, because SCALAR_IN_ARRAY was used, - // and it is opaque to most optimizations. (That's its main purpose.) - NullHandling.sqlCompatible() - ? or( + or( in("dim1", elements), isNull("dim1"), equality("dim1", "xyz", ColumnType.STRING) ) - : or( - in("dim1", Arrays.asList(null, "xyz")), - in("dim1", elements) - ) ) .setAggregatorSpecs( aggregators( @@ -6386,13 +5815,7 @@ public void testInFilterWith23Elements_overBothScalarInArrayAndInSubQueryThresho .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.sqlCompatible() - ? ImmutableList.of( - new Object[]{"abc", 1L}, - new Object[]{"def", 1L} - ) - : ImmutableList.of( - new Object[]{"", 1L}, + ImmutableList.of( new Object[]{"abc", 1L}, new Object[]{"def", 1L} ) @@ -6459,68 +5882,8 @@ public void testUnplannableScanOrderByNonTime() assertQueryIsUnplannable( "SELECT dim1 FROM druid.foo ORDER BY dim1", - "SQL query requires ordering a table by non-time column [[dim1]], which is not supported." - ); - } - - @Test - public void testUnplannableJoinQueriesInNonSQLCompatibleMode() - { - assumeFalse(testBuilder().isDecoupledMode(), "only valid in non-decoupled mode"); - msqIncompatible(); - Assumptions.assumeFalse(NullHandling.sqlCompatible()); - - assertQueryIsUnplannable( - // JOIN condition with not-equals (<>). - "SELECT foo.dim1, foo.dim2, l.k, l.v\n" - + "FROM foo INNER JOIN lookup.lookyloo l ON foo.dim2 <> l.k", - "SQL requires a join with 'NOT_EQUALS' condition that is not supported." - ); - } - - @Test - public void testUnplannableJoinQueriesInNonSQLCompatibleMode2() - { - assumeFalse(testBuilder().isDecoupledMode(), "only valid in non-decoupled mode"); - msqIncompatible(); - Assumptions.assumeFalse(NullHandling.sqlCompatible()); - - assertQueryIsUnplannable( - // JOIN condition with a function of both sides. - "SELECT foo.dim1, foo.dim2, l.k, l.v\n" - + "FROM foo INNER JOIN lookup.lookyloo l ON CHARACTER_LENGTH(foo.dim2 || l.k) > 3\n", - "SQL requires a join with 'GREATER_THAN' condition that is not supported." - ); - } - - @Test - public void testPlannableJoinQueriesInNonSQLCompatibleMode() - { - assumeTrue(testBuilder().isDecoupledMode(), "only in decoupled mode"); - msqIncompatible(); - Assumptions.assumeFalse(NullHandling.sqlCompatible()); - - testBuilder() - .sql( - "SELECT foo.dim1, foo.dim2, l.k, l.v\n" - + "FROM foo INNER JOIN lookup.lookyloo l ON foo.dim2 <> l.k" - ) - .run(); - } - - @Test - public void testPlannableJoinQueriesInNonSQLCompatibleMode2() - { - assumeTrue(testBuilder().isDecoupledMode(), "only in decoupled mode"); - msqIncompatible(); - Assumptions.assumeFalse(NullHandling.sqlCompatible()); - - testBuilder() - .sql( - "SELECT foo.dim1, foo.dim2, l.k, l.v\n" - + "FROM foo INNER JOIN lookup.lookyloo l ON CHARACTER_LENGTH(foo.dim2 || l.k) > 3\n" - ) - .run(); + "SQL query requires ordering a table by non-time column [[dim1]], which is not supported." + ); } @Test @@ -6689,7 +6052,7 @@ public void testCountStarWithFilterOnCastedString() .dataSource(CalciteTests.DATASOURCE1) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .filters(numericEquality("dim1", 2L, ColumnType.LONG)) + .filters(equality("dim1", 2L, ColumnType.LONG)) .aggregators(aggregators(new CountAggregatorFactory("a0"))) .context(QUERY_CONTEXT_DEFAULT) .build() @@ -7188,7 +6551,7 @@ public void testCountStarWithNotOfComplexDisjointTimeFilter() .build() ), ImmutableList.of( - new Object[]{NullHandling.replaceWithDefault() ? 5L : 4L} + new Object[]{4L} ) ); } @@ -7241,7 +6604,7 @@ public void testCountStarWithTimeAndDimFilter() .build() ), ImmutableList.of( - new Object[]{NullHandling.replaceWithDefault() ? 2L : 1L} + new Object[]{1L} ) ); } @@ -7276,7 +6639,7 @@ public void testCountStarWithTimeOrDimFilter() .build() ), ImmutableList.of( - NullHandling.replaceWithDefault() ? new Object[]{5L} : new Object[]{4L} + new Object[]{4L} ) ); } @@ -7599,7 +6962,7 @@ public void testExactCountDistinct() .build() ), ImmutableList.of( - new Object[]{NullHandling.replaceWithDefault() ? 2L : 3L} + new Object[]{3L} ) ); } @@ -7607,10 +6970,8 @@ public void testExactCountDistinct() @Test public void testApproxCountDistinctWhenHllDisabled() { - if (NullHandling.sqlCompatible()) { - // Empty string isn't counted properly; see https://github.com/apache/druid/issues/13950 - msqIncompatible(); - } + // Empty string isn't counted properly; see https://github.com/apache/druid/issues/13950 + msqIncompatible(); // When HLL is disabled, APPROX_COUNT_DISTINCT is still approximate. testQuery( @@ -7645,10 +7006,8 @@ public void testApproxCountDistinctWhenHllDisabled() @Test public void testApproxCountDistinctBuiltin() { - if (NullHandling.sqlCompatible()) { - // Empty string isn't counted properly; see https://github.com/apache/druid/issues/13950 - msqIncompatible(); - } + // Empty string isn't counted properly; see https://github.com/apache/druid/issues/13950 + msqIncompatible(); testQuery( "SELECT APPROX_COUNT_DISTINCT_BUILTIN(dim2) FROM druid.foo", @@ -7677,7 +7036,7 @@ public void testApproxCountDistinctBuiltin() ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.AGG_COL_EXCHANGE, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.AGG_COL_EXCHANGE) @Test public void testExactCountDistinctWithGroupingAndOtherAggregators() { @@ -7717,12 +7076,6 @@ public void testExactCountDistinctWithGroupingAndOtherAggregators() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{"", 3L, 3L}, - new Object[]{"a", 2L, 1L}, - new Object[]{"abc", 1L, 1L} - ) : ImmutableList.of( new Object[]{null, 2L, 2L}, new Object[]{"", 1L, 1L}, @@ -7732,7 +7085,7 @@ public void testExactCountDistinctWithGroupingAndOtherAggregators() ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.AGG_COL_EXCHANGE, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.AGG_COL_EXCHANGE) @Test public void testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin() { @@ -7809,12 +7162,10 @@ public void testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJo .setInterval(querySegmentSpec(Filtration.eternity())) .setDimensions(new DefaultDimensionSpec("d0", "_d0", ColumnType.STRING)) .setAggregatorSpecs( - NullHandling.sqlCompatible() - ? new FilteredAggregatorFactory( + new FilteredAggregatorFactory( new CountAggregatorFactory("a0"), new NotDimFilter(isNull("d1", null)) ) - : new CountAggregatorFactory("a0") ) .build() ), @@ -7829,22 +7180,16 @@ public void testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJo .columnTypes(ColumnType.STRING, ColumnType.LONG, ColumnType.LONG, ColumnType.LONG) .build() ), - NullHandling.sqlCompatible() - ? ImmutableList.of( + ImmutableList.of( new Object[]{null, 2L, 2L, 1L}, new Object[]{"", 1L, 1L, 1L}, new Object[]{"a", 2L, 2L, 1L}, new Object[]{"abc", 1L, 1L, 1L} ) - : ImmutableList.of( - new Object[]{"", 3L, 3L, 1L}, - new Object[]{"a", 2L, 1L, 1L}, - new Object[]{"abc", 1L, 1L, 1L} - ) ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.EQUIV_PLAN_EXTRA_COLUMNS, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.EQUIV_PLAN_EXTRA_COLUMNS) @Test public void testTimeFilterOnSubquery() { @@ -8051,10 +7396,6 @@ public void testApproxCountDistinct() .context(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{6L, 3L, 2L, 2L, 2L, 6L} - ) : ImmutableList.of( new Object[]{6L, 3L, 2L, 1L, 1L, 6L} ) @@ -8144,9 +7485,7 @@ public void testNestedGroupBy() )) .setAggregatorSpecs( aggregators( - useDefault - ? new CountAggregatorFactory("_a0") - : new FilteredAggregatorFactory( + new FilteredAggregatorFactory( new CountAggregatorFactory("_a0"), notNull("d1") ) @@ -8210,9 +7549,7 @@ public void testDoubleNestedGroupBy() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() - ? ImmutableList.of(new Object[]{6L, 3L}) - : ImmutableList.of(new Object[]{6L, 4L}) + ImmutableList.of(new Object[]{6L, 4L}) ); } @@ -8299,10 +7636,6 @@ public void testExactCountDistinctUsingSubquery() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{6L, 3L} - ) : ImmutableList.of( new Object[]{6L, 4L} ) @@ -8352,12 +7685,7 @@ public void testAvgDailyCountDistinct() .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) .setAggregatorSpecs( - useDefault - ? aggregators( - new DoubleSumAggregatorFactory("_a0:sum", "a0"), - new CountAggregatorFactory("_a0:count") - ) - : aggregators( + aggregators( new DoubleSumAggregatorFactory("_a0:sum", "a0"), new FilteredAggregatorFactory( new CountAggregatorFactory("_a0:count"), @@ -8405,37 +7733,6 @@ public void testHighestMaxNumericInFilter() assertTrue(exception.getMessage().contains("Expected parameter[maxNumericInFilters] cannot exceed system set value of [100]")); } - @Test - public void testQueryWithMoreThanMaxNumericInFilter() - { - assumeFalse( - NullHandling.sqlCompatible(), - "skip in sql compatible mode, this plans to an OR filter with equality filter children" - ); - msqIncompatible(); - - Throwable exception = assertThrows(UOE.class, () -> { - testQuery( - PLANNER_CONFIG_MAX_NUMERIC_IN_FILTER, - ImmutableMap.of(QueryContexts.MAX_NUMERIC_IN_FILTERS, 2), - "SELECT COUNT(*)\n" - + "FROM druid.numfoo\n" - + "WHERE dim6 IN (\n" - + "1,2,3\n" - + ")\n", - CalciteTests.REGULAR_USER_AUTH_RESULT, - ImmutableList.of(), - ImmutableList.of() - ); - }); - assertTrue( - exception.getMessage().contains( - "The number of values in the IN clause for [dim6] in query exceeds configured " - + "maxNumericFilter limit of [2] for INs. Cast [3] values of IN clause to String" - ) - ); - } - @Test public void testExactCountDistinctUsingSubqueryWithWherePushDown() { @@ -8508,10 +7805,6 @@ public void testExactCountDistinctUsingSubqueryWithWherePushDown() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{3L, 2L} - ) : ImmutableList.of( new Object[]{4L, 3L} ) @@ -8599,12 +7892,6 @@ public void testHistogramUsingSubquery() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{"1", 1L}, - new Object[]{"2", 1L}, - new Object[]{"3", 1L} - ) : ImmutableList.of( new Object[]{"1", 2L}, new Object[]{"2", 2L} @@ -8654,11 +7941,6 @@ public void testHistogramUsingSubqueryWithSort() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{"1", 1L}, - new Object[]{"2", 1L} - ) : ImmutableList.of( new Object[]{"1", 2L}, new Object[]{"2", 2L} @@ -8669,10 +7951,8 @@ public void testHistogramUsingSubqueryWithSort() @Test public void testCountDistinctArithmetic() { - if (NullHandling.sqlCompatible()) { - // Empty string isn't counted properly; see https://github.com/apache/druid/issues/13950 - msqIncompatible(); - } + // Empty string isn't counted properly; see https://github.com/apache/druid/issues/13950 + msqIncompatible(); testQuery( "SELECT\n" @@ -8844,19 +8124,13 @@ public void testRegexpExtract() ) ) ) - .setContext(QUERY_CONTEXT_DEFAULT); - if (NullHandling.sqlCompatible()) { - builder = builder.setVirtualColumns( - expressionVirtualColumn("v0", "regexp_extract(\"dim1\",'^(.)',1)", ColumnType.STRING) - ) - .setDimFilter( - not(equality("v0", "x", ColumnType.STRING)) - ); - } else { - builder = builder.setDimFilter( - not(selector("dim1", "x", new RegexDimExtractionFn("^(.)", 1, true, null))) - ); - } + .setContext(QUERY_CONTEXT_DEFAULT) + .setVirtualColumns( + expressionVirtualColumn("v0", "regexp_extract(\"dim1\",'^(.)',1)", ColumnType.STRING) + ) + .setDimFilter( + not(equality("v0", "x", ColumnType.STRING)) + ); testQuery( "SELECT DISTINCT\n" @@ -8865,16 +8139,7 @@ public void testRegexpExtract() + "FROM foo\n" + "WHERE REGEXP_EXTRACT(dim1, '^(.)', 1) <> 'x'", ImmutableList.of(builder.build()), - NullHandling.replaceWithDefault() - ? ImmutableList.of( - new Object[]{NULL_STRING, NULL_STRING}, - new Object[]{"1", "1"}, - new Object[]{"2", "2"}, - new Object[]{"a", "a"}, - new Object[]{"d", "d"} - ) - // sql compatible mode expression filter (correctly) leaves out nulls - : ImmutableList.of( + ImmutableList.of( new Object[]{"1", "1"}, new Object[]{"2", "2"}, new Object[]{"a", "a"}, @@ -8910,33 +8175,17 @@ public void testRegexpExtractFilterViaNotNullCheck() .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) .aggregators(new CountAggregatorFactory("a0")) - .context(QUERY_CONTEXT_DEFAULT); - if (NullHandling.sqlCompatible()) { - builder = builder.virtualColumns( - expressionVirtualColumn("v0", "regexp_extract(\"dim1\",'^1')", ColumnType.STRING), - expressionVirtualColumn("v1", "regexp_extract(concat('Z',\"dim1\"),'^Z2')", ColumnType.STRING) - ) - .filters( - or( - notNull("v0"), - notNull("v1") - ) - ); - } else { - builder = builder.virtualColumns( - expressionVirtualColumn("v0", "regexp_extract(concat('Z',\"dim1\"),'^Z2')", ColumnType.STRING) - ) - .filters( - or( - not(selector( - "dim1", - NullHandling.defaultStringValue(), - new RegexDimExtractionFn("^1", 0, true, null) - )), - notNull("v0") - ) - ); - } + .context(QUERY_CONTEXT_DEFAULT) + .virtualColumns( + expressionVirtualColumn("v0", "regexp_extract(\"dim1\",'^1')", ColumnType.STRING), + expressionVirtualColumn("v1", "regexp_extract(concat('Z',\"dim1\"),'^Z2')", ColumnType.STRING) + ) + .filters( + or( + notNull("v0"), + notNull("v1") + ) + ); testQuery( "SELECT COUNT(*)\n" + "FROM foo\n" @@ -9015,7 +8264,7 @@ public void testGroupBySortPushDown() ImmutableList.of( new Object[]{"a", "", 1L}, new Object[]{"a", "1", 1L}, - new Object[]{NULL_STRING, "10.1", 1L}, + new Object[]{null, "10.1", 1L}, new Object[]{"", "2", 1L} ) ); @@ -9059,13 +8308,6 @@ public void testGroupByLimitPushDownWithHavingOnLong() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{"10.1", "", 1L}, - new Object[]{"2", "", 1L}, - new Object[]{"abc", "", 1L}, - new Object[]{"", "a", 1L} - ) : ImmutableList.of( new Object[]{"10.1", null, 1L}, new Object[]{"abc", null, 1L}, @@ -9075,7 +8317,7 @@ public void testGroupByLimitPushDownWithHavingOnLong() ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN) @Test public void testGroupByLimitPushdownExtraction() { @@ -9502,7 +8744,7 @@ public void testGroupByFloor() .build() ), ImmutableList.of( - new Object[]{NullHandling.defaultFloatValue(), 3L}, + new Object[]{null, 3L}, new Object[]{1.0f, 1L}, new Object[]{2.0f, 1L}, new Object[]{10.0f, 1L} @@ -9658,7 +8900,7 @@ public void testGroupByFloorWithOrderBy() new Object[]{10.0f, 1L}, new Object[]{2.0f, 1L}, new Object[]{1.0f, 1L}, - new Object[]{NullHandling.defaultFloatValue(), 3L} + new Object[]{null, 3L} ) ); } @@ -9774,14 +9016,6 @@ public void testGroupByFloorTimeAndOneOtherDimensionWithOrderBy() .setContext(withTimestampResultContext(QUERY_CONTEXT_DEFAULT, "d0", 0, Granularities.YEAR)) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{timestamp("2000"), "", 2L}, - new Object[]{timestamp("2000"), "a", 1L}, - new Object[]{timestamp("2001"), "", 1L}, - new Object[]{timestamp("2001"), "a", 1L}, - new Object[]{timestamp("2001"), "abc", 1L} - ) : ImmutableList.of( new Object[]{timestamp("2000"), null, 1L}, new Object[]{timestamp("2000"), "", 1L}, @@ -10279,7 +9513,6 @@ public void testTimeseriesDontSkipEmptyBuckets() { msqIncompatible(); // Tests that query context parameters are passed through to the underlying query engine. - Long defaultVal = NullHandling.replaceWithDefault() ? 0L : null; testQuery( PLANNER_CONFIG_DEFAULT, QUERY_CONTEXT_DONT_SKIP_EMPTY_BUCKETS, @@ -10301,29 +9534,29 @@ public void testTimeseriesDontSkipEmptyBuckets() ), ImmutableList.builder() .add(new Object[]{1L, timestamp("2000-01-01")}) - .add(new Object[]{defaultVal, timestamp("2000-01-01T01")}) - .add(new Object[]{defaultVal, timestamp("2000-01-01T02")}) - .add(new Object[]{defaultVal, timestamp("2000-01-01T03")}) - .add(new Object[]{defaultVal, timestamp("2000-01-01T04")}) - .add(new Object[]{defaultVal, timestamp("2000-01-01T05")}) - .add(new Object[]{defaultVal, timestamp("2000-01-01T06")}) - .add(new Object[]{defaultVal, timestamp("2000-01-01T07")}) - .add(new Object[]{defaultVal, timestamp("2000-01-01T08")}) - .add(new Object[]{defaultVal, timestamp("2000-01-01T09")}) - .add(new Object[]{defaultVal, timestamp("2000-01-01T10")}) - .add(new Object[]{defaultVal, timestamp("2000-01-01T11")}) - .add(new Object[]{defaultVal, timestamp("2000-01-01T12")}) - .add(new Object[]{defaultVal, timestamp("2000-01-01T13")}) - .add(new Object[]{defaultVal, timestamp("2000-01-01T14")}) - .add(new Object[]{defaultVal, timestamp("2000-01-01T15")}) - .add(new Object[]{defaultVal, timestamp("2000-01-01T16")}) - .add(new Object[]{defaultVal, timestamp("2000-01-01T17")}) - .add(new Object[]{defaultVal, timestamp("2000-01-01T18")}) - .add(new Object[]{defaultVal, timestamp("2000-01-01T19")}) - .add(new Object[]{defaultVal, timestamp("2000-01-01T20")}) - .add(new Object[]{defaultVal, timestamp("2000-01-01T21")}) - .add(new Object[]{defaultVal, timestamp("2000-01-01T22")}) - .add(new Object[]{defaultVal, timestamp("2000-01-01T23")}) + .add(new Object[]{null, timestamp("2000-01-01T01")}) + .add(new Object[]{null, timestamp("2000-01-01T02")}) + .add(new Object[]{null, timestamp("2000-01-01T03")}) + .add(new Object[]{null, timestamp("2000-01-01T04")}) + .add(new Object[]{null, timestamp("2000-01-01T05")}) + .add(new Object[]{null, timestamp("2000-01-01T06")}) + .add(new Object[]{null, timestamp("2000-01-01T07")}) + .add(new Object[]{null, timestamp("2000-01-01T08")}) + .add(new Object[]{null, timestamp("2000-01-01T09")}) + .add(new Object[]{null, timestamp("2000-01-01T10")}) + .add(new Object[]{null, timestamp("2000-01-01T11")}) + .add(new Object[]{null, timestamp("2000-01-01T12")}) + .add(new Object[]{null, timestamp("2000-01-01T13")}) + .add(new Object[]{null, timestamp("2000-01-01T14")}) + .add(new Object[]{null, timestamp("2000-01-01T15")}) + .add(new Object[]{null, timestamp("2000-01-01T16")}) + .add(new Object[]{null, timestamp("2000-01-01T17")}) + .add(new Object[]{null, timestamp("2000-01-01T18")}) + .add(new Object[]{null, timestamp("2000-01-01T19")}) + .add(new Object[]{null, timestamp("2000-01-01T20")}) + .add(new Object[]{null, timestamp("2000-01-01T21")}) + .add(new Object[]{null, timestamp("2000-01-01T22")}) + .add(new Object[]{null, timestamp("2000-01-01T23")}) .build() ); } @@ -10437,7 +9670,7 @@ public void testTimeseriesEmptyResultsAggregatorDefaultValues() Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) - .filters(numericEquality("dim2", 0L, ColumnType.LONG)) + .filters(equality("dim2", 0L, ColumnType.LONG)) .granularity(Granularities.ALL) .aggregators( aggregators( @@ -10464,16 +9697,12 @@ public void testTimeseriesEmptyResultsAggregatorDefaultValues() new LongMaxAggregatorFactory("a7", "l1"), new LongMinAggregatorFactory("a8", "l1"), new DoubleSumAggregatorFactory("a9:sum", "l1"), - useDefault - ? new CountAggregatorFactory("a9:count") - : new FilteredAggregatorFactory( + new FilteredAggregatorFactory( new CountAggregatorFactory("a9:count"), notNull("l1") ), new DoubleSumAggregatorFactory("a10:sum", "dbl1"), - useDefault - ? new CountAggregatorFactory("a10:count") - : new FilteredAggregatorFactory( + new FilteredAggregatorFactory( new CountAggregatorFactory("a10:count"), notNull("dbl1") ) @@ -10501,21 +9730,7 @@ public void testTimeseriesEmptyResultsAggregatorDefaultValues() .build() ), ImmutableList.of( - useDefault - ? new Object[]{ - 0L, - 0L, - 0L, - 0.0, - Double.NEGATIVE_INFINITY, - Double.POSITIVE_INFINITY, - 0L, - Long.MIN_VALUE, - Long.MAX_VALUE, - Double.NaN, - Double.NaN - } - : new Object[]{0L, 0L, 0L, null, null, null, null, null, null, null, null} + new Object[]{0L, 0L, 0L, null, null, null, null, null, null, null, null} ) ); } @@ -10547,7 +9762,7 @@ public void testTimeseriesEmptyResultsAggregatorDefaultValuesNonVectorized() Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) - .filters(numericEquality("dim2", 0L, ColumnType.LONG)) + .filters(equality("dim2", 0L, ColumnType.LONG)) .granularity(Granularities.ALL) .aggregators( aggregators( @@ -10618,7 +9833,7 @@ public void testTimeseriesEmptyResultsAggregatorDefaultValuesNonVectorized() "__acc", "0", "0", - NullHandling.sqlCompatible(), + true, false, false, "bitwiseAnd(\"__acc\", \"l1\")", @@ -10637,7 +9852,7 @@ public void testTimeseriesEmptyResultsAggregatorDefaultValuesNonVectorized() "__acc", "0", "0", - NullHandling.sqlCompatible(), + true, false, false, "bitwiseOr(\"__acc\", \"l1\")", @@ -10656,7 +9871,7 @@ public void testTimeseriesEmptyResultsAggregatorDefaultValuesNonVectorized() "__acc", "0", "0", - NullHandling.sqlCompatible(), + true, false, false, "bitwiseXor(\"__acc\", \"l1\")", @@ -10674,9 +9889,7 @@ public void testTimeseriesEmptyResultsAggregatorDefaultValuesNonVectorized() .build() ), ImmutableList.of( - useDefault - ? new Object[]{"", 0L, "", 0L, "", 0L, null, "", "", 0L, 0L, 0L} - : new Object[]{null, null, null, null, null, null, null, null, null, null, null, null} + new Object[]{null, null, null, null, null, null, null, null, null, null, null, null} ) ); } @@ -10762,12 +9975,7 @@ public void testGroupByAggregatorDefaultValues() new DoubleSumAggregatorFactory("a9:sum", "l1"), equality("dim1", "nonexistent", ColumnType.STRING) ), - useDefault - ? new FilteredAggregatorFactory( - new CountAggregatorFactory("a9:count"), - equality("dim1", "nonexistent", ColumnType.STRING) - ) - : new FilteredAggregatorFactory( + new FilteredAggregatorFactory( new CountAggregatorFactory("a9:count"), and( notNull("l1"), @@ -10778,12 +9986,7 @@ public void testGroupByAggregatorDefaultValues() new DoubleSumAggregatorFactory("a10:sum", "dbl1"), equality("dim1", "nonexistent", ColumnType.STRING) ), - useDefault - ? new FilteredAggregatorFactory( - new CountAggregatorFactory("a10:count"), - equality("dim1", "nonexistent", ColumnType.STRING) - ) - : new FilteredAggregatorFactory( + new FilteredAggregatorFactory( new CountAggregatorFactory("a10:count"), and( notNull("dbl1"), @@ -10816,22 +10019,7 @@ public void testGroupByAggregatorDefaultValues() .build() ), ImmutableList.of( - useDefault - ? new Object[]{ - "a", - 0L, - 0L, - 0L, - 0.0, - Double.NEGATIVE_INFINITY, - Double.POSITIVE_INFINITY, - 0L, - Long.MIN_VALUE, - Long.MAX_VALUE, - Double.NaN, - Double.NaN - } - : new Object[]{"a", 0L, 0L, 0L, null, null, null, null, null, null, null, null} + new Object[]{"a", 0L, 0L, 0L, null, null, null, null, null, null, null, null} ) ); } @@ -10961,7 +10149,7 @@ public void testGroupByAggregatorDefaultValuesNonVectorized() "__acc", "0", "0", - NullHandling.sqlCompatible(), + true, false, false, "bitwiseAnd(\"__acc\", \"l1\")", @@ -10983,7 +10171,7 @@ public void testGroupByAggregatorDefaultValuesNonVectorized() "__acc", "0", "0", - NullHandling.sqlCompatible(), + true, false, false, "bitwiseOr(\"__acc\", \"l1\")", @@ -11005,7 +10193,7 @@ public void testGroupByAggregatorDefaultValuesNonVectorized() "__acc", "0", "0", - NullHandling.sqlCompatible(), + true, false, false, "bitwiseXor(\"__acc\", \"l1\")", @@ -11026,9 +10214,7 @@ public void testGroupByAggregatorDefaultValuesNonVectorized() .build() ), ImmutableList.of( - useDefault - ? new Object[]{"a", "", 0L, "", 0L, "", 0L, null, "", "", 0L, 0L, 0L} - : new Object[]{"a", null, null, null, null, null, null, null, null, null, null, null, null} + new Object[]{"a", null, null, null, null, null, null, null, null, null, null, null, null} ) ); } @@ -11364,14 +10550,6 @@ public void testGroupByTimeAndOtherDimension() .setContext(withTimestampResultContext(QUERY_CONTEXT_DEFAULT, "d1", 1, Granularities.MONTH)) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{"", timestamp("2000-01-01"), 2L}, - new Object[]{"", timestamp("2001-01-01"), 1L}, - new Object[]{"a", timestamp("2000-01-01"), 1L}, - new Object[]{"a", timestamp("2001-01-01"), 1L}, - new Object[]{"abc", timestamp("2001-01-01"), 1L} - ) : ImmutableList.of( new Object[]{null, timestamp("2000-01-01"), 1L}, new Object[]{null, timestamp("2001-01-01"), 1L}, @@ -11431,14 +10609,6 @@ public void testGroupByTimeAndOtherDimensionDontUseGranularity() .setContext(context) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{"", timestamp("2000-01-01"), 2L}, - new Object[]{"", timestamp("2001-01-01"), 1L}, - new Object[]{"a", timestamp("2000-01-01"), 1L}, - new Object[]{"a", timestamp("2001-01-01"), 1L}, - new Object[]{"abc", timestamp("2001-01-01"), 1L} - ) : ImmutableList.of( new Object[]{null, timestamp("2000-01-01"), 1L}, new Object[]{null, timestamp("2001-01-01"), 1L}, @@ -11450,7 +10620,7 @@ public void testGroupByTimeAndOtherDimensionDontUseGranularity() ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN) @Test public void testGroupByTimeFloorAndDimOnGroupByTimeFloorAndDim() { @@ -11536,13 +10706,6 @@ public void testGroupByTimeFloorAndDimOnGroupByTimeFloorAndDim() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{"", timestamp("2001-01-01"), 6.0}, - new Object[]{"", timestamp("2000-01-01"), 5.0}, - new Object[]{"a", timestamp("2001-01-01"), 4.0}, - new Object[]{"abc", timestamp("2001-01-01"), 5.0} - ) : ImmutableList.of( new Object[]{null, timestamp("2001-01-01"), 6.0}, new Object[]{null, timestamp("2000-01-01"), 2.0}, @@ -11609,9 +10772,9 @@ public void testGroupingSets() new Object[]{"", null, 3L, 1L}, new Object[]{"a", null, 2L, 1L}, new Object[]{"abc", null, 1L, 1L}, - new Object[]{NULL_STRING, timestamp("2000-01-01"), 3L, 2L}, - new Object[]{NULL_STRING, timestamp("2001-01-01"), 3L, 2L}, - new Object[]{NULL_STRING, null, 6L, 3L} + new Object[]{null, timestamp("2000-01-01"), 3L, 2L}, + new Object[]{null, timestamp("2001-01-01"), 3L, 2L}, + new Object[]{null, null, 6L, 3L} ) ); } @@ -11673,9 +10836,9 @@ public void testGroupingAggregatorDifferentOrder() new Object[]{"", null, 3L, 2L}, new Object[]{"a", null, 2L, 2L}, new Object[]{"abc", null, 1L, 2L}, - new Object[]{NULL_STRING, timestamp("2000-01-01"), 3L, 1L}, - new Object[]{NULL_STRING, timestamp("2001-01-01"), 3L, 1L}, - new Object[]{NULL_STRING, null, 6L, 3L} + new Object[]{null, timestamp("2000-01-01"), 3L, 1L}, + new Object[]{null, timestamp("2001-01-01"), 3L, 1L}, + new Object[]{null, null, 6L, 3L} ) ); } @@ -11684,23 +10847,13 @@ public void testGroupingAggregatorDifferentOrder() public void testGroupingAggregatorWithPostAggregator() { msqIncompatible(); - List resultList; - if (NullHandling.sqlCompatible()) { - resultList = ImmutableList.of( - new Object[]{NULL_STRING, 2L, 0L, NULL_STRING}, - new Object[]{"", 1L, 0L, ""}, - new Object[]{"a", 2L, 0L, "a"}, - new Object[]{"abc", 1L, 0L, "abc"}, - new Object[]{NULL_STRING, 6L, 1L, "ALL"} - ); - } else { - resultList = ImmutableList.of( - new Object[]{"", 3L, 0L, ""}, - new Object[]{"a", 2L, 0L, "a"}, - new Object[]{"abc", 1L, 0L, "abc"}, - new Object[]{NULL_STRING, 6L, 1L, "ALL"} - ); - } + List resultList = ImmutableList.of( + new Object[]{null, 2L, 0L, null}, + new Object[]{"", 1L, 0L, ""}, + new Object[]{"a", 2L, 0L, "a"}, + new Object[]{"abc", 1L, 0L, "abc"}, + new Object[]{null, 6L, 1L, "ALL"} + ); testQuery( "SELECT dim2, SUM(cnt), GROUPING(dim2), \n" + "CASE WHEN GROUPING(dim2) = 1 THEN 'ALL' ELSE dim2 END\n" @@ -11822,7 +10975,7 @@ public void testGroupByRollup() new Object[]{"", null, 3L}, new Object[]{"a", null, 2L}, new Object[]{"abc", null, 1L}, - new Object[]{NULL_STRING, null, 6L} + new Object[]{null, null, 6L} ) ); } @@ -11876,9 +11029,9 @@ public void testGroupByRollupDifferentOrder() new Object[]{"", timestamp("2001-01-01"), 1L}, new Object[]{"a", timestamp("2001-01-01"), 1L}, new Object[]{"abc", timestamp("2001-01-01"), 1L}, - new Object[]{NULL_STRING, timestamp("2000-01-01"), 3L}, - new Object[]{NULL_STRING, timestamp("2001-01-01"), 3L}, - new Object[]{NULL_STRING, null, 6L} + new Object[]{null, timestamp("2000-01-01"), 3L}, + new Object[]{null, timestamp("2001-01-01"), 3L}, + new Object[]{null, null, 6L} ) ); } @@ -11936,9 +11089,9 @@ public void testGroupByCube() new Object[]{"", null, 3L}, new Object[]{"a", null, 2L}, new Object[]{"abc", null, 1L}, - new Object[]{NULL_STRING, timestamp("2000-01-01"), 3L}, - new Object[]{NULL_STRING, timestamp("2001-01-01"), 3L}, - new Object[]{NULL_STRING, null, 6L} + new Object[]{null, timestamp("2000-01-01"), 3L}, + new Object[]{null, timestamp("2001-01-01"), 3L}, + new Object[]{null, null, 6L} ) ); } @@ -11996,9 +11149,9 @@ public void testGroupingSetsWithDummyDimension() new Object[]{"", null, 3L}, new Object[]{"a", null, 2L}, new Object[]{"abc", null, 1L}, - new Object[]{NULL_STRING, null, 6L}, - new Object[]{NULL_STRING, timestamp("2000-01-01"), 3L}, - new Object[]{NULL_STRING, timestamp("2001-01-01"), 3L} + new Object[]{null, null, 6L}, + new Object[]{null, timestamp("2000-01-01"), 3L}, + new Object[]{null, timestamp("2001-01-01"), 3L} ) ); } @@ -12051,9 +11204,9 @@ public void testGroupingSetsNoSuperset() new Object[]{"", null, 3L}, new Object[]{"a", null, 2L}, new Object[]{"abc", null, 1L}, - new Object[]{NULL_STRING, timestamp("2000-01-01"), 3L}, - new Object[]{NULL_STRING, timestamp("2001-01-01"), 3L}, - new Object[]{NULL_STRING, null, 6L} + new Object[]{null, timestamp("2000-01-01"), 3L}, + new Object[]{null, timestamp("2001-01-01"), 3L}, + new Object[]{null, null, 6L} ) ); } @@ -12123,9 +11276,9 @@ public void testGroupingSetsWithOrderByDimension() new Object[]{"abc", null, 1L}, new Object[]{"a", null, 2L}, new Object[]{"", null, 3L}, - new Object[]{NULL_STRING, null, 6L}, - new Object[]{NULL_STRING, timestamp("2000-01-01"), 3L}, - new Object[]{NULL_STRING, timestamp("2001-01-01"), 3L} + new Object[]{null, null, 6L}, + new Object[]{null, timestamp("2000-01-01"), 3L}, + new Object[]{null, timestamp("2001-01-01"), 3L} ) ); } @@ -12190,9 +11343,9 @@ public void testGroupingSetsWithOrderByAggregator() new Object[]{"abc", null, 1L}, new Object[]{"a", null, 2L}, new Object[]{"", null, 3L}, - new Object[]{NULL_STRING, timestamp("2000-01-01"), 3L}, - new Object[]{NULL_STRING, timestamp("2001-01-01"), 3L}, - new Object[]{NULL_STRING, null, 6L} + new Object[]{null, timestamp("2000-01-01"), 3L}, + new Object[]{null, timestamp("2001-01-01"), 3L}, + new Object[]{null, null, 6L} ) ); } @@ -12454,9 +11607,9 @@ public void testProjectAfterSort2() ImmutableList.of( new Object[]{1.0, "", "a", 1.0}, new Object[]{4.0, "1", "a", 4.0}, - new Object[]{2.0, "10.1", NullHandling.defaultStringValue(), 2.0}, + new Object[]{2.0, "10.1", null, 2.0}, new Object[]{3.0, "2", "", 3.0}, - new Object[]{6.0, "abc", NullHandling.defaultStringValue(), 6.0}, + new Object[]{6.0, "abc", null, 6.0}, new Object[]{5.0, "def", "abc", 5.0} ) ); @@ -12584,9 +11737,7 @@ public void testSortProjectAfterNestedGroupBy() ) .setAggregatorSpecs( aggregators( - useDefault - ? new CountAggregatorFactory("a0") - : new FilteredAggregatorFactory( + new FilteredAggregatorFactory( new CountAggregatorFactory("a0"), notNull("d2") ) @@ -12671,14 +11822,7 @@ public void testPostAggWithTopN() .dimension(new DefaultDimensionSpec("m1", "d0", ColumnType.FLOAT)) .filters(equality("dim2", "a", ColumnType.STRING)) .aggregators( - useDefault - ? aggregators( - new DoubleSumAggregatorFactory("a0:sum", "m2"), - new CountAggregatorFactory("a0:count"), - new DoubleSumAggregatorFactory("a1", "m1"), - new DoubleSumAggregatorFactory("a2", "m2") - ) - : aggregators( + aggregators( new DoubleSumAggregatorFactory("a0:sum", "m2"), new FilteredAggregatorFactory( new CountAggregatorFactory("a0:count"), @@ -12765,11 +11909,11 @@ public void testConcat2() ), ImmutableList.of( new Object[]{"axy1.09999"}, - new Object[]{NullHandling.sqlCompatible() ? null : "10.1xy2.0999910.1"}, // dim2 is null + new Object[]{null}, // dim2 is null new Object[]{"2xy3.099992"}, new Object[]{"1axy4.099991"}, new Object[]{"defabcxy5.09999def"}, - new Object[]{NullHandling.sqlCompatible() ? null : "abcxy6.09999abc"} // dim2 is null + new Object[]{null} // dim2 is null ) ); } @@ -12807,25 +11951,13 @@ public void testConcatGroup() @Test public void testConcatGroup2() { - final List results; - if (useDefault) { - results = ImmutableList.of( - new Object[]{"10.1x2.0999910.1"}, - new Object[]{"1ax4.099991"}, - new Object[]{"2x3.099992"}, - new Object[]{"abcx6.09999abc"}, - new Object[]{"ax1.09999"}, - new Object[]{"defabcx5.09999def"} - ); - } else { - results = ImmutableList.of( - new Object[]{null}, - new Object[]{"1ax4.099991"}, - new Object[]{"2x3.099992"}, - new Object[]{"ax1.09999"}, - new Object[]{"defabcx5.09999def"} - ); - } + final List results = ImmutableList.of( + new Object[]{null}, + new Object[]{"1ax4.099991"}, + new Object[]{"2x3.099992"}, + new Object[]{"ax1.09999"}, + new Object[]{"defabcx5.09999def"} + ); testQuery( "SELECT CONCAT(dim1, CONCAT(dim2,'x'), m2, 9999, dim1) as dimX FROM foo GROUP BY 1", @@ -12891,8 +12023,7 @@ public void testConcatDecomposeAlwaysFalseOrUnknownNegated() ColumnType.STRING )) .filters( - NullHandling.sqlCompatible() - ? and( + and( or( not(equality("dim1", "3", ColumnType.STRING)), not(equality("dim2", "4", ColumnType.STRING)) @@ -12904,16 +12035,6 @@ public void testConcatDecomposeAlwaysFalseOrUnknownNegated() notNull("dim1"), notNull("dim2") ) - : and( - or( - not(equality("dim1", "3", ColumnType.STRING)), - not(equality("dim2", "4", ColumnType.STRING)) - ), - or( - not(equality("dim1", "4", ColumnType.STRING)), - not(equality("dim2", "5", ColumnType.STRING)) - ) - ) ) .columns("v0") .columnTypes(ColumnType.STRING) @@ -12921,21 +12042,12 @@ public void testConcatDecomposeAlwaysFalseOrUnknownNegated() .context(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.sqlCompatible() - ? ImmutableList.of( + ImmutableList.of( new Object[]{"xa"}, new Object[]{"2x"}, new Object[]{"1xa"}, new Object[]{"defxabc"} ) - : ImmutableList.of( - new Object[]{"xa"}, - new Object[]{"10.1x"}, - new Object[]{"2x"}, - new Object[]{"1xa"}, - new Object[]{"defxabc"}, - new Object[]{"abcx"} - ) ); } @@ -12947,8 +12059,7 @@ public void testConcatDecomposeIsNull() + "FROM foo\n" + "WHERE CONCAT(dim1, 'x', dim2) IS NULL", ImmutableList.of( - NullHandling.sqlCompatible() - ? newScanQueryBuilder() + newScanQueryBuilder() .dataSource(CalciteTests.DATASOURCE1) .intervals(querySegmentSpec(Filtration.eternity())) .virtualColumns(expressionVirtualColumn( @@ -12962,30 +12073,11 @@ public void testConcatDecomposeIsNull() .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) .context(QUERY_CONTEXT_DEFAULT) .build() - : Druids.newScanQueryBuilder() - .dataSource( - InlineDataSource.fromIterable( - ImmutableList.of(), - RowSignature.builder() - .add("dim1", ColumnType.STRING) - .add("dim2", ColumnType.STRING) - .add("dimX", ColumnType.STRING) - .build() - ) - ) - .intervals(querySegmentSpec(Filtration.eternity())) - .columns("dim1", "dim2", "dimX") - .columnTypes(ColumnType.STRING, ColumnType.STRING, ColumnType.STRING) - .resultFormat(ResultFormat.RESULT_FORMAT_COMPACTED_LIST) - .build() - ), - NullHandling.sqlCompatible() - ? ImmutableList.of( + ImmutableList.of( new Object[]{"10.1", null, null}, new Object[]{"abc", null, null} ) - : ImmutableList.of() ); } @@ -13142,10 +12234,6 @@ public void testRequireTimeConditionPositive2() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{6L, 3L} - ) : ImmutableList.of( new Object[]{6L, 4L} ) @@ -13392,7 +12480,7 @@ public void testTrigonometricFunction() ImmutableList.of(Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE1) .intervals(querySegmentSpec(Filtration.eternity())) - .filters(numericEquality("dim2", 0L, ColumnType.LONG)) + .filters(equality("dim2", 0L, ColumnType.LONG)) .granularity(Granularities.ALL) .aggregators(aggregators( new CountAggregatorFactory("a0") @@ -13567,13 +12655,6 @@ public void testNvlColumns() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{"10.1", 1L}, - new Object[]{"2", 1L}, - new Object[]{"a", 2L}, - new Object[]{"abc", 2L} - ) : ImmutableList.of( new Object[]{"", 1L}, new Object[]{"10.1", 1L}, @@ -13641,7 +12722,7 @@ public void testGroupByWithLiteralInSubqueryGrouping() .build() ), ImmutableList.of( - new Object[]{"dummy", NULL_STRING}, + new Object[]{"dummy", null}, new Object[]{"dummy", "b"} ) ); @@ -13703,22 +12784,12 @@ public void testQueryContextOuterLimit() ) .context(outerLimitContext); - List results1; - if (NullHandling.replaceWithDefault()) { - results1 = ImmutableList.of( - new Object[]{""}, - new Object[]{"def"}, - new Object[]{"abc"}, - new Object[]{"2"} - ); - } else { - results1 = ImmutableList.of( - new Object[]{"def"}, - new Object[]{"abc"}, - new Object[]{"2"}, - new Object[]{"10.1"} - ); - } + List results1 = ImmutableList.of( + new Object[]{"def"}, + new Object[]{"abc"}, + new Object[]{"2"}, + new Object[]{"10.1"} + ); // no existing limit testQuery( @@ -13745,18 +12816,10 @@ public void testQueryContextOuterLimit() ); - List results2; - if (NullHandling.replaceWithDefault()) { - results2 = ImmutableList.of( - new Object[]{""}, - new Object[]{"def"} - ); - } else { - results2 = ImmutableList.of( - new Object[]{"def"}, - new Object[]{"abc"} - ); - } + List results2 = ImmutableList.of( + new Object[]{"def"}, + new Object[]{"abc"} + ); // existing limit less than context limit, keep existing limit testQuery( @@ -14045,9 +13108,9 @@ public void testGroupingSetsWithLimit() new Object[]{"", null, 3L}, new Object[]{"a", null, 2L}, new Object[]{"abc", null, 1L}, - new Object[]{NULL_STRING, timestamp("2000-01-01"), 3L}, - new Object[]{NULL_STRING, timestamp("2001-01-01"), 3L}, - new Object[]{NULL_STRING, null, 6L} + new Object[]{null, timestamp("2000-01-01"), 3L}, + new Object[]{null, timestamp("2001-01-01"), 3L}, + new Object[]{null, null, 6L} ) ); } @@ -14112,14 +13175,14 @@ public void testGroupingSetsWithLimitOrderByGran() new Object[]{"", null, 3L}, new Object[]{"a", null, 2L}, new Object[]{"abc", null, 1L}, - new Object[]{NULL_STRING, null, 6L}, + new Object[]{null, null, 6L}, new Object[]{"", timestamp("2000-01-01"), 2L}, new Object[]{"a", timestamp("2000-01-01"), 1L}, - new Object[]{NULL_STRING, timestamp("2000-01-01"), 3L}, + new Object[]{null, timestamp("2000-01-01"), 3L}, new Object[]{"", timestamp("2001-01-01"), 1L}, new Object[]{"a", timestamp("2001-01-01"), 1L}, new Object[]{"abc", timestamp("2001-01-01"), 1L}, - new Object[]{NULL_STRING, timestamp("2001-01-01"), 3L} + new Object[]{null, timestamp("2001-01-01"), 3L} ).build() ); } @@ -14142,8 +13205,7 @@ public void testRoundFunc() .context(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.sqlCompatible() - ? ImmutableList.of( + ImmutableList.of( new Object[]{1.0f, 1.0f}, new Object[]{0.1f, 0.0f}, new Object[]{0.0f, 0.0f}, @@ -14151,53 +13213,27 @@ public void testRoundFunc() new Object[]{null, null}, new Object[]{null, null} ) - : ImmutableList.of( - new Object[]{1.0f, 1.0f}, - new Object[]{0.1f, 0.0f}, - new Object[]{0.0f, 0.0f}, - new Object[]{0.0f, 0.0f}, - new Object[]{0.0f, 0.0f}, - new Object[]{0.0f, 0.0f} - ) ); } @Test public void testCountAndAverageByConstantVirtualColumn() { - List virtualColumns; - List aggs; - if (useDefault) { - aggs = ImmutableList.of( - new FilteredAggregatorFactory( - new CountAggregatorFactory("a0"), - notNull("v0") - ), - new DoubleSumAggregatorFactory("a1:sum", "v1", null, TestExprMacroTable.INSTANCE), - new CountAggregatorFactory("a1:count") - ); - virtualColumns = ImmutableList.of( - expressionVirtualColumn("v0", "'10.1'", ColumnType.STRING), - expressionVirtualColumn("v1", "325323", ColumnType.LONG) - ); - } else { - aggs = ImmutableList.of( - new FilteredAggregatorFactory( - new CountAggregatorFactory("a0"), - notNull("v0") - ), - new DoubleSumAggregatorFactory("a1:sum", "v1"), - new FilteredAggregatorFactory( - new CountAggregatorFactory("a1:count"), - notNull("v1") - ) - ); - virtualColumns = ImmutableList.of( - expressionVirtualColumn("v0", "'10.1'", ColumnType.STRING), - expressionVirtualColumn("v1", "325323", ColumnType.LONG) - ); - - } + List virtualColumns = ImmutableList.of( + expressionVirtualColumn("v0", "'10.1'", ColumnType.STRING), + expressionVirtualColumn("v1", "325323", ColumnType.LONG) + ); + List aggs = ImmutableList.of( + new FilteredAggregatorFactory( + new CountAggregatorFactory("a0"), + notNull("v0") + ), + new DoubleSumAggregatorFactory("a1:sum", "v1"), + new FilteredAggregatorFactory( + new CountAggregatorFactory("a1:count"), + notNull("v1") + ) + ); testQuery( "SELECT dim5, COUNT(dim1), AVG(l1) FROM druid.numfoo WHERE dim1 = '10.1' AND l1 = 325323 GROUP BY dim5", ImmutableList.of( @@ -14275,11 +13311,7 @@ public void testExpressionCounts() .build() ), ImmutableList.of( - useDefault - // in default mode strpos is 6 because the '+ 1' of the expression (no null numbers in - // default mode so is 0 + 1 for null rows) - ? new Object[]{3L, 3L, 6L} - : new Object[]{4L, 4L, 4L} + new Object[]{4L, 4L, 4L} ) ); } @@ -14308,7 +13340,7 @@ public void testBitwiseAggregatorsTimeseries() "__acc", "0", "0", - NullHandling.sqlCompatible(), + true, false, false, "bitwiseAnd(\"__acc\", \"l1\")", @@ -14327,7 +13359,7 @@ public void testBitwiseAggregatorsTimeseries() "__acc", "0", "0", - NullHandling.sqlCompatible(), + true, false, false, "bitwiseOr(\"__acc\", \"l1\")", @@ -14346,7 +13378,7 @@ public void testBitwiseAggregatorsTimeseries() "__acc", "0", "0", - NullHandling.sqlCompatible(), + true, false, false, "bitwiseXor(\"__acc\", \"l1\")", @@ -14364,9 +13396,7 @@ public void testBitwiseAggregatorsTimeseries() .build() ), ImmutableList.of( - useDefault - ? new Object[]{0L, 325327L, 325324L} - : new Object[]{0L, 325327L, 325324L} + new Object[]{0L, 325327L, 325324L} ) ); } @@ -14397,7 +13427,7 @@ public void testBitwiseAggregatorsGroupBy() "__acc", "0", "0", - NullHandling.sqlCompatible(), + true, false, false, "bitwiseAnd(\"__acc\", \"l1\")", @@ -14416,7 +13446,7 @@ public void testBitwiseAggregatorsGroupBy() "__acc", "0", "0", - NullHandling.sqlCompatible(), + true, false, false, "bitwiseOr(\"__acc\", \"l1\")", @@ -14435,7 +13465,7 @@ public void testBitwiseAggregatorsGroupBy() "__acc", "0", "0", - NullHandling.sqlCompatible(), + true, false, false, "bitwiseXor(\"__acc\", \"l1\")", @@ -14463,13 +13493,7 @@ public void testBitwiseAggregatorsGroupBy() .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - useDefault - ? ImmutableList.of( - new Object[]{"abc", 0L, 0L, 0L}, - new Object[]{"a", 0L, 7L, 7L}, - new Object[]{"", 0L, 325323L, 325323L} - ) - : ImmutableList.of( + ImmutableList.of( new Object[]{"abc", null, null, null}, new Object[]{"", 0L, 0L, 0L}, new Object[]{"a", 0L, 7L, 7L}, @@ -14558,9 +13582,7 @@ public void testStringAgg() .build() ), ImmutableList.of( - useDefault - ? new Object[]{"10.1,2,1,def,abc", "1,10.1,2,abc,def", ""} - : new Object[]{",10.1,2,1,def,abc", ",1,10.1,2,abc,def", null} + new Object[]{",10.1,2,1,def,abc", ",1,10.1,2,abc,def", null} ) ); } @@ -14622,9 +13644,7 @@ public void testStringAggMultiValue() .build() ), ImmutableList.of( - useDefault - ? new Object[]{"a,b,b,c,d", "a,b,c,d"} - : new Object[]{"a,b,b,c,d,", ",a,b,c,d"} + new Object[]{"a,b,b,c,d,", ",a,b,c,d"} ) ); } @@ -14762,16 +13782,7 @@ public void testStringAggNumeric() .build() ), ImmutableList.of( - useDefault - ? new Object[]{ - "7,325323,0,0,0,0", - "0,325323,7", - "1.0,1.7,0.0,0.0,0.0,0.0", - "0.0,1.0,1.7", - "1.0,0.10000000149011612,0.0,0.0,0.0,0.0", - "0.0,0.10000000149011612,1.0" - } - : new Object[]{ + new Object[]{ "7,325323,0", "0,325323,7", "1.0,1.7,0.0", @@ -14846,9 +13857,7 @@ public void testStringAggExpression() .build() ), ImmutableList.of( - useDefault - ? new Object[]{"10.1,1a,2,a,abc,defabc", "10.1||1a||2||a||abc||defabc"} - : new Object[]{"1a,2,a,defabc", "1a||2||a||defabc"} + new Object[]{"1a,2,a,defabc", "1a||2||a||defabc"} ) ); } @@ -14941,9 +13950,7 @@ public void testStringAggMaxBytes() .build() ), ImmutableList.of( - useDefault - ? new Object[]{"7,325323,0,0,0,0", "0,325323,7"} - : new Object[]{"7,325323,0", "0,325323,7"} + new Object[]{"7,325323,0", "0,325323,7"} ) ); } @@ -15013,9 +14020,9 @@ public void testHumanReadableFormatFunction() "48 KiB", // = m1(4.0) * 12345 / 1024, precision = 0 "49.38 KB", // decimal byte format, m1(4.0) * 12345 / 1000, "49.38 K", // decimal format, m1(4.0) * 12345 / 1000, - NullHandling.replaceWithDefault() ? "0 B" : null, - NullHandling.replaceWithDefault() ? "0 B" : null, - NullHandling.replaceWithDefault() ? "0" : null + null, + null, + null } ) ); @@ -15107,9 +14114,7 @@ public void testReturnEmptyRowWhenGroupByIsConvertedToTimeseriesWithSingleConsta .intervals(querySegmentSpec(Filtration.eternity())) .filters( and( - NullHandling.replaceWithDefault() - ? selector("m1", "50") - : equality("m1", 50.0, ColumnType.FLOAT), + equality("m1", 50.0, ColumnType.FLOAT), equality("dim1", "wat", ColumnType.STRING) ) ) @@ -15160,9 +14165,7 @@ public void testReturnEmptyRowWhenGroupByIsConvertedToTimeseriesWithMultipleCons .intervals(querySegmentSpec(Filtration.eternity())) .filters( and( - NullHandling.replaceWithDefault() - ? selector("m1", "50") - : equality("m1", 50.0, ColumnType.FLOAT), + equality("m1", 50.0, ColumnType.FLOAT), equality("dim1", "wat", ColumnType.STRING) ) ) @@ -15236,63 +14239,36 @@ public void testPlanWithInFilterLessThanInSubQueryThreshold() @Test public void testGreatestFunctionForNumberWithIsNull() { - if (NullHandling.sqlCompatible()) { - cannotVectorizeUnlessFallback(); - } + cannotVectorizeUnlessFallback(); String query = "SELECT dim1, MAX(GREATEST(l1, l2)) IS NULL FROM druid.numfoo GROUP BY dim1"; - List expectedResult; - List> expectedQueries; - - if (NullHandling.replaceWithDefault()) { - expectedResult = ImmutableList.of( - new Object[]{"", false}, - new Object[]{"1", false}, - new Object[]{"10.1", false}, - new Object[]{"2", false}, - new Object[]{"abc", false}, - new Object[]{"def", false} - ); - expectedQueries = ImmutableList.of( - GroupByQuery.builder() - .setDataSource(CalciteTests.DATASOURCE3) - .setInterval(querySegmentSpec(Intervals.ETERNITY)) - .setGranularity(Granularities.ALL) - .addDimension(new DefaultDimensionSpec("dim1", "d0")) - .setPostAggregatorSpecs(ImmutableList.of( - expressionPostAgg("p0", "0", ColumnType.LONG) - )) - .build() - ); - } else { - expectedResult = ImmutableList.of( - new Object[]{"", false}, - new Object[]{"1", true}, - new Object[]{"10.1", false}, - new Object[]{"2", false}, - new Object[]{"abc", true}, - new Object[]{"def", true} - ); - expectedQueries = ImmutableList.of( - GroupByQuery.builder() - .setDataSource(CalciteTests.DATASOURCE3) - .setInterval(querySegmentSpec(Intervals.ETERNITY)) - .setVirtualColumns( - expressionVirtualColumn( - "v0", - "greatest(\"l1\",\"l2\")", - ColumnType.LONG - ) - ) - .setGranularity(Granularities.ALL) - .addDimension(new DefaultDimensionSpec("dim1", "d0")) - .addAggregator(new LongMaxAggregatorFactory("a0", "v0")) - .setPostAggregatorSpecs(ImmutableList.of( - expressionPostAgg("p0", "isnull(\"a0\")", ColumnType.LONG) - )) - .build() - ); - } + List expectedResult = ImmutableList.of( + new Object[]{"", false}, + new Object[]{"1", true}, + new Object[]{"10.1", false}, + new Object[]{"2", false}, + new Object[]{"abc", true}, + new Object[]{"def", true} + ); + List> expectedQueries = ImmutableList.of( + GroupByQuery.builder() + .setDataSource(CalciteTests.DATASOURCE3) + .setInterval(querySegmentSpec(Intervals.ETERNITY)) + .setVirtualColumns( + expressionVirtualColumn( + "v0", + "greatest(\"l1\",\"l2\")", + ColumnType.LONG + ) + ) + .setGranularity(Granularities.ALL) + .addDimension(new DefaultDimensionSpec("dim1", "d0")) + .addAggregator(new LongMaxAggregatorFactory("a0", "v0")) + .setPostAggregatorSpecs(ImmutableList.of( + expressionPostAgg("p0", "isnull(\"a0\")", ColumnType.LONG) + )) + .build() + ); testQuery( query, @@ -15330,12 +14306,6 @@ public void testGreatestFunctionForStringWithIsNull() )) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{0L, false}, - new Object[]{7L, false}, - new Object[]{325323L, false} - ) : ImmutableList.of( new Object[]{null, false}, new Object[]{0L, false}, @@ -15372,15 +14342,7 @@ public void testSubqueryTypeMismatchWithLiterals() .build() ), - useDefault ? ImmutableList.of( - new Object[]{"", 0L}, - new Object[]{"1", 1L}, - new Object[]{"10.1", 0L}, - new Object[]{"2", 1L}, - new Object[]{"abc", 1L}, - new Object[]{"def", 1L} - ) : ImmutableList.of( - // in sql compatible mode, null does not equal 0 so the values which were 1 previously are not in this mode + ImmutableList.of( new Object[]{"", 0L}, new Object[]{"1", 0L}, new Object[]{"10.1", 0L}, @@ -15780,7 +14742,6 @@ public void testGroupByDateTrunc() @Test public void testLatestByOnStringColumnWithoutMaxBytesSpecified() { - String defaultString = useDefault ? "" : null; testQuery( "SELECT dim2,LATEST(dim3),LATEST_BY(dim1, __time),EARLIEST(dim3),EARLIEST_BY(dim1, __time),ANY_VALUE(dim3) FROM druid.foo where dim2='abc' group by 1", ImmutableList.of( @@ -15804,7 +14765,7 @@ public void testLatestByOnStringColumnWithoutMaxBytesSpecified() ), ImmutableList.of( - new Object[] {"abc", defaultString, "def", defaultString, "def", defaultString} + new Object[] {"abc", null, "def", null, "def", null} )); } @@ -15934,12 +14895,10 @@ public void testInGroupByLimitOutGroupByOrderBy() .threshold(10) .aggregators( aggregators( - useDefault - ? new CountAggregatorFactory("a0") - : new FilteredAggregatorFactory( - new CountAggregatorFactory("a0"), - notNull("m1") - ) + new FilteredAggregatorFactory( + new CountAggregatorFactory("a0"), + notNull("m1") + ) ) ) .metric(new DimensionTopNMetricSpec(null, StringComparators.NUMERIC)) @@ -16013,12 +14972,10 @@ public void testInGroupByOrderByLimitOutGroupByOrderByLimit() .threshold(10) .aggregators( aggregators( - useDefault - ? new CountAggregatorFactory("a0") - : new FilteredAggregatorFactory( - new CountAggregatorFactory("a0"), - notNull("m1") - ) + new FilteredAggregatorFactory( + new CountAggregatorFactory("a0"), + notNull("m1") + ) ) ) .metric(new NumericTopNMetricSpec("a0")) @@ -16062,7 +15019,6 @@ public void testInGroupByOrderByLimitOutGroupByOrderByLimit() @Test public void testScanAndSortCanGetSchemaFromScanQuery() { - assumeTrue(NullHandling.sqlCompatible()); msqIncompatible(); String sql = "select * from (select * from \"wikipedia\" limit 3) order by \"user\""; ImmutableList expectedResults = ImmutableList.of( @@ -16077,7 +15033,7 @@ public void testScanAndSortCanGetSchemaFromScanQuery() .run(); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.SLIGHTLY_WORSE_PLAN, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.SLIGHTLY_WORSE_PLAN) @Test public void testWindowingWithScanAndSort() { @@ -16121,12 +15077,10 @@ public void testWindowingWithScanAndSort() ) .setAggregatorSpecs( aggregators( - useDefault - ? new CountAggregatorFactory("a0") - : new FilteredAggregatorFactory( - new CountAggregatorFactory("a0"), - notNull("m1") - ) + new FilteredAggregatorFactory( + new CountAggregatorFactory("a0"), + notNull("m1") + ) ) ) .build() @@ -16351,7 +15305,7 @@ public void testFilterParseLongNullable() .context(QUERY_CONTEXT_DEFAULT) .build() ), - ImmutableList.of(new Object[]{NullHandling.sqlCompatible() ? 4L : 0L}) + ImmutableList.of(new Object[]{4L}) ); } @@ -16390,7 +15344,6 @@ public void testIpv4ParseWithNullableType() { testQuery( "select ipv4_parse('1.2.3') from (values(1)) as t(col)", - NullHandling.sqlCompatible() ? ImmutableList.of( Druids.newScanQueryBuilder() .dataSource(InlineDataSource.fromIterable( @@ -16405,24 +15358,8 @@ public void testIpv4ParseWithNullableType() .context(QUERY_CONTEXT_DEFAULT) .resultFormat(ResultFormat.RESULT_FORMAT_COMPACTED_LIST) .build() - ) : - ImmutableList.of( - Druids.newScanQueryBuilder() - .dataSource(InlineDataSource.fromIterable( - ImmutableList.of(new Object[]{1L}), - RowSignature.builder() - .add("col", ColumnType.LONG) - .build() - )) - .intervals(querySegmentSpec(Filtration.eternity())) - .columns("v0") - .columnTypes(ColumnType.LONG) - .virtualColumns(expressionVirtualColumn("v0", "0", ColumnType.LONG)) - .context(QUERY_CONTEXT_DEFAULT) - .resultFormat(ResultFormat.RESULT_FORMAT_COMPACTED_LIST) - .build() ), - ImmutableList.of(NullHandling.sqlCompatible() ? new Object[]{null} : new Object[]{0L}) + ImmutableList.of(new Object[]{null}) ); } @@ -16485,7 +15422,7 @@ public void testBitwiseXor() "__acc", "0", "0", - NullHandling.sqlCompatible(), + true, false, false, "bitwiseXor(\"__acc\", \"cityName\")", @@ -16517,8 +15454,7 @@ public void testBitwiseXor() .build() ), ImmutableList.of( - useDefault ? - new Object[]{0L} : new Object[]{37091L} + new Object[]{37091L} ) ); } @@ -16540,7 +15476,7 @@ public void testStringOperationsNullableInference() .virtualColumns( new ExpressionVirtualColumn( "v0", - NullHandling.replaceWithDefault() ? "0" : "null", + "null", ColumnType.LONG, ExprMacroTable.nil() ), @@ -16560,10 +15496,8 @@ public void testStringOperationsNullableInference() .build() ) ).expectedResults( - NullHandling.sqlCompatible() ? ImmutableList.of( + ImmutableList.of( new Object[]{null, null, null} - ) : ImmutableList.of( - new Object[]{false, false, ""} ) ).run(); } diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteScanSignatureTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteScanSignatureTest.java index f4562190cde4..1f50b81b51ea 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteScanSignatureTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteScanSignatureTest.java @@ -103,9 +103,7 @@ public void testScanSignatureWithDimAsValuePrimitiveByteArr() .limit(2) .build() ), - useDefault ? ImmutableList.of( - new Object[]{0L}, new Object[]{0L} - ) : ImmutableList.of( + ImmutableList.of( new Object[]{null}, new Object[]{null} ) ); diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteSelectQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteSelectQueryTest.java index 7f11e07dcbda..c251eb212320 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteSelectQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteSelectQueryTest.java @@ -22,7 +22,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import org.apache.calcite.rel.RelNode; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; import org.apache.druid.error.DruidExceptionMatcher; import org.apache.druid.java.util.common.DateTimes; @@ -38,7 +37,6 @@ import org.apache.druid.query.aggregation.DoubleSumAggregatorFactory; import org.apache.druid.query.aggregation.FilteredAggregatorFactory; import org.apache.druid.query.dimension.DefaultDimensionSpec; -import org.apache.druid.query.extraction.SubstringDimExtractionFn; import org.apache.druid.query.groupby.GroupByQuery; import org.apache.druid.query.ordering.StringComparators; import org.apache.druid.query.scan.ScanQuery; @@ -77,26 +75,26 @@ public void testSelectConstantExpression() "SELECT REGEXP_EXTRACT('foo', '^(.)')", ImmutableList.of( Druids.newScanQueryBuilder() - .dataSource( - InlineDataSource.fromIterable( - ImmutableList.of(new Object[]{0L}), - RowSignature.builder().add("ZERO", ColumnType.LONG).build() - ) - ) - .intervals(querySegmentSpec(Filtration.eternity())) - .virtualColumns( - new ExpressionVirtualColumn( - "v0", - "'f'", - ColumnType.STRING, - ExprMacroTable.nil() - ) - ) - .columns("v0") - .columnTypes(ColumnType.STRING) - .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) - .context(QUERY_CONTEXT_DEFAULT) - .build() + .dataSource( + InlineDataSource.fromIterable( + ImmutableList.of(new Object[]{0L}), + RowSignature.builder().add("ZERO", ColumnType.LONG).build() + ) + ) + .intervals(querySegmentSpec(Filtration.eternity())) + .virtualColumns( + new ExpressionVirtualColumn( + "v0", + "'f'", + ColumnType.STRING, + ExprMacroTable.nil() + ) + ) + .columns("v0") + .columnTypes(ColumnType.STRING) + .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) + .context(QUERY_CONTEXT_DEFAULT) + .build() ), ImmutableList.of( new Object[]{"f"} @@ -111,26 +109,26 @@ public void testExpressionContainingNull() "SELECT ARRAY ['Hello', NULL]", ImmutableList.of( Druids.newScanQueryBuilder() - .dataSource( - InlineDataSource.fromIterable( - ImmutableList.of(new Object[]{0L}), - RowSignature.builder().add("ZERO", ColumnType.LONG).build() - ) - ) - .intervals(querySegmentSpec(Filtration.eternity())) - .virtualColumns( - new ExpressionVirtualColumn( - "v0", - "array('Hello',null)", - ColumnType.STRING_ARRAY, - ExprMacroTable.nil() - ) - ) - .columns("v0") - .columnTypes(ColumnType.STRING_ARRAY) - .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) - .context(QUERY_CONTEXT_DEFAULT) - .build() + .dataSource( + InlineDataSource.fromIterable( + ImmutableList.of(new Object[]{0L}), + RowSignature.builder().add("ZERO", ColumnType.LONG).build() + ) + ) + .intervals(querySegmentSpec(Filtration.eternity())) + .virtualColumns( + new ExpressionVirtualColumn( + "v0", + "array('Hello',null)", + ColumnType.STRING_ARRAY, + ExprMacroTable.nil() + ) + ) + .columns("v0") + .columnTypes(ColumnType.STRING_ARRAY) + .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) + .context(QUERY_CONTEXT_DEFAULT) + .build() ), ImmutableList.of(new Object[]{"[\"Hello\",null]"}) ); @@ -165,22 +163,22 @@ public void testValuesContainingNull() "SELECT * FROM (VALUES (NULL, 'United States'))", ImmutableList.of( Druids.newScanQueryBuilder() - .dataSource( - InlineDataSource.fromIterable( - ImmutableList.of(new Object[]{null, "United States"}), - RowSignature - .builder() - .add("EXPR$0", null) - .add("EXPR$1", ColumnType.STRING) - .build() - ) - ) - .intervals(querySegmentSpec(Filtration.eternity())) - .columns("EXPR$0", "EXPR$1") - .columnTypes(ColumnType.STRING, ColumnType.STRING) - .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) - .context(QUERY_CONTEXT_DEFAULT) - .build() + .dataSource( + InlineDataSource.fromIterable( + ImmutableList.of(new Object[]{null, "United States"}), + RowSignature + .builder() + .add("EXPR$0", null) + .add("EXPR$1", ColumnType.STRING) + .build() + ) + ) + .intervals(querySegmentSpec(Filtration.eternity())) + .columns("EXPR$0", "EXPR$1") + .columnTypes(ColumnType.STRING, ColumnType.STRING) + .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) + .context(QUERY_CONTEXT_DEFAULT) + .build() ), ImmutableList.of(new Object[]{null, "United States"}) ); @@ -193,24 +191,24 @@ public void testMultipleValuesContainingNull() "SELECT * FROM (VALUES (NULL, 'United States'), ('Delhi', 'India'))", ImmutableList.of( Druids.newScanQueryBuilder() - .dataSource( - InlineDataSource.fromIterable( - ImmutableList.of(new Object[]{null, "United States"}, new Object[]{"Delhi", "India"}), - RowSignature - .builder() - .add("EXPR$0", ColumnType.STRING) - .add("EXPR$1", ColumnType.STRING) - .build() - ) - ) - .intervals(querySegmentSpec(Filtration.eternity())) - .columns("EXPR$0", "EXPR$1") - .columnTypes(ColumnType.STRING, ColumnType.STRING) - .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) - .context(QUERY_CONTEXT_DEFAULT) - .build() + .dataSource( + InlineDataSource.fromIterable( + ImmutableList.of(new Object[]{null, "United States"}, new Object[]{"Delhi", "India"}), + RowSignature + .builder() + .add("EXPR$0", ColumnType.STRING) + .add("EXPR$1", ColumnType.STRING) + .build() + ) + ) + .intervals(querySegmentSpec(Filtration.eternity())) + .columns("EXPR$0", "EXPR$1") + .columnTypes(ColumnType.STRING, ColumnType.STRING) + .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) + .context(QUERY_CONTEXT_DEFAULT) + .build() ), - ImmutableList.of(new Object[]{NULL_STRING, "United States"}, new Object[]{"Delhi", "India"}) + ImmutableList.of(new Object[]{null, "United States"}, new Object[]{"Delhi", "India"}) ); } @@ -221,22 +219,22 @@ public void testMultipleValuesContainingNullAndIntegerValues() "SELECT * FROM (VALUES (NULL, 'United States'), (50, 'India'))", ImmutableList.of( Druids.newScanQueryBuilder() - .dataSource( - InlineDataSource.fromIterable( - ImmutableList.of(new Object[]{null, "United States"}, new Object[]{50L, "India"}), - RowSignature - .builder() - .add("EXPR$0", ColumnType.LONG) - .add("EXPR$1", ColumnType.STRING) - .build() - ) - ) - .intervals(querySegmentSpec(Filtration.eternity())) - .columns("EXPR$0", "EXPR$1") - .columnTypes(ColumnType.LONG, ColumnType.STRING) - .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) - .context(QUERY_CONTEXT_DEFAULT) - .build() + .dataSource( + InlineDataSource.fromIterable( + ImmutableList.of(new Object[]{null, "United States"}, new Object[]{50L, "India"}), + RowSignature + .builder() + .add("EXPR$0", ColumnType.LONG) + .add("EXPR$1", ColumnType.STRING) + .build() + ) + ) + .intervals(querySegmentSpec(Filtration.eternity())) + .columns("EXPR$0", "EXPR$1") + .columnTypes(ColumnType.LONG, ColumnType.STRING) + .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) + .context(QUERY_CONTEXT_DEFAULT) + .build() ), ImmutableList.of(new Object[]{null, "United States"}, new Object[]{50, "India"}) ); @@ -248,32 +246,32 @@ public void testSelectNonNumericNumberLiterals() // Tests to convert NaN, positive infinity and negative infinity as literals. testQuery( "SELECT" - + " CAST(1 / 0.0 AS BIGINT)," - + " CAST(1 / -0.0 AS BIGINT)," - + " CAST(-1 / 0.0 AS BIGINT)," - + " CAST(-1 / -0.0 AS BIGINT)," - + " CAST(0/ 0.0 AS BIGINT)", + + " CAST(1 / 0.0 AS BIGINT)," + + " CAST(1 / -0.0 AS BIGINT)," + + " CAST(-1 / 0.0 AS BIGINT)," + + " CAST(-1 / -0.0 AS BIGINT)," + + " CAST(0/ 0.0 AS BIGINT)", ImmutableList.of( Druids.newScanQueryBuilder() - .dataSource( - InlineDataSource.fromIterable( - ImmutableList.of( - new Object[]{Long.MAX_VALUE, Long.MAX_VALUE, Long.MIN_VALUE, Long.MIN_VALUE, 0L} - ), - RowSignature.builder() - .add("EXPR$0", ColumnType.LONG) - .add("EXPR$1", ColumnType.LONG) - .add("EXPR$2", ColumnType.LONG) - .add("EXPR$3", ColumnType.LONG) - .add("EXPR$4", ColumnType.LONG) - .build() - ) - ) - .intervals(querySegmentSpec(Filtration.eternity())) - .columns("EXPR$0", "EXPR$1", "EXPR$2", "EXPR$3", "EXPR$4") - .columnTypes(ColumnType.LONG, ColumnType.LONG, ColumnType.LONG, ColumnType.LONG, ColumnType.LONG) - .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) - .build() + .dataSource( + InlineDataSource.fromIterable( + ImmutableList.of( + new Object[]{Long.MAX_VALUE, Long.MAX_VALUE, Long.MIN_VALUE, Long.MIN_VALUE, 0L} + ), + RowSignature.builder() + .add("EXPR$0", ColumnType.LONG) + .add("EXPR$1", ColumnType.LONG) + .add("EXPR$2", ColumnType.LONG) + .add("EXPR$3", ColumnType.LONG) + .add("EXPR$4", ColumnType.LONG) + .build() + ) + ) + .intervals(querySegmentSpec(Filtration.eternity())) + .columns("EXPR$0", "EXPR$1", "EXPR$2", "EXPR$3", "EXPR$4") + .columnTypes(ColumnType.LONG, ColumnType.LONG, ColumnType.LONG, ColumnType.LONG, ColumnType.LONG) + .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) + .build() ), ImmutableList.of( new Object[]{ @@ -349,7 +347,7 @@ public void testSelectConstantExpressionEquivalentToNaN() "SELECT log10(0) - log10(0), dim1 FROM foo LIMIT 1", invalidSqlIs( "Expression [(log10(0) - log10(0))] evaluates to an unsupported value [NaN], " - + "expected something that can be a Double. Consider casting with 'CAST( AS BIGINT)'" + + "expected something that can be a Double. Consider casting with 'CAST( AS BIGINT)'" ) ); } @@ -361,7 +359,7 @@ public void testSelectConstantExpressionEquivalentToInfinity() "SELECT log10(0), dim1 FROM foo LIMIT 1", invalidSqlIs( "Expression [log10(0)] evaluates to an unsupported value [-Infinity], " - + "expected something that can be a Double. Consider casting with 'CAST( AS BIGINT)'" + + "expected something that can be a Double. Consider casting with 'CAST( AS BIGINT)'" ) ); } @@ -373,40 +371,40 @@ public void testSelectTrimFamily() testQuery( "SELECT\n" - + "TRIM(BOTH 'x' FROM 'xfoox'),\n" - + "TRIM(TRAILING 'x' FROM 'xfoox'),\n" - + "TRIM(' ' FROM ' foo '),\n" - + "TRIM(TRAILING FROM ' foo '),\n" - + "TRIM(' foo '),\n" - + "BTRIM(' foo '),\n" - + "BTRIM('xfoox', 'x'),\n" - + "LTRIM(' foo '),\n" - + "LTRIM('xfoox', 'x'),\n" - + "RTRIM(' foo '),\n" - + "RTRIM('xfoox', 'x'),\n" - + "COUNT(*)\n" - + "FROM foo", + + "TRIM(BOTH 'x' FROM 'xfoox'),\n" + + "TRIM(TRAILING 'x' FROM 'xfoox'),\n" + + "TRIM(' ' FROM ' foo '),\n" + + "TRIM(TRAILING FROM ' foo '),\n" + + "TRIM(' foo '),\n" + + "BTRIM(' foo '),\n" + + "BTRIM('xfoox', 'x'),\n" + + "LTRIM(' foo '),\n" + + "LTRIM('xfoox', 'x'),\n" + + "RTRIM(' foo '),\n" + + "RTRIM('xfoox', 'x'),\n" + + "COUNT(*)\n" + + "FROM foo", ImmutableList.of( Druids.newTimeseriesQueryBuilder() - .dataSource(CalciteTests.DATASOURCE1) - .intervals(querySegmentSpec(Filtration.eternity())) - .granularity(Granularities.ALL) - .aggregators(aggregators(new CountAggregatorFactory("a0"))) - .postAggregators( - expressionPostAgg("p0", "'foo'", ColumnType.STRING), - expressionPostAgg("p1", "'xfoo'", ColumnType.STRING), - expressionPostAgg("p2", "'foo'", ColumnType.STRING), - expressionPostAgg("p3", "' foo'", ColumnType.STRING), - expressionPostAgg("p4", "'foo'", ColumnType.STRING), - expressionPostAgg("p5", "'foo'", ColumnType.STRING), - expressionPostAgg("p6", "'foo'", ColumnType.STRING), - expressionPostAgg("p7", "'foo '", ColumnType.STRING), - expressionPostAgg("p8", "'foox'", ColumnType.STRING), - expressionPostAgg("p9", "' foo'", ColumnType.STRING), - expressionPostAgg("p10", "'xfoo'", ColumnType.STRING) - ) - .context(QUERY_CONTEXT_DEFAULT) - .build() + .dataSource(CalciteTests.DATASOURCE1) + .intervals(querySegmentSpec(Filtration.eternity())) + .granularity(Granularities.ALL) + .aggregators(aggregators(new CountAggregatorFactory("a0"))) + .postAggregators( + expressionPostAgg("p0", "'foo'", ColumnType.STRING), + expressionPostAgg("p1", "'xfoo'", ColumnType.STRING), + expressionPostAgg("p2", "'foo'", ColumnType.STRING), + expressionPostAgg("p3", "' foo'", ColumnType.STRING), + expressionPostAgg("p4", "'foo'", ColumnType.STRING), + expressionPostAgg("p5", "'foo'", ColumnType.STRING), + expressionPostAgg("p6", "'foo'", ColumnType.STRING), + expressionPostAgg("p7", "'foo '", ColumnType.STRING), + expressionPostAgg("p8", "'foox'", ColumnType.STRING), + expressionPostAgg("p9", "' foo'", ColumnType.STRING), + expressionPostAgg("p10", "'xfoo'", ColumnType.STRING) + ) + .context(QUERY_CONTEXT_DEFAULT) + .build() ), ImmutableList.of( new Object[]{"foo", "xfoo", "foo", " foo", "foo", "foo", "foo", "foo ", "foox", " foo", "xfoo", 6L} @@ -419,30 +417,30 @@ public void testSelectPadFamily() { testQuery( "SELECT\n" - + "LPAD('foo', 5, 'x'),\n" - + "LPAD('foo', 2, 'x'),\n" - + "LPAD('foo', 5),\n" - + "RPAD('foo', 5, 'x'),\n" - + "RPAD('foo', 2, 'x'),\n" - + "RPAD('foo', 5),\n" - + "COUNT(*)\n" - + "FROM foo", + + "LPAD('foo', 5, 'x'),\n" + + "LPAD('foo', 2, 'x'),\n" + + "LPAD('foo', 5),\n" + + "RPAD('foo', 5, 'x'),\n" + + "RPAD('foo', 2, 'x'),\n" + + "RPAD('foo', 5),\n" + + "COUNT(*)\n" + + "FROM foo", ImmutableList.of( Druids.newTimeseriesQueryBuilder() - .dataSource(CalciteTests.DATASOURCE1) - .intervals(querySegmentSpec(Filtration.eternity())) - .granularity(Granularities.ALL) - .aggregators(aggregators(new CountAggregatorFactory("a0"))) - .postAggregators( - expressionPostAgg("p0", "'xxfoo'", ColumnType.STRING), - expressionPostAgg("p1", "'fo'", ColumnType.STRING), - expressionPostAgg("p2", "' foo'", ColumnType.STRING), - expressionPostAgg("p3", "'fooxx'", ColumnType.STRING), - expressionPostAgg("p4", "'fo'", ColumnType.STRING), - expressionPostAgg("p5", "'foo '", ColumnType.STRING) - ) - .context(QUERY_CONTEXT_DEFAULT) - .build() + .dataSource(CalciteTests.DATASOURCE1) + .intervals(querySegmentSpec(Filtration.eternity())) + .granularity(Granularities.ALL) + .aggregators(aggregators(new CountAggregatorFactory("a0"))) + .postAggregators( + expressionPostAgg("p0", "'xxfoo'", ColumnType.STRING), + expressionPostAgg("p1", "'fo'", ColumnType.STRING), + expressionPostAgg("p2", "' foo'", ColumnType.STRING), + expressionPostAgg("p3", "'fooxx'", ColumnType.STRING), + expressionPostAgg("p4", "'fo'", ColumnType.STRING), + expressionPostAgg("p5", "'foo '", ColumnType.STRING) + ) + .context(QUERY_CONTEXT_DEFAULT) + .build() ), ImmutableList.of( new Object[]{"xxfoo", "fo", " foo", "fooxx", "fo", "foo ", 6L} @@ -453,56 +451,53 @@ public void testSelectPadFamily() @Test public void testBitwiseExpressions() { - List expected; - if (useDefault) { - expected = ImmutableList.of( - new Object[]{0L, 7L, 7L, -8L, 28L, 1L, 4607182418800017408L, 3.5E-323}, - new Object[]{325323L, 325323L, 0L, -325324L, 1301292L, 81330L, 4610334938539176755L, 1.60731E-318}, - new Object[]{0L, 0L, 0L, -1L, 0L, 0L, 0L, 0.0}, - new Object[]{0L, 0L, 0L, -1L, 0L, 0L, 0L, 0.0}, - new Object[]{0L, 0L, 0L, -1L, 0L, 0L, 0L, 0.0}, - new Object[]{0L, 0L, 0L, -1L, 0L, 0L, 0L, 0.0} - ); - } else { - expected = ImmutableList.of( - new Object[]{null, null, null, -8L, 28L, 1L, 4607182418800017408L, 3.5E-323}, - new Object[]{325323L, 325323L, 0L, -325324L, 1301292L, 81330L, 4610334938539176755L, 1.60731E-318}, - new Object[]{0L, 0L, 0L, -1L, 0L, 0L, 0L, 0.0}, - new Object[]{null, null, null, null, null, null, null, null}, - new Object[]{null, null, null, null, null, null, null, null}, - new Object[]{null, null, null, null, null, null, null, null} - ); - } + List expected = ImmutableList.of( + new Object[]{null, null, null, -8L, 28L, 1L, 4607182418800017408L, 3.5E-323}, + new Object[]{325323L, 325323L, 0L, -325324L, 1301292L, 81330L, 4610334938539176755L, 1.60731E-318}, + new Object[]{0L, 0L, 0L, -1L, 0L, 0L, 0L, 0.0}, + new Object[]{null, null, null, null, null, null, null, null}, + new Object[]{null, null, null, null, null, null, null, null}, + new Object[]{null, null, null, null, null, null, null, null} + ); testQuery( "SELECT\n" - + "BITWISE_AND(l1, l2),\n" - + "BITWISE_OR(l1, l2),\n" - + "BITWISE_XOR(l1, l2),\n" - + "BITWISE_COMPLEMENT(l1),\n" - + "BITWISE_SHIFT_LEFT(l1, 2),\n" - + "BITWISE_SHIFT_RIGHT(l1, 2),\n" - + "BITWISE_CONVERT_DOUBLE_TO_LONG_BITS(dbl1),\n" - + "BITWISE_CONVERT_LONG_BITS_TO_DOUBLE(l1)\n" - + "FROM numfoo", + + "BITWISE_AND(l1, l2),\n" + + "BITWISE_OR(l1, l2),\n" + + "BITWISE_XOR(l1, l2),\n" + + "BITWISE_COMPLEMENT(l1),\n" + + "BITWISE_SHIFT_LEFT(l1, 2),\n" + + "BITWISE_SHIFT_RIGHT(l1, 2),\n" + + "BITWISE_CONVERT_DOUBLE_TO_LONG_BITS(dbl1),\n" + + "BITWISE_CONVERT_LONG_BITS_TO_DOUBLE(l1)\n" + + "FROM numfoo", ImmutableList.of( Druids.newScanQueryBuilder() - .dataSource(CalciteTests.DATASOURCE3) - .intervals(querySegmentSpec(Filtration.eternity())) - .columns("v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7") - .columnTypes(ColumnType.LONG, ColumnType.LONG, ColumnType.LONG, ColumnType.LONG, ColumnType.LONG, ColumnType.LONG, ColumnType.LONG, ColumnType.DOUBLE) - .virtualColumns( - expressionVirtualColumn("v0", "bitwiseAnd(\"l1\",\"l2\")", ColumnType.LONG), - expressionVirtualColumn("v1", "bitwiseOr(\"l1\",\"l2\")", ColumnType.LONG), - expressionVirtualColumn("v2", "bitwiseXor(\"l1\",\"l2\")", ColumnType.LONG), - expressionVirtualColumn("v3", "bitwiseComplement(\"l1\")", ColumnType.LONG), - expressionVirtualColumn("v4", "bitwiseShiftLeft(\"l1\",2)", ColumnType.LONG), - expressionVirtualColumn("v5", "bitwiseShiftRight(\"l1\",2)", ColumnType.LONG), - expressionVirtualColumn("v6", "bitwiseConvertDoubleToLongBits(\"dbl1\")", ColumnType.LONG), - expressionVirtualColumn("v7", "bitwiseConvertLongBitsToDouble(\"l1\")", ColumnType.DOUBLE) - ) - .context(QUERY_CONTEXT_DEFAULT) - .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) - .build() + .dataSource(CalciteTests.DATASOURCE3) + .intervals(querySegmentSpec(Filtration.eternity())) + .columns("v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7") + .columnTypes( + ColumnType.LONG, + ColumnType.LONG, + ColumnType.LONG, + ColumnType.LONG, + ColumnType.LONG, + ColumnType.LONG, + ColumnType.LONG, + ColumnType.DOUBLE + ) + .virtualColumns( + expressionVirtualColumn("v0", "bitwiseAnd(\"l1\",\"l2\")", ColumnType.LONG), + expressionVirtualColumn("v1", "bitwiseOr(\"l1\",\"l2\")", ColumnType.LONG), + expressionVirtualColumn("v2", "bitwiseXor(\"l1\",\"l2\")", ColumnType.LONG), + expressionVirtualColumn("v3", "bitwiseComplement(\"l1\")", ColumnType.LONG), + expressionVirtualColumn("v4", "bitwiseShiftLeft(\"l1\",2)", ColumnType.LONG), + expressionVirtualColumn("v5", "bitwiseShiftRight(\"l1\",2)", ColumnType.LONG), + expressionVirtualColumn("v6", "bitwiseConvertDoubleToLongBits(\"dbl1\")", ColumnType.LONG), + expressionVirtualColumn("v7", "bitwiseConvertLongBitsToDouble(\"l1\")", ColumnType.DOUBLE) + ) + .context(QUERY_CONTEXT_DEFAULT) + .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) + .build() ), expected ); @@ -529,9 +524,15 @@ public void testSafeDivideWithoutTable() ) .intervals(querySegmentSpec(Filtration.eternity())) .columns("v0", "v1", "v2", "v3", "v4") - .columnTypes(ColumnType.LONG, ColumnType.DOUBLE, ColumnType.DOUBLE, ColumnType.DOUBLE, ColumnType.LONG) + .columnTypes( + ColumnType.LONG, + ColumnType.DOUBLE, + ColumnType.DOUBLE, + ColumnType.DOUBLE, + ColumnType.LONG + ) .virtualColumns( - expressionVirtualColumn("v0", NullHandling.sqlCompatible() ? "null" : "0", ColumnType.LONG), + expressionVirtualColumn("v0", "null", ColumnType.LONG), expressionVirtualColumn("v1", "4.0", ColumnType.DOUBLE), expressionVirtualColumn("v2", "3.0", ColumnType.DOUBLE), expressionVirtualColumn("v3", "3.5", ColumnType.DOUBLE), @@ -542,8 +543,8 @@ public void testSafeDivideWithoutTable() .build() ), ImmutableList.of(new Object[]{ - NullHandling.sqlCompatible() ? null : 0, - NullHandling.sqlCompatible() ? null : 0, + null, + null, 4.0D, 3.0D, 3.5D, @@ -555,48 +556,36 @@ public void testSafeDivideWithoutTable() @Test public void testSafeDivideExpressions() { - List expected; - if (useDefault) { - expected = ImmutableList.of( - new Object[]{0.0F, 0L, 0.0, 7.0F}, - new Object[]{1.0F, 1L, 1.0, 3253230.0F}, - new Object[]{0.0F, 0L, 0.0, 0.0F}, - new Object[]{0.0F, 0L, 0.0, 0.0F}, - new Object[]{0.0F, 0L, 0.0, 0.0F}, - new Object[]{0.0F, 0L, 0.0, 0.0F} - ); - } else { - expected = ImmutableList.of( - new Object[]{null, null, null, 7.0F}, - new Object[]{1.0F, 1L, 1.0D, 3253230.0F}, - new Object[]{0.0F, null, 0.0D, 0.0F}, - new Object[]{null, null, null, null}, - new Object[]{null, null, null, null}, - new Object[]{null, null, null, null} - ); - } + List expected = ImmutableList.of( + new Object[]{null, null, null, 7.0F}, + new Object[]{1.0F, 1L, 1.0D, 3253230.0F}, + new Object[]{0.0F, null, 0.0D, 0.0F}, + new Object[]{null, null, null, null}, + new Object[]{null, null, null, null}, + new Object[]{null, null, null, null} + ); testQuery( "SELECT\n" - + "SAFE_DIVIDE(f1, f2),\n" - + "SAFE_DIVIDE(l1, l2),\n" - + "SAFE_DIVIDE(dbl2, dbl1),\n" - + "SAFE_DIVIDE(l1, f1)\n" - + "FROM numfoo", + + "SAFE_DIVIDE(f1, f2),\n" + + "SAFE_DIVIDE(l1, l2),\n" + + "SAFE_DIVIDE(dbl2, dbl1),\n" + + "SAFE_DIVIDE(l1, f1)\n" + + "FROM numfoo", ImmutableList.of( Druids.newScanQueryBuilder() - .dataSource(CalciteTests.DATASOURCE3) - .intervals(querySegmentSpec(Filtration.eternity())) - .columns("v0", "v1", "v2", "v3") - .columnTypes(ColumnType.FLOAT, ColumnType.LONG, ColumnType.DOUBLE, ColumnType.FLOAT) - .virtualColumns( - expressionVirtualColumn("v0", "safe_divide(\"f1\",\"f2\")", ColumnType.FLOAT), - expressionVirtualColumn("v1", "safe_divide(\"l1\",\"l2\")", ColumnType.LONG), - expressionVirtualColumn("v2", "safe_divide(\"dbl2\",\"dbl1\")", ColumnType.DOUBLE), - expressionVirtualColumn("v3", "safe_divide(\"l1\",\"f1\")", ColumnType.FLOAT) - ) - .context(QUERY_CONTEXT_DEFAULT) - .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) - .build() + .dataSource(CalciteTests.DATASOURCE3) + .intervals(querySegmentSpec(Filtration.eternity())) + .columns("v0", "v1", "v2", "v3") + .columnTypes(ColumnType.FLOAT, ColumnType.LONG, ColumnType.DOUBLE, ColumnType.FLOAT) + .virtualColumns( + expressionVirtualColumn("v0", "safe_divide(\"f1\",\"f2\")", ColumnType.FLOAT), + expressionVirtualColumn("v1", "safe_divide(\"l1\",\"l2\")", ColumnType.LONG), + expressionVirtualColumn("v2", "safe_divide(\"dbl2\",\"dbl1\")", ColumnType.DOUBLE), + expressionVirtualColumn("v3", "safe_divide(\"l1\",\"f1\")", ColumnType.FLOAT) + ) + .context(QUERY_CONTEXT_DEFAULT) + .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) + .build() ), expected ); @@ -646,7 +635,16 @@ public void testSelectStarWithDimFilter() ) ) .columns("__time", "dim1", "dim2", "dim3", "cnt", "m1", "m2", "unique_dim1") - .columnTypes(ColumnType.LONG, ColumnType.STRING, ColumnType.STRING, ColumnType.STRING, ColumnType.LONG, ColumnType.FLOAT, ColumnType.DOUBLE, ColumnType.ofComplex("hyperUnique")) + .columnTypes( + ColumnType.LONG, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.LONG, + ColumnType.FLOAT, + ColumnType.DOUBLE, + ColumnType.ofComplex("hyperUnique") + ) .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) .context(QUERY_CONTEXT_DEFAULT) .build() @@ -654,7 +652,7 @@ public void testSelectStarWithDimFilter() ImmutableList.of( new Object[]{timestamp("2000-01-01"), "", "a", "[\"a\",\"b\"]", 1L, 1.0f, 1.0d, "\"AQAAAEAAAA==\""}, new Object[]{timestamp("2001-01-01"), "1", "a", "", 1L, 4.0f, 4.0d, "\"AQAAAQAAAAFREA==\""}, - new Object[]{timestamp("2001-01-02"), "def", "abc", NULL_STRING, 1L, 5.0f, 5.0d, "\"AQAAAQAAAACyEA==\""} + new Object[]{timestamp("2001-01-02"), "def", "abc", null, 1L, 5.0f, 5.0d, "\"AQAAAQAAAACyEA==\""} ) ); } @@ -662,9 +660,7 @@ public void testSelectStarWithDimFilter() @Test public void testSelectDistinctWithCascadeExtractionFilter() { - if (NullHandling.sqlCompatible()) { - cannotVectorizeUnlessFallback(); - } + cannotVectorizeUnlessFallback(); testQuery( "SELECT distinct dim1 FROM druid.foo WHERE substring(substring(dim1, 2), 1, 1) = 'e' OR dim2 = 'a'", ImmutableList.of( @@ -674,29 +670,22 @@ public void testSelectDistinctWithCascadeExtractionFilter() .setGranularity(Granularities.ALL) .setDimensions(dimensions(new DefaultDimensionSpec("dim1", "d0"))) .setVirtualColumns( - NullHandling.replaceWithDefault() - ? VirtualColumns.EMPTY - : VirtualColumns.create( - expressionVirtualColumn("v0", "substring(substring(\"dim1\", 1, -1), 0, 1)", ColumnType.STRING) + VirtualColumns.create( + expressionVirtualColumn( + "v0", + "substring(substring(\"dim1\", 1, -1), 0, 1)", + ColumnType.STRING + ) ) ) - .setDimFilter( - or( - NullHandling.replaceWithDefault() - ? selector( - "dim1", - "e", - cascade( - new SubstringDimExtractionFn(1, null), - new SubstringDimExtractionFn(0, 1) + .setDimFilter( + or( + equality("v0", "e", ColumnType.STRING), + equality("dim2", "a", ColumnType.STRING) ) ) - : equality("v0", "e", ColumnType.STRING), - equality("dim2", "a", ColumnType.STRING) - ) - ) - .setContext(QUERY_CONTEXT_DEFAULT) - .build() + .setContext(QUERY_CONTEXT_DEFAULT) + .build() ), ImmutableList.of( new Object[]{""}, @@ -712,21 +701,21 @@ public void testSelectDistinctWithStrlenFilter() cannotVectorizeUnlessFallback(); testQuery( "SELECT distinct dim1 FROM druid.foo " - + "WHERE CHARACTER_LENGTH(dim1) = 3 OR CAST(CHARACTER_LENGTH(dim1) AS varchar) = 3", + + "WHERE CHARACTER_LENGTH(dim1) = 3 OR CAST(CHARACTER_LENGTH(dim1) AS varchar) = 3", ImmutableList.of( GroupByQuery.builder() - .setDataSource(CalciteTests.DATASOURCE1) - .setInterval(querySegmentSpec(Filtration.eternity())) - .setGranularity(Granularities.ALL) - .setVirtualColumns( - expressionVirtualColumn("v0", "strlen(\"dim1\")", ColumnType.LONG) - ) - .setDimensions(dimensions(new DefaultDimensionSpec("dim1", "d0"))) - .setDimFilter( - equality("v0", 3L, ColumnType.LONG) - ) - .setContext(QUERY_CONTEXT_DEFAULT) - .build() + .setDataSource(CalciteTests.DATASOURCE1) + .setInterval(querySegmentSpec(Filtration.eternity())) + .setGranularity(Granularities.ALL) + .setVirtualColumns( + expressionVirtualColumn("v0", "strlen(\"dim1\")", ColumnType.LONG) + ) + .setDimensions(dimensions(new DefaultDimensionSpec("dim1", "d0"))) + .setDimFilter( + equality("v0", 3L, ColumnType.LONG) + ) + .setContext(QUERY_CONTEXT_DEFAULT) + .build() ), ImmutableList.of( new Object[]{"abc"}, @@ -753,18 +742,12 @@ public void testSelectDistinctWithLimit() .context(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{""}, - new Object[]{"a"}, - new Object[]{"abc"} - ) : - ImmutableList.of( - new Object[]{null}, - new Object[]{""}, - new Object[]{"a"}, - new Object[]{"abc"} - ) + ImmutableList.of( + new Object[]{null}, + new Object[]{""}, + new Object[]{"a"}, + new Object[]{"abc"} + ) ); } @@ -784,18 +767,12 @@ public void testSelectDistinctWithSortAsOuterQuery() .context(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{""}, - new Object[]{"a"}, - new Object[]{"abc"} - ) : - ImmutableList.of( - new Object[]{null}, - new Object[]{""}, - new Object[]{"a"}, - new Object[]{"abc"} - ) + ImmutableList.of( + new Object[]{null}, + new Object[]{""}, + new Object[]{"a"}, + new Object[]{"abc"} + ) ); } @@ -815,18 +792,12 @@ public void testSelectDistinctWithSortAsOuterQuery2() .context(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{""}, - new Object[]{"a"}, - new Object[]{"abc"} - ) : - ImmutableList.of( - new Object[]{null}, - new Object[]{""}, - new Object[]{"a"}, - new Object[]{"abc"} - ) + ImmutableList.of( + new Object[]{null}, + new Object[]{""}, + new Object[]{"a"}, + new Object[]{"abc"} + ) ); } @@ -846,18 +817,12 @@ public void testSelectDistinctWithSortAsOuterQuery3() .context(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{""}, - new Object[]{"abc"}, - new Object[]{"a"} - ) : - ImmutableList.of( - new Object[]{null}, - new Object[]{"abc"}, - new Object[]{"a"}, - new Object[]{""} - ) + ImmutableList.of( + new Object[]{null}, + new Object[]{"abc"}, + new Object[]{"a"}, + new Object[]{""} + ) ); } @@ -870,18 +835,18 @@ public void testSelectNonAggregatingWithLimitLiterallyZero() "SELECT dim2 FROM druid.foo ORDER BY dim2 LIMIT 0", ImmutableList.of( Druids.newScanQueryBuilder() - .dataSource( - InlineDataSource.fromIterable( - ImmutableList.of(), - RowSignature.builder().add("dim2", ColumnType.STRING).build() - ) - ) - .intervals(querySegmentSpec(Filtration.eternity())) - .columns("dim2") - .columnTypes(ColumnType.STRING) - .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) - .context(QUERY_CONTEXT_DEFAULT) - .build() + .dataSource( + InlineDataSource.fromIterable( + ImmutableList.of(), + RowSignature.builder().add("dim2", ColumnType.STRING).build() + ) + ) + .intervals(querySegmentSpec(Filtration.eternity())) + .columns("dim2") + .columnTypes(ColumnType.STRING) + .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) + .context(QUERY_CONTEXT_DEFAULT) + .build() ), ImmutableList.of() ); @@ -896,17 +861,17 @@ public void testSelectNonAggregatingWithLimitReducedToZero() "SELECT * FROM (SELECT dim2 FROM druid.foo ORDER BY dim2 LIMIT 2 OFFSET 5) OFFSET 2", ImmutableList.of( Druids.newScanQueryBuilder() - .dataSource( - InlineDataSource.fromIterable( - ImmutableList.of(), - RowSignature.builder().add("dim2", ColumnType.STRING).build() - ) - ) - .intervals(querySegmentSpec(Filtration.eternity())) - .columns("dim2") - .columnTypes(ColumnType.STRING) - .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) - .build() + .dataSource( + InlineDataSource.fromIterable( + ImmutableList.of(), + RowSignature.builder().add("dim2", ColumnType.STRING).build() + ) + ) + .intervals(querySegmentSpec(Filtration.eternity())) + .columns("dim2") + .columnTypes(ColumnType.STRING) + .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) + .build() ), ImmutableList.of() ); @@ -921,17 +886,17 @@ public void testSelectAggregatingWithLimitReducedToZero() "SELECT * FROM (SELECT DISTINCT dim2 FROM druid.foo ORDER BY dim2 LIMIT 2 OFFSET 5) OFFSET 2", ImmutableList.of( Druids.newScanQueryBuilder() - .dataSource( - InlineDataSource.fromIterable( - ImmutableList.of(), - RowSignature.builder().add("dim2", ColumnType.STRING).build() - ) - ) - .intervals(querySegmentSpec(Filtration.eternity())) - .columns("dim2") - .columnTypes(ColumnType.STRING) - .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) - .build() + .dataSource( + InlineDataSource.fromIterable( + ImmutableList.of(), + RowSignature.builder().add("dim2", ColumnType.STRING).build() + ) + ) + .intervals(querySegmentSpec(Filtration.eternity())) + .columns("dim2") + .columnTypes(ColumnType.STRING) + .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) + .build() ), ImmutableList.of() ); @@ -959,45 +924,53 @@ public void testSelectCurrentTimeAndDateLosAngeles() CalciteTests.REGULAR_USER_AUTH_RESULT, ImmutableList.of( Druids.newScanQueryBuilder() - .dataSource( - InlineDataSource.fromIterable( - ImmutableList.of( - new Object[]{ - // milliseconds of timestamps as if they were in UTC. This looks strange - // but intentional because they are what Calcite gives us. - // See DruidLogicalValuesRule.getValueFromLiteral() - // and Calcites.calciteDateTimeLiteralToJoda. - new DateTime("2000-01-01T00:00:00.123Z", timeZone) - .withZone(DateTimeZone.UTC).getMillis(), - new DateTime("2000-01-01T00:00:00.000Z", timeZone) - .withZone(DateTimeZone.UTC).getMillis(), - new DateTime("2000-01-01T00:00:00.100Z", timeZone) - .withZone(DateTimeZone.UTC).getMillis(), - new DateTime("2000-01-01T00:00:00.120Z", timeZone) - .withZone(DateTimeZone.UTC).getMillis(), - new DateTime("2000-01-01T00:00:00.123Z", timeZone) - .withZone(DateTimeZone.UTC).getMillis(), - new DateTime("1999-12-31", timeZone).withZone(DateTimeZone.UTC).getMillis(), - new DateTime("2000-01-01", timeZone).withZone(DateTimeZone.UTC).getMillis() - } - ), - RowSignature.builder() - .add("CURRENT_TIMESTAMP", ColumnType.LONG) - .add("EXPR$1", ColumnType.LONG) - .add("EXPR$2", ColumnType.LONG) - .add("EXPR$3", ColumnType.LONG) - .add("EXPR$4", ColumnType.LONG) - .add("CURRENT_DATE", ColumnType.LONG) - .add("EXPR$6", ColumnType.LONG) - .build() - ) - ) - .intervals(querySegmentSpec(Filtration.eternity())) - .columns("CURRENT_TIMESTAMP", "EXPR$1", "EXPR$2", "EXPR$3", "EXPR$4", "CURRENT_DATE", "EXPR$6") - .columnTypes(ColumnType.LONG, ColumnType.LONG, ColumnType.LONG, ColumnType.LONG, ColumnType.LONG, ColumnType.LONG, ColumnType.LONG) - .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) - .context(context) - .build() + .dataSource( + InlineDataSource.fromIterable( + ImmutableList.of( + new Object[]{ + // milliseconds of timestamps as if they were in UTC. This looks strange + // but intentional because they are what Calcite gives us. + // See DruidLogicalValuesRule.getValueFromLiteral() + // and Calcites.calciteDateTimeLiteralToJoda. + new DateTime("2000-01-01T00:00:00.123Z", timeZone) + .withZone(DateTimeZone.UTC).getMillis(), + new DateTime("2000-01-01T00:00:00.000Z", timeZone) + .withZone(DateTimeZone.UTC).getMillis(), + new DateTime("2000-01-01T00:00:00.100Z", timeZone) + .withZone(DateTimeZone.UTC).getMillis(), + new DateTime("2000-01-01T00:00:00.120Z", timeZone) + .withZone(DateTimeZone.UTC).getMillis(), + new DateTime("2000-01-01T00:00:00.123Z", timeZone) + .withZone(DateTimeZone.UTC).getMillis(), + new DateTime("1999-12-31", timeZone).withZone(DateTimeZone.UTC).getMillis(), + new DateTime("2000-01-01", timeZone).withZone(DateTimeZone.UTC).getMillis() + } + ), + RowSignature.builder() + .add("CURRENT_TIMESTAMP", ColumnType.LONG) + .add("EXPR$1", ColumnType.LONG) + .add("EXPR$2", ColumnType.LONG) + .add("EXPR$3", ColumnType.LONG) + .add("EXPR$4", ColumnType.LONG) + .add("CURRENT_DATE", ColumnType.LONG) + .add("EXPR$6", ColumnType.LONG) + .build() + ) + ) + .intervals(querySegmentSpec(Filtration.eternity())) + .columns("CURRENT_TIMESTAMP", "EXPR$1", "EXPR$2", "EXPR$3", "EXPR$4", "CURRENT_DATE", "EXPR$6") + .columnTypes( + ColumnType.LONG, + ColumnType.LONG, + ColumnType.LONG, + ColumnType.LONG, + ColumnType.LONG, + ColumnType.LONG, + ColumnType.LONG + ) + .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) + .context(context) + .build() ), ImmutableList.of( new Object[]{ @@ -1035,7 +1008,7 @@ public void testSelectCountStar() ImmutableList.of(Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE1) .intervals(querySegmentSpec(Filtration.eternity())) - .filters(numericEquality("dim2", 0L, ColumnType.LONG)) + .filters(equality("dim2", 0L, ColumnType.LONG)) .granularity(Granularities.ALL) .aggregators(aggregators( new CountAggregatorFactory("a0"), @@ -1047,7 +1020,7 @@ public void testSelectCountStar() .context(QUERY_CONTEXT_DEFAULT) .build()), ImmutableList.of( - new Object[]{11.0, NullHandling.defaultDoubleValue()} + new Object[]{11.0, null} ) ); @@ -1057,22 +1030,22 @@ public void testSelectCountStar() "SELECT exp(count(*)) + 10, sum(m2) FROM druid.foo WHERE __time >= TIMESTAMP '2999-01-01 00:00:00'", CalciteTests.REGULAR_USER_AUTH_RESULT, ImmutableList.of(Druids.newTimeseriesQueryBuilder() - .dataSource(CalciteTests.DATASOURCE1) - .intervals(querySegmentSpec(Intervals.of( - "2999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z")) - ) - .granularity(Granularities.ALL) - .aggregators(aggregators( - new CountAggregatorFactory("a0"), - new DoubleSumAggregatorFactory("a1", "m2") - )) - .postAggregators( - expressionPostAgg("p0", "(exp(\"a0\") + 10)", ColumnType.DOUBLE) - ) - .context(QUERY_CONTEXT_DEFAULT) - .build()), + .dataSource(CalciteTests.DATASOURCE1) + .intervals(querySegmentSpec(Intervals.of( + "2999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z")) + ) + .granularity(Granularities.ALL) + .aggregators(aggregators( + new CountAggregatorFactory("a0"), + new DoubleSumAggregatorFactory("a1", "m2") + )) + .postAggregators( + expressionPostAgg("p0", "(exp(\"a0\") + 10)", ColumnType.DOUBLE) + ) + .context(QUERY_CONTEXT_DEFAULT) + .build()), ImmutableList.of( - new Object[]{11.0, NullHandling.defaultDoubleValue()} + new Object[]{11.0, null} ) ); @@ -1149,18 +1122,36 @@ public void testSelectStar() .dataSource(CalciteTests.DATASOURCE1) .intervals(querySegmentSpec(Filtration.eternity())) .columns("__time", "dim1", "dim2", "dim3", "cnt", "m1", "m2", "unique_dim1") - .columnTypes(ColumnType.LONG, ColumnType.STRING, ColumnType.STRING, ColumnType.STRING, ColumnType.LONG, ColumnType.FLOAT, ColumnType.DOUBLE, ColumnType.ofComplex("hyperUnique")) + .columnTypes( + ColumnType.LONG, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.LONG, + ColumnType.FLOAT, + ColumnType.DOUBLE, + ColumnType.ofComplex("hyperUnique") + ) .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) .context(QUERY_CONTEXT_DEFAULT) .build() ), ImmutableList.of( new Object[]{timestamp("2000-01-01"), "", "a", "[\"a\",\"b\"]", 1L, 1f, 1.0, "\"AQAAAEAAAA==\""}, - new Object[]{timestamp("2000-01-02"), "10.1", NULL_STRING, "[\"b\",\"c\"]", 1L, 2f, 2.0, "\"AQAAAQAAAAHNBA==\""}, + new Object[]{ + timestamp("2000-01-02"), + "10.1", + null, + "[\"b\",\"c\"]", + 1L, + 2f, + 2.0, + "\"AQAAAQAAAAHNBA==\"" + }, new Object[]{timestamp("2000-01-03"), "2", "", "d", 1L, 3f, 3.0, "\"AQAAAQAAAAOzAg==\""}, new Object[]{timestamp("2001-01-01"), "1", "a", "", 1L, 4f, 4.0, "\"AQAAAQAAAAFREA==\""}, - new Object[]{timestamp("2001-01-02"), "def", "abc", NULL_STRING, 1L, 5f, 5.0, "\"AQAAAQAAAACyEA==\""}, - new Object[]{timestamp("2001-01-03"), "abc", NULL_STRING, NULL_STRING, 1L, 6f, 6.0, "\"AQAAAQAAAAEkAQ==\""} + new Object[]{timestamp("2001-01-02"), "def", "abc", null, 1L, 5f, 5.0, "\"AQAAAQAAAACyEA==\""}, + new Object[]{timestamp("2001-01-03"), "abc", null, null, 1L, 6f, 6.0, "\"AQAAAQAAAAEkAQ==\""} ) ); } @@ -1182,7 +1173,15 @@ public void testSelectStarOnForbiddenTable() .dataSource(CalciteTests.FORBIDDEN_DATASOURCE) .intervals(querySegmentSpec(Filtration.eternity())) .columns("__time", "dim1", "dim2", "cnt", "m1", "m2", "unique_dim1") - .columnTypes(ColumnType.LONG, ColumnType.STRING, ColumnType.STRING, ColumnType.LONG, ColumnType.FLOAT, ColumnType.DOUBLE, ColumnType.ofComplex("hyperUnique")) + .columnTypes( + ColumnType.LONG, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.LONG, + ColumnType.FLOAT, + ColumnType.DOUBLE, + ColumnType.ofComplex("hyperUnique") + ) .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) .context(QUERY_CONTEXT_DEFAULT) .build() @@ -1194,7 +1193,7 @@ public void testSelectStarOnForbiddenTable() "abcd", 1L, 9999.0f, - NullHandling.defaultDoubleValue(), + null, "\"AQAAAQAAAALFBA==\"" }, new Object[]{ @@ -1203,7 +1202,7 @@ public void testSelectStarOnForbiddenTable() "a", 1L, 1234.0f, - NullHandling.defaultDoubleValue(), + null, "\"AQAAAQAAAALFBA==\"" } ) @@ -1240,7 +1239,7 @@ public void testSelectStarOnForbiddenView() ImmutableList.of( new Object[]{ timestamp("2000-01-01"), - NullHandling.defaultStringValue(), + null, "a" }, new Object[]{ @@ -1313,12 +1312,12 @@ public void testUnqualifiedTableName() "SELECT COUNT(*) FROM foo", ImmutableList.of( Druids.newTimeseriesQueryBuilder() - .dataSource(CalciteTests.DATASOURCE1) - .intervals(querySegmentSpec(Filtration.eternity())) - .granularity(Granularities.ALL) - .aggregators(aggregators(new CountAggregatorFactory("a0"))) - .context(QUERY_CONTEXT_DEFAULT) - .build() + .dataSource(CalciteTests.DATASOURCE1) + .intervals(querySegmentSpec(Filtration.eternity())) + .granularity(Granularities.ALL) + .aggregators(aggregators(new CountAggregatorFactory("a0"))) + .context(QUERY_CONTEXT_DEFAULT) + .build() ), ImmutableList.of( new Object[]{6L} @@ -1365,7 +1364,16 @@ public void testSelectStarWithLimit() .dataSource(CalciteTests.DATASOURCE1) .intervals(querySegmentSpec(Filtration.eternity())) .columns("__time", "dim1", "dim2", "dim3", "cnt", "m1", "m2", "unique_dim1") - .columnTypes(ColumnType.LONG, ColumnType.STRING, ColumnType.STRING, ColumnType.STRING, ColumnType.LONG, ColumnType.FLOAT, ColumnType.DOUBLE, ColumnType.ofComplex("hyperUnique")) + .columnTypes( + ColumnType.LONG, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.LONG, + ColumnType.FLOAT, + ColumnType.DOUBLE, + ColumnType.ofComplex("hyperUnique") + ) .limit(2) .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) .context(QUERY_CONTEXT_DEFAULT) @@ -1373,7 +1381,16 @@ public void testSelectStarWithLimit() ), ImmutableList.of( new Object[]{timestamp("2000-01-01"), "", "a", "[\"a\",\"b\"]", 1L, 1.0f, 1.0, "\"AQAAAEAAAA==\""}, - new Object[]{timestamp("2000-01-02"), "10.1", NULL_STRING, "[\"b\",\"c\"]", 1L, 2.0f, 2.0, "\"AQAAAQAAAAHNBA==\""} + new Object[]{ + timestamp("2000-01-02"), + "10.1", + null, + "[\"b\",\"c\"]", + 1L, + 2.0f, + 2.0, + "\"AQAAAQAAAAHNBA==\"" + } ) ); } @@ -1391,7 +1408,16 @@ public void testSelectStarWithLimitAndOffset() .dataSource(CalciteTests.DATASOURCE1) .intervals(querySegmentSpec(Filtration.eternity())) .columns("__time", "dim1", "dim2", "dim3", "cnt", "m1", "m2", "unique_dim1") - .columnTypes(ColumnType.LONG, ColumnType.STRING, ColumnType.STRING, ColumnType.STRING, ColumnType.LONG, ColumnType.FLOAT, ColumnType.DOUBLE, ColumnType.ofComplex("hyperUnique")) + .columnTypes( + ColumnType.LONG, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.LONG, + ColumnType.FLOAT, + ColumnType.DOUBLE, + ColumnType.ofComplex("hyperUnique") + ) .offset(1) .limit(2) .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) @@ -1399,7 +1425,16 @@ public void testSelectStarWithLimitAndOffset() .build() ), ImmutableList.of( - new Object[]{timestamp("2000-01-02"), "10.1", NULL_STRING, "[\"b\",\"c\"]", 1L, 2.0f, 2.0, "\"AQAAAQAAAAHNBA==\""}, + new Object[]{ + timestamp("2000-01-02"), + "10.1", + null, + "[\"b\",\"c\"]", + 1L, + 2.0f, + 2.0, + "\"AQAAAQAAAAHNBA==\"" + }, new Object[]{timestamp("2000-01-03"), "2", "", "d", 1L, 3f, 3.0, "\"AQAAAQAAAAOzAg==\""} ) ); @@ -1426,7 +1461,7 @@ public void testSelectWithProjection() ), ImmutableList.of( new Object[]{"a"}, - new Object[]{NULL_STRING} + new Object[]{null} ) ); } @@ -1444,9 +1479,7 @@ public void testSelectWithExpressionFilter() expressionVirtualColumn("v0", "(\"m1\" + 1)", ColumnType.FLOAT) ) .filters( - NullHandling.replaceWithDefault() - ? selector("v0", "7") - : equality("v0", 7.0, ColumnType.FLOAT) + equality("v0", 7.0, ColumnType.FLOAT) ) .columns("dim1") .columnTypes(ColumnType.STRING) @@ -1473,7 +1506,16 @@ public void testSelectStarWithLimitTimeDescending() .dataSource(CalciteTests.DATASOURCE1) .intervals(querySegmentSpec(Filtration.eternity())) .columns("__time", "dim1", "dim2", "dim3", "cnt", "m1", "m2", "unique_dim1") - .columnTypes(ColumnType.LONG, ColumnType.STRING, ColumnType.STRING, ColumnType.STRING, ColumnType.LONG, ColumnType.FLOAT, ColumnType.DOUBLE, ColumnType.ofComplex("hyperUnique")) + .columnTypes( + ColumnType.LONG, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.LONG, + ColumnType.FLOAT, + ColumnType.DOUBLE, + ColumnType.ofComplex("hyperUnique") + ) .limit(2) .order(Order.DESCENDING) .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) @@ -1481,8 +1523,8 @@ public void testSelectStarWithLimitTimeDescending() .build() ), ImmutableList.of( - new Object[]{timestamp("2001-01-03"), "abc", NULL_STRING, NULL_STRING, 1L, 6f, 6d, "\"AQAAAQAAAAEkAQ==\""}, - new Object[]{timestamp("2001-01-02"), "def", "abc", NULL_STRING, 1L, 5f, 5d, "\"AQAAAQAAAACyEA==\""} + new Object[]{timestamp("2001-01-03"), "abc", null, null, 1L, 6f, 6d, "\"AQAAAQAAAAEkAQ==\""}, + new Object[]{timestamp("2001-01-02"), "def", "abc", null, 1L, 5f, 5d, "\"AQAAAQAAAACyEA==\""} ) ); } @@ -1500,7 +1542,16 @@ public void testSelectStarWithoutLimitTimeAscending() .dataSource(CalciteTests.DATASOURCE1) .intervals(querySegmentSpec(Filtration.eternity())) .columns("__time", "dim1", "dim2", "dim3", "cnt", "m1", "m2", "unique_dim1") - .columnTypes(ColumnType.LONG, ColumnType.STRING, ColumnType.STRING, ColumnType.STRING, ColumnType.LONG, ColumnType.FLOAT, ColumnType.DOUBLE, ColumnType.ofComplex("hyperUnique")) + .columnTypes( + ColumnType.LONG, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.LONG, + ColumnType.FLOAT, + ColumnType.DOUBLE, + ColumnType.ofComplex("hyperUnique") + ) .limit(Long.MAX_VALUE) .order(Order.ASCENDING) .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) @@ -1509,11 +1560,20 @@ public void testSelectStarWithoutLimitTimeAscending() ), ImmutableList.of( new Object[]{timestamp("2000-01-01"), "", "a", "[\"a\",\"b\"]", 1L, 1f, 1.0, "\"AQAAAEAAAA==\""}, - new Object[]{timestamp("2000-01-02"), "10.1", NULL_STRING, "[\"b\",\"c\"]", 1L, 2f, 2.0, "\"AQAAAQAAAAHNBA==\""}, + new Object[]{ + timestamp("2000-01-02"), + "10.1", + null, + "[\"b\",\"c\"]", + 1L, + 2f, + 2.0, + "\"AQAAAQAAAAHNBA==\"" + }, new Object[]{timestamp("2000-01-03"), "2", "", "d", 1L, 3f, 3.0, "\"AQAAAQAAAAOzAg==\""}, new Object[]{timestamp("2001-01-01"), "1", "a", "", 1L, 4f, 4.0, "\"AQAAAQAAAAFREA==\""}, - new Object[]{timestamp("2001-01-02"), "def", "abc", NULL_STRING, 1L, 5f, 5.0, "\"AQAAAQAAAACyEA==\""}, - new Object[]{timestamp("2001-01-03"), "abc", NULL_STRING, NULL_STRING, 1L, 6f, 6.0, "\"AQAAAQAAAAEkAQ==\""} + new Object[]{timestamp("2001-01-02"), "def", "abc", null, 1L, 5f, 5.0, "\"AQAAAQAAAACyEA==\""}, + new Object[]{timestamp("2001-01-03"), "abc", null, null, 1L, 6f, 6.0, "\"AQAAAQAAAAEkAQ==\""} ) ); } @@ -1537,7 +1597,7 @@ public void testSelectSingleColumnTwice() ), ImmutableList.of( new Object[]{"a", "a"}, - new Object[]{NULL_STRING, NULL_STRING} + new Object[]{null, null} ) ); } @@ -1707,10 +1767,10 @@ public void testSelectLimitWrappingAgainAkaIDontReallyQuiteUnderstandCalciteQuer // still a mystery... testQuery( "SELECT \"__time\", \"count\", \"dimHyperUnique\", \"dimMultivalEnumerated\", \"dimMultivalEnumerated2\"," - + " \"dimMultivalSequentialWithNulls\", \"dimSequential\", \"dimSequentialHalfNull\", \"dimUniform\"," - + " \"dimZipf\", \"metFloatNormal\", \"metFloatZipf\", \"metLongSequential\"" - + " FROM druid.lotsocolumns" - + " WHERE __time >= CURRENT_TIMESTAMP - INTERVAL '10' YEAR", + + " \"dimMultivalSequentialWithNulls\", \"dimSequential\", \"dimSequentialHalfNull\", \"dimUniform\"," + + " \"dimZipf\", \"metFloatNormal\", \"metFloatZipf\", \"metLongSequential\"" + + " FROM druid.lotsocolumns" + + " WHERE __time >= CURRENT_TIMESTAMP - INTERVAL '10' YEAR", OUTER_LIMIT_CONTEXT, ImmutableList.of( newScanQueryBuilder() @@ -1731,7 +1791,21 @@ public void testSelectLimitWrappingAgainAkaIDontReallyQuiteUnderstandCalciteQuer "metFloatZipf", "metLongSequential" ) - .columnTypes(ColumnType.LONG, ColumnType.LONG, ColumnType.STRING, ColumnType.STRING, ColumnType.STRING, ColumnType.STRING, ColumnType.STRING, ColumnType.STRING, ColumnType.STRING, ColumnType.STRING, ColumnType.STRING, ColumnType.STRING, ColumnType.STRING) + .columnTypes( + ColumnType.LONG, + ColumnType.LONG, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.STRING + ) .limit(2) .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) .context(OUTER_LIMIT_CONTEXT) @@ -1743,7 +1817,7 @@ public void testSelectLimitWrappingAgainAkaIDontReallyQuiteUnderstandCalciteQuer 1L, "0", "[\"Baz\",\"Baz\",\"Hello\",\"World\"]", - useDefault ? "[\"\",\"Apple\",\"Orange\"]" : "[null,\"Apple\",\"Orange\"]", + "[null,\"Apple\",\"Orange\"]", "[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\"]", "0", "0", @@ -1758,10 +1832,10 @@ public void testSelectLimitWrappingAgainAkaIDontReallyQuiteUnderstandCalciteQuer 1L, "8", "[\"Baz\",\"World\",\"ㅑ ㅓ ㅕ ㅗ ㅛ ㅜ ㅠ ㅡ ㅣ\"]", - useDefault ? "[\"\",\"Corundum\",\"Xylophone\"]" : "[null,\"Corundum\",\"Xylophone\"]", - useDefault ? "" : null, + "[null,\"Corundum\",\"Xylophone\"]", + null, "8", - useDefault ? "" : null, + null, "50515", "9", "4999.0", @@ -1773,10 +1847,10 @@ public void testSelectLimitWrappingAgainAkaIDontReallyQuiteUnderstandCalciteQuer testQuery( "SELECT \"__time\", \"count\", \"dimHyperUnique\", \"dimMultivalEnumerated\", \"dimMultivalEnumerated2\"," - + " \"dimMultivalSequentialWithNulls\", \"dimSequential\", \"dimSequentialHalfNull\", \"dimUniform\"," - + " \"dimZipf\", \"metFloatNormal\", \"metFloatZipf\", \"metLongSequential\", \"metLongUniform\"" - + " FROM druid.lotsocolumns" - + " WHERE __time >= CURRENT_TIMESTAMP - INTERVAL '10' YEAR", + + " \"dimMultivalSequentialWithNulls\", \"dimSequential\", \"dimSequentialHalfNull\", \"dimUniform\"," + + " \"dimZipf\", \"metFloatNormal\", \"metFloatZipf\", \"metLongSequential\", \"metLongUniform\"" + + " FROM druid.lotsocolumns" + + " WHERE __time >= CURRENT_TIMESTAMP - INTERVAL '10' YEAR", OUTER_LIMIT_CONTEXT, ImmutableList.of( newScanQueryBuilder() @@ -1798,7 +1872,22 @@ public void testSelectLimitWrappingAgainAkaIDontReallyQuiteUnderstandCalciteQuer "metLongSequential", "metLongUniform" ) - .columnTypes(ColumnType.LONG, ColumnType.LONG, ColumnType.STRING, ColumnType.STRING, ColumnType.STRING, ColumnType.STRING, ColumnType.STRING, ColumnType.STRING, ColumnType.STRING, ColumnType.STRING, ColumnType.STRING, ColumnType.STRING, ColumnType.STRING, ColumnType.STRING) + .columnTypes( + ColumnType.LONG, + ColumnType.LONG, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.STRING, + ColumnType.STRING + ) .limit(2) .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) .context(OUTER_LIMIT_CONTEXT) @@ -1810,7 +1899,7 @@ public void testSelectLimitWrappingAgainAkaIDontReallyQuiteUnderstandCalciteQuer 1L, "0", "[\"Baz\",\"Baz\",\"Hello\",\"World\"]", - useDefault ? "[\"\",\"Apple\",\"Orange\"]" : "[null,\"Apple\",\"Orange\"]", + "[null,\"Apple\",\"Orange\"]", "[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\"]", "0", "0", @@ -1826,10 +1915,10 @@ public void testSelectLimitWrappingAgainAkaIDontReallyQuiteUnderstandCalciteQuer 1L, "8", "[\"Baz\",\"World\",\"ㅑ ㅓ ㅕ ㅗ ㅛ ㅜ ㅠ ㅡ ㅣ\"]", - useDefault ? "[\"\",\"Corundum\",\"Xylophone\"]" : "[null,\"Corundum\",\"Xylophone\"]", - useDefault ? "" : null, + "[null,\"Corundum\",\"Xylophone\"]", + null, "8", - useDefault ? "" : null, + null, "50515", "9", "4999.0", @@ -1929,8 +2018,8 @@ public void testOrderThenLimitThenFilter() { testQuery( "SELECT dim1 FROM " - + "(SELECT __time, dim1 FROM druid.foo ORDER BY __time DESC LIMIT 4) " - + "WHERE dim1 IN ('abc', 'def')", + + "(SELECT __time, dim1 FROM druid.foo ORDER BY __time DESC LIMIT 4) " + + "WHERE dim1 IN ('abc', 'def')", ImmutableList.of( newScanQueryBuilder() .dataSource( @@ -1968,20 +2057,22 @@ public void testAggregateFilterInTheAbsenceOfProjection() cannotVectorize(); testQuery( "select count(1) filter (where __time > date '2023-01-01') " + - " from druid.foo where 'a' = 'b'", + " from druid.foo where 'a' = 'b'", ImmutableList.of( Druids.newTimeseriesQueryBuilder() - .dataSource(InlineDataSource.fromIterable( - ImmutableList.of(), - RowSignature.builder().add("$f1", ColumnType.LONG).build())) - .intervals(querySegmentSpec(Filtration.eternity())) - .granularity(Granularities.ALL) - .aggregators(aggregators( - new FilteredAggregatorFactory( - new CountAggregatorFactory("a0"), expressionFilter("\"$f1\"")))) - .context(QUERY_CONTEXT_DEFAULT) - .build()), - ImmutableList.of(new Object[] {0L})); + .dataSource(InlineDataSource.fromIterable( + ImmutableList.of(), + RowSignature.builder().add("$f1", ColumnType.LONG).build() + )) + .intervals(querySegmentSpec(Filtration.eternity())) + .granularity(Granularities.ALL) + .aggregators(aggregators( + new FilteredAggregatorFactory( + new CountAggregatorFactory("a0"), expressionFilter("\"$f1\"")))) + .context(QUERY_CONTEXT_DEFAULT) + .build()), + ImmutableList.of(new Object[]{0L}) + ); } @Test @@ -1995,29 +2086,32 @@ public void testCountDistinctNonApproximateEmptySet() CalciteTests.REGULAR_USER_AUTH_RESULT, ImmutableList.of( GroupByQuery.builder() - .setDataSource( - GroupByQuery.builder() - .setDataSource(CalciteTests.DATASOURCE1) + .setDataSource( + GroupByQuery.builder() + .setDataSource(CalciteTests.DATASOURCE1) + .setInterval(querySegmentSpec(Filtration.eternity())) + .setGranularity(Granularities.ALL) + .setDimensions( + dimensions( + new DefaultDimensionSpec("m1", "d0", ColumnType.FLOAT))) + .setDimFilter( + range("m1", ColumnType.DOUBLE, null, -1.0, false, true)) + .build()) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions( - dimensions( - new DefaultDimensionSpec("m1", "d0", ColumnType.FLOAT))) - .setDimFilter( - range("m1", ColumnType.DOUBLE, null, -1.0, false, true)) - .build()) - .setInterval(querySegmentSpec(Filtration.eternity())) - .setGranularity(Granularities.ALL) - .setAggregatorSpecs(aggregators( - useDefault - ? new CountAggregatorFactory("a0") - : new FilteredAggregatorFactory( - new CountAggregatorFactory("a0"), - notNull("d0")))) - .build() + .setAggregatorSpecs( + aggregators( + new FilteredAggregatorFactory( + new CountAggregatorFactory("a0"), + notNull("d0") + ) + ) + ) + .build() ), - ImmutableList.of(new Object[] {0L})); + ImmutableList.of(new Object[]{0L}) + ); } @Test @@ -2031,28 +2125,32 @@ public void testCountDistinctNonApproximateBasic() CalciteTests.REGULAR_USER_AUTH_RESULT, ImmutableList.of( GroupByQuery.builder() - .setDataSource( - GroupByQuery.builder() - .setDataSource(CalciteTests.DATASOURCE1) + .setDataSource( + GroupByQuery.builder() + .setDataSource(CalciteTests.DATASOURCE1) + .setInterval(querySegmentSpec(Filtration.eternity())) + .setGranularity(Granularities.ALL) + .setDimensions( + dimensions( + new DefaultDimensionSpec("m1", "d0", ColumnType.FLOAT))) + .setDimFilter( + range("m1", ColumnType.DOUBLE, null, 111.0, false, true)) + .build()) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions( - dimensions( - new DefaultDimensionSpec("m1", "d0", ColumnType.FLOAT))) - .setDimFilter( - range("m1", ColumnType.DOUBLE, null, 111.0, false, true)) - .build()) - .setInterval(querySegmentSpec(Filtration.eternity())) - .setGranularity(Granularities.ALL) - .setAggregatorSpecs(aggregators(useDefault - ? new CountAggregatorFactory("a0") - : new FilteredAggregatorFactory( - new CountAggregatorFactory("a0"), - notNull("d0")))) - .build() + .setAggregatorSpecs( + aggregators( + new FilteredAggregatorFactory( + new CountAggregatorFactory("a0"), + notNull("d0") + ) + ) + ) + .build() ), - ImmutableList.of(new Object[] {6L})); + ImmutableList.of(new Object[]{6L}) + ); } @Test @@ -2067,31 +2165,35 @@ public void testCountDistinctNonApproximateWithFilter() CalciteTests.REGULAR_USER_AUTH_RESULT, ImmutableList.of( GroupByQuery.builder() - .setDataSource( - GroupByQuery.builder() - .setDataSource(CalciteTests.DATASOURCE1) + .setDataSource( + GroupByQuery.builder() + .setDataSource(CalciteTests.DATASOURCE1) + .setInterval(querySegmentSpec(Filtration.eternity())) + .setGranularity(Granularities.ALL) + .setDimensions( + dimensions( + new DefaultDimensionSpec("v0", "d0", ColumnType.FLOAT))) + .setVirtualColumns( + expressionVirtualColumn( + "v0", "case_searched((\"m1\" < -1.0),\"m1\",null)", + ColumnType.FLOAT + )) + .build()) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions( - dimensions( - new DefaultDimensionSpec("v0", "d0", ColumnType.FLOAT))) - .setVirtualColumns( - expressionVirtualColumn("v0", "case_searched((\"m1\" < -1.0),\"m1\",null)", - ColumnType.FLOAT)) - .build()) - .setInterval(querySegmentSpec(Filtration.eternity())) - .setGranularity(Granularities.ALL) - .setAggregatorSpecs(aggregators( - useDefault - ? new CountAggregatorFactory("a0") - : new FilteredAggregatorFactory( - new CountAggregatorFactory("a0"), - notNull("d0")))) - .build() + .setAggregatorSpecs( + aggregators( + new FilteredAggregatorFactory( + new CountAggregatorFactory("a0"), + notNull("d0") + ) + ) + ) + .build() ), - // returning 1 is incorrect result; but with nulls as default that should be expected - ImmutableList.of(new Object[] {useDefault ? 1L : 0L})); + ImmutableList.of(new Object[]{0L}) + ); } @Test @@ -2106,33 +2208,38 @@ public void testCountDistinctNonApproximateWithFilterHaving() CalciteTests.REGULAR_USER_AUTH_RESULT, ImmutableList.of( GroupByQuery.builder() - .setDataSource( - GroupByQuery.builder() - .setDataSource(CalciteTests.DATASOURCE1) + .setDataSource( + GroupByQuery.builder() + .setDataSource(CalciteTests.DATASOURCE1) + .setInterval(querySegmentSpec(Filtration.eternity())) + .setGranularity(Granularities.ALL) + .setDimensions( + dimensions( + new DefaultDimensionSpec("v0", "d0", ColumnType.FLOAT))) + .setVirtualColumns( + expressionVirtualColumn( + "v0", "case_searched((\"m1\" < -1.0),\"m1\",null)", + ColumnType.FLOAT + )) + .build()) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions( - dimensions( - new DefaultDimensionSpec("v0", "d0", ColumnType.FLOAT))) - .setVirtualColumns( - expressionVirtualColumn("v0", "case_searched((\"m1\" < -1.0),\"m1\",null)", - ColumnType.FLOAT)) - .build()) - .setInterval(querySegmentSpec(Filtration.eternity())) - .setGranularity(Granularities.ALL) - .setHavingSpec(having( - range("a0", ColumnType.LONG, 3L, null, true, false) - )) - .setAggregatorSpecs(aggregators( - useDefault - ? new CountAggregatorFactory("a0") - : new FilteredAggregatorFactory( - new CountAggregatorFactory("a0"), - notNull("d0")))) - .build() + .setHavingSpec(having( + range("a0", ColumnType.LONG, 3L, null, true, false) + )) + .setAggregatorSpecs( + aggregators( + new FilteredAggregatorFactory( + new CountAggregatorFactory("a0"), + notNull("d0") + ) + ) + ) + .build() ), - ImmutableList.of()); + ImmutableList.of() + ); } @SqlTestFrameworkConfig.ResultCache(ResultCacheMode.ENABLED) @@ -2146,7 +2253,7 @@ public void testCacheKeyConsistency() .sql("select dim1,dbl1 from numfoo where 0.0 < dbl1 and dbl1 < 1.25 group by dim1,dbl1") .expectedResults( ImmutableList.of( - new Object[] {"", 1.0D} + new Object[]{"", 1.0D} ) ) .run(); @@ -2155,8 +2262,8 @@ public void testCacheKeyConsistency() .sql("select dim1,dbl1 from numfoo where 0.0 < dbl1 and dbl1 < 1.75 group by dim1,dbl1") .expectedResults( ImmutableList.of( - new Object[] {"", 1.0D}, - new Object[] {"10.1", 1.7D} + new Object[]{"", 1.0D}, + new Object[]{"10.1", 1.7D} ) ) .run(); @@ -2215,13 +2322,13 @@ public void testSqlToRelInConversion() testBuilder() .sql( "SELECT channel FROM wikipedia\n" - + "WHERE channel in ('#en.wikipedia') and channel = '#en.wikipedia' and\n" - + "isRobot = 'false'\n" - + "LIMIT 1" + + "WHERE channel in ('#en.wikipedia') and channel = '#en.wikipedia' and\n" + + "isRobot = 'false'\n" + + "LIMIT 1" ) .expectedResults( ImmutableList.of( - new Object[] {"#en.wikipedia"} + new Object[]{"#en.wikipedia"} ) ) .run(); diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteSimpleQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteSimpleQueryTest.java index 3d7d2a2de33e..e5ea8f046ace 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteSimpleQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteSimpleQueryTest.java @@ -20,7 +20,6 @@ package org.apache.druid.sql.calcite; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.query.aggregation.LongSumAggregatorFactory; @@ -72,15 +71,7 @@ public void testGroupByTimeAndDim() .setContext(withTimestampResultContext(QUERY_CONTEXT_DEFAULT, "d0", 0, Granularities.MONTH)) .build() ), - NullHandling.replaceWithDefault() - ? ImmutableList.of( - new Object[]{timestamp("2000-01-01"), "", 2L}, - new Object[]{timestamp("2000-01-01"), "a", 1L}, - new Object[]{timestamp("2001-01-01"), "", 1L}, - new Object[]{timestamp("2001-01-01"), "a", 1L}, - new Object[]{timestamp("2001-01-01"), "abc", 1L} - ) - : ImmutableList.of( + ImmutableList.of( new Object[]{timestamp("2000-01-01"), null, 1L}, new Object[]{timestamp("2000-01-01"), "", 1L}, new Object[]{timestamp("2000-01-01"), "a", 1L}, @@ -120,15 +111,7 @@ public void testGroupByDimAndTime() .setContext(withTimestampResultContext(QUERY_CONTEXT_DEFAULT, "d1", 1, Granularities.MONTH)) .build() ), - NullHandling.replaceWithDefault() - ? ImmutableList.of( - new Object[]{"", timestamp("2000-01-01"), 2L}, - new Object[]{"", timestamp("2001-01-01"), 1L}, - new Object[]{"a", timestamp("2000-01-01"), 1L}, - new Object[]{"a", timestamp("2001-01-01"), 1L}, - new Object[]{"abc", timestamp("2001-01-01"), 1L} - ) - : ImmutableList.of( + ImmutableList.of( new Object[]{null, timestamp("2000-01-01"), 1L}, new Object[]{null, timestamp("2001-01-01"), 1L}, new Object[]{"", timestamp("2000-01-01"), 1L}, @@ -169,13 +152,7 @@ public void testGroupByDimAndTimeWhereOnTime() .setContext(withTimestampResultContext(QUERY_CONTEXT_DEFAULT, "d1", 1, Granularities.MONTH)) .build() ), - NullHandling.replaceWithDefault() - ? ImmutableList.of( - new Object[]{"", timestamp("2001-01-01"), 1L}, - new Object[]{"a", timestamp("2001-01-01"), 1L}, - new Object[]{"abc", timestamp("2001-01-01"), 1L} - ) - : ImmutableList.of( + ImmutableList.of( new Object[]{null, timestamp("2001-01-01"), 1L}, new Object[]{"a", timestamp("2001-01-01"), 1L}, new Object[]{"abc", timestamp("2001-01-01"), 1L} @@ -214,13 +191,7 @@ public void testGroupByDimAndTimeOnDim() .setContext(withTimestampResultContext(QUERY_CONTEXT_DEFAULT, "d1", 1, Granularities.MONTH)) .build() ), - NullHandling.replaceWithDefault() - ? ImmutableList.of( - new Object[]{"a", timestamp("2000-01-01"), 1L}, - new Object[]{"a", timestamp("2001-01-01"), 1L}, - new Object[]{"abc", timestamp("2001-01-01"), 1L} - ) - : ImmutableList.of( + ImmutableList.of( new Object[]{"a", timestamp("2000-01-01"), 1L}, new Object[]{"a", timestamp("2001-01-01"), 1L}, new Object[]{"abc", timestamp("2001-01-01"), 1L} @@ -264,15 +235,7 @@ public void testGroupByTimeAndDimOrderByDim() .setContext(withTimestampResultContext(QUERY_CONTEXT_DEFAULT, "d0", 0, Granularities.MONTH)) .build() ), - NullHandling.replaceWithDefault() - ? ImmutableList.of( - new Object[]{timestamp("2000-01-01"), "", 2L}, - new Object[]{timestamp("2001-01-01"), "", 1L}, - new Object[]{timestamp("2000-01-01"), "a", 1L}, - new Object[]{timestamp("2001-01-01"), "a", 1L}, - new Object[]{timestamp("2001-01-01"), "abc", 1L} - ) - : ImmutableList.of( + ImmutableList.of( new Object[]{timestamp("2000-01-01"), null, 1L}, new Object[]{timestamp("2001-01-01"), null, 1L}, new Object[]{timestamp("2000-01-01"), "", 1L}, @@ -319,15 +282,7 @@ public void testGroupByTimeAndDimOrderByDimDesc() .setContext(withTimestampResultContext(QUERY_CONTEXT_DEFAULT, "d0", 0, Granularities.MONTH)) .build() ), - NullHandling.replaceWithDefault() - ? ImmutableList.of( - new Object[]{timestamp("2001-01-01"), "abc", 1L}, - new Object[]{timestamp("2000-01-01"), "a", 1L}, - new Object[]{timestamp("2001-01-01"), "a", 1L}, - new Object[]{timestamp("2000-01-01"), "", 2L}, - new Object[]{timestamp("2001-01-01"), "", 1L} - ) - : ImmutableList.of( + ImmutableList.of( new Object[]{timestamp("2001-01-01"), "abc", 1L}, new Object[]{timestamp("2000-01-01"), "a", 1L}, new Object[]{timestamp("2001-01-01"), "a", 1L}, @@ -376,15 +331,7 @@ public void testGroupByDimAndTimeOrderByTime() .setContext(withTimestampResultContext(QUERY_CONTEXT_DEFAULT, "d1", 1, Granularities.MONTH)) .build() ), - NullHandling.replaceWithDefault() - ? ImmutableList.of( - new Object[]{"", timestamp("2000-01-01"), 2L}, - new Object[]{"a", timestamp("2000-01-01"), 1L}, - new Object[]{"", timestamp("2001-01-01"), 1L}, - new Object[]{"a", timestamp("2001-01-01"), 1L}, - new Object[]{"abc", timestamp("2001-01-01"), 1L} - ) - : ImmutableList.of( + ImmutableList.of( new Object[]{null, timestamp("2000-01-01"), 1L}, new Object[]{"", timestamp("2000-01-01"), 1L}, new Object[]{"a", timestamp("2000-01-01"), 1L}, @@ -433,15 +380,7 @@ public void testGroupByDimAndTimeOrderByTimeDesc() .setContext(withTimestampResultContext(QUERY_CONTEXT_DEFAULT, "d1", 1, Granularities.MONTH)) .build() ), - NullHandling.replaceWithDefault() - ? ImmutableList.of( - new Object[]{"", timestamp("2001-01-01"), 1L}, - new Object[]{"a", timestamp("2001-01-01"), 1L}, - new Object[]{"abc", timestamp("2001-01-01"), 1L}, - new Object[]{"", timestamp("2000-01-01"), 2L}, - new Object[]{"a", timestamp("2000-01-01"), 1L} - ) - : ImmutableList.of( + ImmutableList.of( new Object[]{null, timestamp("2001-01-01"), 1L}, new Object[]{"a", timestamp("2001-01-01"), 1L}, new Object[]{"abc", timestamp("2001-01-01"), 1L}, @@ -491,15 +430,7 @@ public void testGroupByDimAndTimeOrderByTimeAndDim() .setContext(withTimestampResultContext(QUERY_CONTEXT_DEFAULT, "d1", 1, Granularities.MONTH)) .build() ), - NullHandling.replaceWithDefault() - ? ImmutableList.of( - new Object[]{"a", timestamp("2000-01-01"), 1L}, - new Object[]{"", timestamp("2000-01-01"), 2L}, - new Object[]{"abc", timestamp("2001-01-01"), 1L}, - new Object[]{"a", timestamp("2001-01-01"), 1L}, - new Object[]{"", timestamp("2001-01-01"), 1L} - ) - : ImmutableList.of( + ImmutableList.of( new Object[]{"a", timestamp("2000-01-01"), 1L}, new Object[]{"", timestamp("2000-01-01"), 1L}, new Object[]{null, timestamp("2000-01-01"), 1L}, @@ -549,15 +480,7 @@ public void testGroupByDimAndTimeOrderByDimAndTime() .setContext(withTimestampResultContext(QUERY_CONTEXT_DEFAULT, "d1", 1, Granularities.MONTH)) .build() ), - NullHandling.replaceWithDefault() - ? ImmutableList.of( - new Object[]{"", timestamp("2001-01-01"), 1L}, - new Object[]{"", timestamp("2000-01-01"), 2L}, - new Object[]{"a", timestamp("2001-01-01"), 1L}, - new Object[]{"a", timestamp("2000-01-01"), 1L}, - new Object[]{"abc", timestamp("2001-01-01"), 1L} - ) - : ImmutableList.of( + ImmutableList.of( new Object[]{null, timestamp("2001-01-01"), 1L}, new Object[]{null, timestamp("2000-01-01"), 1L}, new Object[]{"", timestamp("2000-01-01"), 1L}, @@ -609,16 +532,7 @@ public void testGroupByDimAndTimeAndDimOrderByDimAndTimeDim() .setContext(withTimestampResultContext(QUERY_CONTEXT_DEFAULT, "d1", 1, Granularities.MONTH)) .build() ), - NullHandling.replaceWithDefault() - ? ImmutableList.of( - new Object[]{"abc", timestamp("2001-01-01"), "def", 1L}, - new Object[]{"a", timestamp("2001-01-01"), "1", 1L}, - new Object[]{"a", timestamp("2000-01-01"), "", 1L}, - new Object[]{"", timestamp("2001-01-01"), "abc", 1L}, - new Object[]{"", timestamp("2000-01-01"), "10.1", 1L}, - new Object[]{"", timestamp("2000-01-01"), "2", 1L} - ) - : ImmutableList.of( + ImmutableList.of( new Object[]{"abc", timestamp("2001-01-01"), "def", 1L}, new Object[]{"a", timestamp("2001-01-01"), "1", 1L}, new Object[]{"a", timestamp("2000-01-01"), "", 1L}, @@ -670,11 +584,9 @@ public void testEarliestByLatestByWithExpression() .setContext(QUERY_CONTEXT_DEFAULT) .build())) .expectedResults( - useDefault ? ImmutableList.of( - new Object[]{"#ar.wikipedia", "", "", "", "", ""}, - new Object[] {"#ar.wikipedia", "Amman", "Amman", "Amman", "Amman", "Amman"}) - : ImmutableList.of( - new Object[] {"#ar.wikipedia", "Amman", "Amman", "Amman", "Amman", "Amman"}) + ImmutableList.of( + new Object[] {"#ar.wikipedia", "Amman", "Amman", "Amman", "Amman", "Amman"} + ) ) .run(); } diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteSubqueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteSubqueryTest.java index 38ac3f2b2912..71ef8964fc59 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteSubqueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteSubqueryTest.java @@ -22,7 +22,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.inject.Injector; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.data.input.InputRowSchema; import org.apache.druid.data.input.impl.DimensionsSpec; @@ -61,7 +60,6 @@ import org.apache.druid.query.expression.TestExprMacroTable; import org.apache.druid.query.extraction.SubstringDimExtractionFn; import org.apache.druid.query.filter.DimFilter; -import org.apache.druid.query.filter.InDimFilter; import org.apache.druid.query.filter.TypedInFilter; import org.apache.druid.query.groupby.GroupByQuery; import org.apache.druid.query.groupby.orderby.DefaultLimitSpec; @@ -98,7 +96,6 @@ import java.util.Arrays; import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -167,10 +164,6 @@ public void testExactCountDistinctUsingSubqueryWithWhereToOuterFilter(String tes .setContext(queryContext) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{3L, 1L} - ) : ImmutableList.of( new Object[]{2L, 1L} ) @@ -223,8 +216,8 @@ public void testSubqueryOnDataSourceWithMissingColumnsInSegments(String testName .build() ), ImmutableList.of( - new Object[]{946684800000L, "abc", NullHandling.defaultStringValue(), "def", 1L}, - new Object[]{946684800000L, "foo", "bar", NullHandling.defaultStringValue(), 1L} + new Object[]{946684800000L, "abc", null, "def", 1L}, + new Object[]{946684800000L, "foo", "bar", null, 1L} ) ); } @@ -379,7 +372,7 @@ public void testTwoExactCountDistincts(String testName, Map quer .build() ), ImmutableList.of( - new Object[]{NullHandling.sqlCompatible() ? 6L : 5L, NullHandling.sqlCompatible() ? 3L : 2L} + new Object[]{6L, 3L} ) ); } @@ -427,28 +420,19 @@ public void testViewAndJoin(String testName, Map queryContext) ) .intervals(querySegmentSpec(Filtration.eternity())) .virtualColumns( - NullHandling.replaceWithDefault() - ? VirtualColumns.EMPTY - : VirtualColumns.create( + VirtualColumns.create( expressionVirtualColumn("v0", "substring(\"dim1\", 0, 1)", ColumnType.STRING) ) ) .filters( - NullHandling.replaceWithDefault() - ? not(selector("dim1", "z", new SubstringDimExtractionFn(0, 1))) - : not(equality("v0", "z", ColumnType.STRING)) + not(equality("v0", "z", ColumnType.STRING)) ) .granularity(Granularities.ALL) .aggregators(aggregators(new CountAggregatorFactory("a0"))) .context(queryContextModified) .build() ), - NullHandling.replaceWithDefault() - ? ImmutableList.of( - new Object[]{8L} - ) - // in sql compatible mode, expression filter correctly does not match null values... - : ImmutableList.of( + ImmutableList.of( new Object[]{4L} ) ); @@ -544,12 +528,6 @@ public void testUsingSubqueryAsFilterWithInnerSort(String testName, Map q .setContext(queryContext) .build() ), - NullHandling.replaceWithDefault() ? - ImmutableList.of( - new Object[]{3L, 1L} - ) : ImmutableList.of( new Object[]{2L, 1L} ) @@ -946,9 +912,7 @@ public void testUseTimeFloorInsteadOfGranularityOnJoinResult(String testName, Ma .setContext(QUERY_CONTEXT_DEFAULT) .build() ), - NullHandling.sqlCompatible() - ? ImmutableList.of(new Object[]{946684800000L, "", 1L}, new Object[]{946771200000L, "10.1", 1L}) - : ImmutableList.of(new Object[]{946771200000L, "10.1", 1L}) + ImmutableList.of(new Object[]{946684800000L, "", 1L}, new Object[]{946771200000L, "10.1", 1L}) ); } @@ -1071,19 +1035,14 @@ public void testSelfJoin(String testName, Map queryContext) public void testJoinWithSubqueries(String testName, Map queryContext) { List results = new ArrayList<>(ImmutableList.of( - new Object[]{"", NullHandling.defaultStringValue()}, - new Object[]{"10.1", NullHandling.defaultStringValue()}, - new Object[]{"2", NullHandling.defaultStringValue()}, - new Object[]{"1", NullHandling.defaultStringValue()}, - new Object[]{"def", NullHandling.defaultStringValue()}, - new Object[]{"abc", NullHandling.defaultStringValue()} + new Object[]{"", null}, + new Object[]{"10.1", null}, + new Object[]{"2", null}, + new Object[]{"1", null}, + new Object[]{"def", null}, + new Object[]{"abc", null} )); - if (NullHandling.replaceWithDefault()) { - results.add(new Object[]{NullHandling.defaultStringValue(), NullHandling.defaultStringValue()}); - } - - testQuery( "SELECT a.dim1, b.dim2\n" + "FROM (SELECT na.dim1 as dim1, nb.dim2 as dim2 FROM foo na LEFT JOIN foo2 nb ON na.dim1 = nb.dim1) a\n" @@ -1184,7 +1143,7 @@ public void testSingleValueFloatAgg(String testName, Map queryCo ), "j0.", "1", - NullHandling.replaceWithDefault() ? JoinType.LEFT : JoinType.INNER + JoinType.INNER ) ) .intervals(querySegmentSpec(Filtration.eternity())) @@ -1231,7 +1190,7 @@ public void testSingleValueDoubleAgg(String testName, Map queryC ), "j0.", "1", - NullHandling.replaceWithDefault() ? JoinType.LEFT : JoinType.INNER + JoinType.INNER ) ) .intervals(querySegmentSpec(Filtration.eternity())) @@ -1284,7 +1243,7 @@ public void testSingleValueLongAgg(String testName, Map queryCon ), "j0.", "1", - NullHandling.replaceWithDefault() ? JoinType.LEFT : JoinType.INNER + JoinType.INNER ) ) .intervals(querySegmentSpec(Filtration.eternity())) @@ -1412,28 +1371,16 @@ public void testGroupBySubqueryWithEarliestAggregator(String testName, Map expectedResults; - if (NullHandling.replaceWithDefault()) { - expectedResults = ImmutableList.of( - new Object[]{"1", "", "a", "1"}, - new Object[]{"10.1", "b", "", "10.1"}, - new Object[]{"10.1", "c", "", "10.1"}, - new Object[]{"2", "d", "", "2"}, - new Object[]{"abc", "", "", "abc"}, - new Object[]{"def", "", "abc", "def"} - ); - } else { - expectedResults = ImmutableList.of( - new Object[]{"", "a", "a", ""}, - new Object[]{"", "b", "a", ""}, - new Object[]{"1", "", "a", "1"}, - new Object[]{"10.1", "b", null, "10.1"}, - new Object[]{"10.1", "c", null, "10.1"}, - new Object[]{"2", "d", "", "2"}, - new Object[]{"abc", null, null, "abc"}, - new Object[]{"def", null, "abc", "def"} - ); - } + final List expectedResults = ImmutableList.of( + new Object[]{"", "a", "a", ""}, + new Object[]{"", "b", "a", ""}, + new Object[]{"1", "", "a", "1"}, + new Object[]{"10.1", "b", null, "10.1"}, + new Object[]{"10.1", "c", null, "10.1"}, + new Object[]{"2", "d", "", "2"}, + new Object[]{"abc", null, null, "abc"}, + new Object[]{"def", null, "abc", "def"} + ); testQuery( "SELECT a.dim1, a.dim3, a.e_dim2, b.dim1 " @@ -1491,25 +1438,14 @@ public void testGroupBySubqueryWithEarliestAggregator(String testName, Map queryContext) { - final List expectedResults; - if (NullHandling.replaceWithDefault()) { - expectedResults = ImmutableList.of( - new Object[]{"1", "a", "1"}, - new Object[]{"10.1", "", "10.1"}, - new Object[]{"2", "", "2"}, - new Object[]{"abc", "", "abc"}, - new Object[]{"def", "abc", "def"} - ); - } else { - expectedResults = ImmutableList.of( - new Object[]{"", "a", ""}, - new Object[]{"1", "a", "1"}, - new Object[]{"10.1", null, "10.1"}, - new Object[]{"2", "", "2"}, - new Object[]{"abc", null, "abc"}, - new Object[]{"def", "abc", "def"} - ); - } + final List expectedResults = ImmutableList.of( + new Object[]{"", "a", ""}, + new Object[]{"1", "a", "1"}, + new Object[]{"10.1", null, "10.1"}, + new Object[]{"2", "", "2"}, + new Object[]{"abc", null, "abc"}, + new Object[]{"def", "abc", "def"} + ); testQuery( "SELECT a.dim1, a.e_dim2, b.dim1 " @@ -1619,11 +1555,11 @@ public void testTimeseriesSubqueryWithEarliestAggregator(String testName, Map queryContext) { cannotVectorizeUnlessFallback(); - DimFilter filter = NullHandling.replaceWithDefault() - ? new InDimFilter("v0", new HashSet<>(Arrays.asList("1", "17"))) - : new TypedInFilter("v0", ColumnType.LONG, null, ImmutableList.of(1, 17), null); + DimFilter filter = new TypedInFilter("v0", ColumnType.LONG, null, ImmutableList.of(1, 17), null); testQuery( "select countryName from " + "(select countryName, length(countryName) as cname from wikipedia group by countryName) " diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteUnionQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteUnionQueryTest.java index c3b91458227a..4b1f6d3654ff 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteUnionQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteUnionQueryTest.java @@ -20,7 +20,6 @@ package org.apache.druid.sql.calcite; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.query.TableDataSource; @@ -290,9 +289,8 @@ public void testUnionDifferentColumnOrder() ResultMatchMode.RELAX_NULLS, ImmutableList.of( new Object[] {null, "10.1", 2.0F}, - // these 2 results invert order because in compatible mode `null` becomes "" and thus they change order - NullHandling.sqlCompatible() ? new Object[] {null, "abc", 6.0F} : new Object[] {"", "2", 3.0F}, - NullHandling.sqlCompatible() ? new Object[] {"", "2", 3.0F} : new Object[] {null, "abc", 6.0F}, + new Object[] {null, "abc", 6.0F}, + new Object[] {"", "2", 3.0F}, new Object[] {"a", "", 1.0F}, new Object[] {"a", "1", 4.0F}, new Object[] {"abc", "def", 5.0F}, diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledExtension.java b/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledExtension.java index be9e388fb39e..341d5599e630 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledExtension.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledExtension.java @@ -20,7 +20,6 @@ package org.apache.druid.sql.calcite; import com.google.common.collect.ImmutableMap; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.math.expr.ExpressionProcessing; import org.apache.druid.query.Query; import org.apache.druid.query.QueryContexts; @@ -84,16 +83,7 @@ public SqlTestFramework.PlannerFixture plannerFixture(PlannerConfig plannerConfi public DruidQTestInfo getQTestInfo() { if (runQuidem) { - final String testName; - if (decTestConfig.separateDefaultModeTest()) { - if (NullHandling.sqlCompatible()) { - testName = BaseCalciteQueryTest.queryFrameworkRule.testName() + "@NullHandling=sql"; - } else { - testName = BaseCalciteQueryTest.queryFrameworkRule.testName() + "@NullHandling=default"; - } - } else { - testName = BaseCalciteQueryTest.queryFrameworkRule.testName(); - } + final String testName = BaseCalciteQueryTest.queryFrameworkRule.testName(); return new DruidQTestInfo( qCaseDir, testName, diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java b/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java index ba46dea8008b..a0c8beb42866 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java @@ -172,6 +172,4 @@ public boolean isPresent() return this != NONE; } } - - boolean separateDefaultModeTest() default false; } diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/DisableUnless.java b/sql/src/test/java/org/apache/druid/sql/calcite/DisableUnless.java deleted file mode 100644 index eead4c61a6a8..000000000000 --- a/sql/src/test/java/org/apache/druid/sql/calcite/DisableUnless.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.druid.sql.calcite; - -import com.google.common.base.Supplier; -import org.apache.druid.common.config.NullHandling; -import org.junit.jupiter.api.extension.ConditionEvaluationResult; -import org.junit.jupiter.api.extension.ExecutionCondition; -import org.junit.jupiter.api.extension.ExtensionContext; - -/** - * Collection of conditional disabler rules. - */ -class DisableUnless -{ - public static final DisableUnlessRule SQL_COMPATIBLE = new DisableUnlessRule( - "NullHandling::sqlCompatible", NullHandling::sqlCompatible - ); - - public static class DisableUnlessRule implements ExecutionCondition - { - private Supplier predicate; - private String message; - - public DisableUnlessRule(String message, Supplier predicate) - { - this.message = message; - this.predicate = predicate; - } - - @Override - public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) - { - if (predicate.get()) { - return ConditionEvaluationResult.enabled("condition not met"); - } else { - return ConditionEvaluationResult.disabled(message); - } - } - } -} diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/DrillWindowQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/DrillWindowQueryTest.java index 7c21e7f655f7..41bc0ef8d1ac 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/DrillWindowQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/DrillWindowQueryTest.java @@ -26,7 +26,6 @@ import org.apache.calcite.sql.SqlNode; import org.apache.calcite.sql2rel.SqlToRelConverter; import org.apache.commons.io.FileUtils; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.Numbers; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.java.util.common.parsers.TimestampParser; @@ -37,7 +36,6 @@ import org.apache.druid.segment.column.ValueType; import org.apache.druid.segment.join.JoinableFactoryWrapper; import org.apache.druid.server.SpecificSegmentsQuerySegmentWalker; -import org.apache.druid.sql.calcite.DisableUnless.DisableUnlessRule; import org.apache.druid.sql.calcite.DrillWindowQueryTest.DrillComponentSupplier; import org.apache.druid.sql.calcite.NotYetSupported.Modes; import org.apache.druid.sql.calcite.NotYetSupported.NotYetSupportedProcessor; @@ -55,7 +53,6 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; - import java.io.File; import java.io.IOException; import java.io.InputStream; @@ -99,13 +96,6 @@ @SqlTestFrameworkConfig.ComponentSupplier(DrillComponentSupplier.class) public class DrillWindowQueryTest extends BaseCalciteQueryTest { - static { - NullHandling.initializeForTests(); - } - - @RegisterExtension - public DisableUnlessRule disableWhenNonSqlCompat = DisableUnless.SQL_COMPATIBLE; - @RegisterExtension public NotYetSupportedProcessor ignoreProcessor = new NotYetSupportedProcessor(); diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/expression/DruidExpressionTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/expression/DruidExpressionTest.java index 5e6d5b067e63..d0a25c59df88 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/expression/DruidExpressionTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/expression/DruidExpressionTest.java @@ -19,7 +19,6 @@ package org.apache.druid.sql.calcite.expression; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.math.expr.Expr; import org.apache.druid.math.expr.ExprMacroTable; import org.apache.druid.math.expr.ExpressionType; @@ -168,7 +167,7 @@ public void test_ofLiteral_emptyString() Assert.assertEquals(ColumnType.STRING, expression.getDruidType()); Assert.assertEquals("''", expression.getExpression()); Assert.assertEquals( - NullHandling.emptyToNullIfNeeded(s), + s, Parser.parse(expression.getExpression(), ExprMacroTable.nil()).getLiteralValue() ); } diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/expression/ExpressionsTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/expression/ExpressionsTest.java index 3b5b9c1de135..fc51c1d7457d 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/expression/ExpressionsTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/expression/ExpressionsTest.java @@ -33,7 +33,6 @@ import org.apache.calcite.sql.fun.SqlTrimFunction; import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.calcite.sql.type.SqlTypeName; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.java.util.common.StringUtils; @@ -373,7 +372,7 @@ public void testRegexpExtract() SimpleExtraction.of("s", new RegexDimExtractionFn("", 0, true, null)), "regexp_extract(\"s\",'')" ), - NullHandling.emptyToNullIfNeeded("") + "" ); testHelper.testExpressionString( @@ -386,7 +385,7 @@ public void testRegexpExtract() SimpleExtraction.of("s", new RegexDimExtractionFn("", 0, true, null)), "regexp_extract(\"s\",'')" ), - NullHandling.emptyToNullIfNeeded("") + "" ); testHelper.testExpressionString( @@ -598,7 +597,7 @@ public void testRegexpLike() testHelper.makeLiteral("(.)") ), makeExpression("regexp_like(null,'(.)')"), - NullHandling.sqlCompatible() ? null : 0L + null ); testHelper.testExpressionString( @@ -608,9 +607,7 @@ public void testRegexpLike() testHelper.makeLiteral("") ), makeExpression("regexp_like(null,'')"), - - // In SQL-compatible mode, nulls don't match anything. Otherwise, they match like empty strings. - NullHandling.sqlCompatible() ? null : 1L + null ); testHelper.testExpressionString( @@ -620,7 +617,7 @@ public void testRegexpLike() testHelper.makeLiteral("null") ), makeExpression("regexp_like(null,'null')"), - NullHandling.sqlCompatible() ? null : 0L + null ); } @@ -806,7 +803,7 @@ public void testStrpos() testHelper.makeLiteral("ax") ), makeExpression("(strpos(null,'ax') + 1)"), - NullHandling.replaceWithDefault() ? 0L : null + null ); } @@ -1278,35 +1275,6 @@ public void testRound() ); } - @Test - public void testRoundWithInvalidArgument() - { - - final SqlOperator roundFunction = getOperatorConversion(SqlStdOperatorTable.ROUND).calciteOperator(); - - if (!NullHandling.sqlCompatible()) { - Throwable t = Assert.assertThrows( - DruidException.class, - () -> testHelper.testExpression( - roundFunction, - testHelper.makeInputRef("s"), - DruidExpression.ofExpression( - ColumnType.STRING, - DruidExpression.functionCall("round"), - ImmutableList.of( - DruidExpression.ofColumn(ColumnType.STRING, "s") - ) - ), - NullHandling.sqlCompatible() ? null : "IAE Exception" - ) - ); - Assert.assertEquals( - "Function[round] first argument should be a LONG or DOUBLE but got STRING instead", - t.getMessage() - ); - } - } - @Test public void testRoundWithInvalidSecondArgument() { diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/rel/DruidQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/rel/DruidQueryTest.java index 6de0d973b378..70d76d4c7537 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/rel/DruidQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/rel/DruidQueryTest.java @@ -19,7 +19,6 @@ package org.apache.druid.sql.calcite.rel; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.Pair; import org.apache.druid.math.expr.ExprMacroTable; @@ -46,11 +45,6 @@ public class DruidQueryTest { - - static { - NullHandling.initializeForTests(); - } - private final DimFilter selectorFilter = new SelectorDimFilter("column", "value", null); private final DimFilter otherFilter = new SelectorDimFilter("column_2", "value_2", null); private final DimFilter filterWithInterval = new AndDimFilter( diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/rule/DruidJoinRuleTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/rule/DruidJoinRuleTest.java index 7b9ed21f89e9..c4312b0ae25c 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/rule/DruidJoinRuleTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/rule/DruidJoinRuleTest.java @@ -30,7 +30,6 @@ import org.apache.calcite.sql.fun.SqlStdOperatorTable; import org.apache.calcite.sql.type.SqlTypeFactoryImpl; import org.apache.calcite.sql.type.SqlTypeName; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.query.JoinAlgorithm; import org.apache.druid.query.QueryContext; import org.apache.druid.sql.calcite.planner.DruidTypeSystem; @@ -70,7 +69,6 @@ public class DruidJoinRuleTest @Before public void setup() { - NullHandling.initializeForTests(); PlannerContext plannerContext = Mockito.mock(PlannerContext.class); Mockito.when(plannerContext.queryContext()).thenReturn(QueryContext.empty()); Mockito.when(plannerContext.getJoinAlgorithm()).thenReturn(JoinAlgorithm.BROADCAST); @@ -122,8 +120,7 @@ public void test_canHandleCondition_leftFnEqRight() @Test public void test_canHandleCondition_leftEqRightFn() { - Assert.assertEquals( - NullHandling.sqlCompatible(), // We don't handle non-equi join conditions for non-sql compatible mode. + Assert.assertTrue( druidJoinRule.canHandleCondition( rexBuilder.makeCall( SqlStdOperatorTable.EQUALS, @@ -147,8 +144,7 @@ public void test_canHandleCondition_leftEqRightFn() public void test_canHandleCondition_leftEqLeft() { - Assert.assertEquals( - NullHandling.sqlCompatible(), // We don't handle non-equi join conditions for non-sql compatible mode. + Assert.assertTrue( druidJoinRule.canHandleCondition( rexBuilder.makeCall( SqlStdOperatorTable.EQUALS, @@ -167,8 +163,7 @@ public void test_canHandleCondition_leftEqLeft() @Test public void test_canHandleCondition_rightEqRight() { - Assert.assertEquals( - NullHandling.sqlCompatible(), // We don't handle non-equi join conditions for non-sql compatible mode. + Assert.assertTrue( druidJoinRule.canHandleCondition( rexBuilder.makeCall( SqlStdOperatorTable.EQUALS, diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/rule/DruidLogicalValuesRuleTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/rule/DruidLogicalValuesRuleTest.java index f84c8455861f..6771cb4e2a3b 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/rule/DruidLogicalValuesRuleTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/rule/DruidLogicalValuesRuleTest.java @@ -28,7 +28,6 @@ import org.apache.calcite.util.DateString; import org.apache.calcite.util.TimeString; import org.apache.calcite.util.TimestampString; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidExceptionMatcher; import org.apache.druid.java.util.common.DateTimes; import org.apache.druid.sql.calcite.planner.DruidTypeSystem; @@ -143,14 +142,8 @@ public void testGetValueFromNullBooleanLiteral() { RexLiteral literal = REX_BUILDER.makeLiteral(null, REX_BUILDER.getTypeFactory().createSqlType(SqlTypeName.BOOLEAN)); - if (NullHandling.sqlCompatible()) { - final Object fromLiteral = DruidLogicalValuesRule.getValueFromLiteral(literal, DEFAULT_CONTEXT); - Assert.assertNull(fromLiteral); - } else { - final Object fromLiteralNonStrict = DruidLogicalValuesRule.getValueFromLiteral(literal, DEFAULT_CONTEXT); - Assert.assertSame(Long.class, fromLiteralNonStrict.getClass()); - Assert.assertEquals(0L, fromLiteralNonStrict); - } + final Object fromLiteral = DruidLogicalValuesRule.getValueFromLiteral(literal, DEFAULT_CONTEXT); + Assert.assertNull(fromLiteral); } @Test diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/rule/FilterDecomposeConcatRuleTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/rule/FilterDecomposeConcatRuleTest.java index 2bdd5ed81253..bbce9836607d 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/rule/FilterDecomposeConcatRuleTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/rule/FilterDecomposeConcatRuleTest.java @@ -27,7 +27,6 @@ import org.apache.calcite.rex.RexUtil; import org.apache.calcite.sql.fun.SqlStdOperatorTable; import org.apache.calcite.sql.type.SqlTypeName; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.sql.calcite.expression.builtin.ConcatOperatorConversion; import org.apache.druid.sql.calcite.planner.DruidTypeSystem; import org.apache.druid.testing.InitializedNullHandlingTest; @@ -181,9 +180,7 @@ public void test_twoInputs_isNull() isNull(concat(inputRef(0), literal("x"), inputRef(1))); Assert.assertEquals( - NullHandling.sqlCompatible() - ? or(isNull(inputRef(0)), isNull(inputRef(1))) - : rexBuilder.makeLiteral(false), + or(isNull(inputRef(0)), isNull(inputRef(1))), shuttle.apply(call) ); } @@ -197,9 +194,7 @@ public void test_twoInputs_isNotNull() Assert.assertEquals( rexBuilder.makeCall( SqlStdOperatorTable.NOT, - NullHandling.sqlCompatible() - ? or(isNull(inputRef(0)), isNull(inputRef(1))) - : rexBuilder.makeLiteral(false) + or(isNull(inputRef(0)), isNull(inputRef(1))) ), shuttle.apply(call) ); @@ -228,12 +223,10 @@ public void test_twoInputs_notEnoughXes() final RexLiteral unknown = rexBuilder.makeNullLiteral(typeFactory.createSqlType(SqlTypeName.BOOLEAN)); Assert.assertEquals( - NullHandling.sqlCompatible() - ? or( + or( and(isNull(inputRef(0)), unknown), and(isNull(inputRef(1)), unknown) - ) - : rexBuilder.makeLiteral(false), + ), shuttle.apply(call) ); } @@ -249,12 +242,10 @@ public void test_twoInputs_delimitersWrongOrder() final RexLiteral unknown = rexBuilder.makeNullLiteral(typeFactory.createSqlType(SqlTypeName.BOOLEAN)); Assert.assertEquals( - NullHandling.sqlCompatible() - ? or( + or( and(isNull(inputRef(0)), unknown), and(isNull(inputRef(1)), unknown) - ) - : rexBuilder.makeLiteral(false), + ), shuttle.apply(call) ); } @@ -294,12 +285,10 @@ public void test_twoInputs_impossibleOverlappingDelimiters() final RexLiteral unknown = rexBuilder.makeNullLiteral(typeFactory.createSqlType(SqlTypeName.BOOLEAN)); Assert.assertEquals( - NullHandling.sqlCompatible() - ? or( + or( and(isNull(inputRef(0)), unknown), and(isNull(inputRef(1)), unknown) - ) - : rexBuilder.makeLiteral(false), + ), shuttle.apply(call) ); } diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/rule/FilterJoinExcludePushToChildRuleTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/rule/FilterJoinExcludePushToChildRuleTest.java index 7daf5c16add8..48843fc27608 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/rule/FilterJoinExcludePushToChildRuleTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/rule/FilterJoinExcludePushToChildRuleTest.java @@ -56,7 +56,7 @@ public void testRemoveRedundantIsNotNullFiltersWithSQLCompatibility() List joinFilters = new ArrayList<>(); joinFilters.add(equalityFilter); - FilterJoinExcludePushToChildRule.removeRedundantIsNotNullFilters(joinFilters, JoinRelType.INNER, true); + FilterJoinExcludePushToChildRule.removeRedundantIsNotNullFilters(joinFilters, JoinRelType.INNER); Assert.assertEquals(joinFilters.size(), 1); Assert.assertEquals("Equality Filter changed", joinFilters.get(0), equalityFilter); @@ -64,7 +64,7 @@ public void testRemoveRedundantIsNotNullFiltersWithSQLCompatibility() joinFilters.add(isNotNullFilterOnNonJoinColumn); joinFilters.add(isNotNullFilterOnJoinColumn); Assert.assertEquals(joinFilters.size(), 3); - FilterJoinExcludePushToChildRule.removeRedundantIsNotNullFilters(joinFilters, JoinRelType.INNER, true); + FilterJoinExcludePushToChildRule.removeRedundantIsNotNullFilters(joinFilters, JoinRelType.INNER); Assert.assertEquals(joinFilters.size(), 2); Assert.assertEquals("Equality Filter changed", joinFilters.get(0), equalityFilter); Assert.assertEquals("IS NOT NULL filter on non-join column changed", joinFilters.get(1), isNotNullFilterOnNonJoinColumn); diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/run/SqlResultsTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/run/SqlResultsTest.java index f6e390f1d180..027e9022124e 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/run/SqlResultsTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/run/SqlResultsTest.java @@ -24,7 +24,6 @@ import com.google.common.collect.ImmutableSortedSet; import nl.jqno.equalsverifier.EqualsVerifier; import org.apache.calcite.sql.type.SqlTypeName; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.segment.TestHelper; @@ -205,7 +204,7 @@ public void testCoerceDouble() @Test public void testCoerceString() { - assertCoerce(NullHandling.defaultStringValue(), null, SqlTypeName.VARCHAR); + assertCoerce(null, null, SqlTypeName.VARCHAR); assertCoerce("1", 1, SqlTypeName.VARCHAR); assertCoerce("true", true, SqlTypeName.VARCHAR); assertCoerce("abc", "abc", SqlTypeName.VARCHAR); diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/schema/SystemSchemaTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/schema/SystemSchemaTest.java index de5ffbb5f19f..7a42b60f4611 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/schema/SystemSchemaTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/schema/SystemSchemaTest.java @@ -44,7 +44,6 @@ import org.apache.druid.client.InternalQueryConfig; import org.apache.druid.client.TimelineServerView; import org.apache.druid.client.coordinator.NoopCoordinatorClient; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.data.input.InputRow; import org.apache.druid.discovery.DataNodeService; import org.apache.druid.discovery.DiscoveryDruidNode; @@ -915,7 +914,7 @@ public void testServersTable() throws URISyntaxException rows.sort((Object[] row1, Object[] row2) -> ((Comparable) row1[0]).compareTo(row2[0])); final List expectedRows = new ArrayList<>(); - final Long nonLeader = NullHandling.defaultLongValue(); + final Long nonLeader = null; final String startTimeStr = startTime.toString(); expectedRows.add( createExpectedRow( diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/util/CalciteTestBase.java b/sql/src/test/java/org/apache/druid/sql/calcite/util/CalciteTestBase.java index 6b2e3efc718f..b50a0273a073 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/util/CalciteTestBase.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/util/CalciteTestBase.java @@ -20,7 +20,6 @@ package org.apache.druid.sql.calcite.util; import com.google.common.collect.ImmutableList; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.FileUtils; import org.apache.druid.math.expr.ExpressionProcessing; import org.apache.druid.segment.column.ColumnType; @@ -50,7 +49,6 @@ public abstract class CalciteTestBase @BeforeAll public static void setupCalciteProperties() { - NullHandling.initializeForTests(); ExpressionProcessing.initializeForTests(); } diff --git a/sql/src/test/java/org/apache/druid/sql/http/SqlResourceTest.java b/sql/src/test/java/org/apache/druid/sql/http/SqlResourceTest.java index 128c012adb0e..b44d0dfea584 100644 --- a/sql/src/test/java/org/apache/druid/sql/http/SqlResourceTest.java +++ b/sql/src/test/java/org/apache/druid/sql/http/SqlResourceTest.java @@ -30,7 +30,6 @@ import com.google.common.util.concurrent.ListeningExecutorService; import com.google.common.util.concurrent.MoreExecutors; import org.apache.calcite.avatica.SqlType; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.exception.AllowedRegexErrorResponseTransformStrategy; import org.apache.druid.common.exception.ErrorResponseTransformStrategy; import org.apache.druid.common.guava.SettableSupplier; @@ -119,7 +118,6 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; import javax.ws.rs.core.StreamingOutput; - import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; @@ -555,11 +553,6 @@ public void testTimestampsInResponseWithNulls() throws Exception ).rhs; Assert.assertEquals( - NullHandling.replaceWithDefault() ? - ImmutableList.of( - ImmutableMap.of("t1", "2001-01-03T00:00:00.000Z", "t2", "-292275055-05-16T16:47:04.192Z") - // t2 represents Long.MIN converted to a timestamp - ) : ImmutableList.of( Maps.transformValues( ImmutableMap.of("t1", "2001-01-03T00:00:00.000Z", "t2", ""), @@ -609,12 +602,6 @@ public void testFieldAliasingGroupBy() throws Exception ).rhs; Assert.assertEquals( - NullHandling.replaceWithDefault() ? - ImmutableList.of( - ImmutableMap.of("x", "", "y", ""), - ImmutableMap.of("x", "a", "y", "a"), - ImmutableMap.of("x", "abc", "y", "abc") - ) : ImmutableList.of( // x and y both should be null instead of empty string Maps.transformValues(ImmutableMap.of("x", "", "y", ""), (val) -> null), @@ -630,7 +617,6 @@ public void testFieldAliasingGroupBy() throws Exception public void testArrayResultFormat() throws Exception { final String query = "SELECT *, CASE dim2 WHEN '' THEN dim2 END FROM foo LIMIT 2"; - final String nullStr = NullHandling.replaceWithDefault() ? "" : null; Assert.assertEquals( ImmutableList.of( @@ -643,18 +629,18 @@ public void testArrayResultFormat() throws Exception 1.0, 1.0, "\"AQAAAEAAAA==\"", - nullStr + null ), Arrays.asList( "2000-01-02T00:00:00.000Z", "10.1", - nullStr, + null, "[\"b\",\"c\"]", 1, 2.0, 2.0, "\"AQAAAQAAAAHNBA==\"", - nullStr + null ) ), doPost( @@ -741,11 +727,10 @@ public void testCsvResultFormatWithErrorAfterFirstRow() throws Exception public void testArrayResultFormatWithHeader() throws Exception { final String query = "SELECT *, CASE dim2 WHEN '' THEN dim2 END FROM foo LIMIT 2"; - final String nullStr = NullHandling.replaceWithDefault() ? "" : null; List[] expectedQueryResults = new List[]{ - Arrays.asList("2000-01-01T00:00:00.000Z", "", "a", "[\"a\",\"b\"]", 1, 1.0, 1.0, "\"AQAAAEAAAA==\"", nullStr), - Arrays.asList("2000-01-02T00:00:00.000Z", "10.1", nullStr, "[\"b\",\"c\"]", 1, 2.0, 2.0, "\"AQAAAQAAAAHNBA==\"", nullStr) + Arrays.asList("2000-01-01T00:00:00.000Z", "", "a", "[\"a\",\"b\"]", 1, 1.0, 1.0, "\"AQAAAEAAAA==\"", null), + Arrays.asList("2000-01-02T00:00:00.000Z", "10.1", null, "[\"b\",\"c\"]", 1, 2.0, 2.0, "\"AQAAAQAAAAHNBA==\"", null) }; MockHttpServletResponse response = postForAsyncResponse( @@ -865,7 +850,6 @@ public void testArrayLinesResultFormat() throws Exception ); Assert.assertNull(pair.lhs); final String response = pair.rhs; - final String nullStr = NullHandling.replaceWithDefault() ? "" : null; final List lines = Splitter.on('\n').splitToList(response); Assert.assertEquals(4, lines.size()); @@ -879,7 +863,7 @@ public void testArrayLinesResultFormat() throws Exception 1.0, 1.0, "\"AQAAAEAAAA==\"", - nullStr + null ), JSON_MAPPER.readValue(lines.get(0), List.class) ); @@ -887,13 +871,13 @@ public void testArrayLinesResultFormat() throws Exception Arrays.asList( "2000-01-02T00:00:00.000Z", "10.1", - nullStr, + null, "[\"b\",\"c\"]", 1, 2.0, 2.0, "\"AQAAAQAAAAHNBA==\"", - nullStr + null ), JSON_MAPPER.readValue(lines.get(1), List.class) ); @@ -910,7 +894,6 @@ public void testArrayLinesResultFormatWithHeader() throws Exception ); Assert.assertNull(pair.lhs); final String response = pair.rhs; - final String nullStr = NullHandling.replaceWithDefault() ? "" : null; final List lines = Splitter.on('\n').splitToList(response); Assert.assertEquals(7, lines.size()); @@ -927,7 +910,7 @@ public void testArrayLinesResultFormatWithHeader() throws Exception 1.0, 1.0, "\"AQAAAEAAAA==\"", - nullStr + null ), JSON_MAPPER.readValue(lines.get(3), List.class) ); @@ -935,13 +918,13 @@ public void testArrayLinesResultFormatWithHeader() throws Exception Arrays.asList( "2000-01-02T00:00:00.000Z", "10.1", - nullStr, + null, "[\"b\",\"c\"]", 1, 2.0, 2.0, "\"AQAAAQAAAAHNBA==\"", - nullStr + null ), JSON_MAPPER.readValue(lines.get(4), List.class) ); @@ -981,10 +964,9 @@ public void testArrayLinesResultFormatWithHeader_nullColumnType() throws Excepti public void testObjectResultFormat() throws Exception { final String query = "SELECT *, CASE dim2 WHEN '' THEN dim2 END FROM foo LIMIT 2"; - final String nullStr = NullHandling.replaceWithDefault() ? "" : null; final Function, Map> transformer = m -> Maps.transformEntries( m, - (k, v) -> "EXPR$8".equals(k) || ("dim2".equals(k) && v.toString().isEmpty()) ? nullStr : v + (k, v) -> "EXPR$8".equals(k) || ("dim2".equals(k) && v.toString().isEmpty()) ? null : v ); Assert.assertEquals( @@ -1032,11 +1014,10 @@ public void testObjectLinesResultFormat() throws Exception ); Assert.assertNull(pair.lhs); final String response = pair.rhs; - final String nullStr = NullHandling.replaceWithDefault() ? "" : null; final Function, Map> transformer = m -> { return Maps.transformEntries( m, - (k, v) -> "EXPR$8".equals(k) || ("dim2".equals(k) && v.toString().isEmpty()) ? nullStr : v + (k, v) -> "EXPR$8".equals(k) || ("dim2".equals(k) && v.toString().isEmpty()) ? null : v ); }; final List lines = Splitter.on('\n').splitToList(response); @@ -1088,10 +1069,9 @@ public void testObjectLinesResultFormatWithMinimalHeader() throws Exception doPostRaw(new SqlQuery(query, ResultFormat.OBJECTLINES, true, false, false, null, null)); Assert.assertNull(pair.lhs); final String response = pair.rhs; - final String nullStr = NullHandling.replaceWithDefault() ? "" : null; final Function, Map> transformer = m -> Maps.transformEntries( m, - (k, v) -> "EXPR$8".equals(k) || ("dim2".equals(k) && v.toString().isEmpty()) ? nullStr : v + (k, v) -> "EXPR$8".equals(k) || ("dim2".equals(k) && v.toString().isEmpty()) ? null : v ); final List lines = Splitter.on('\n').splitToList(response); @@ -1148,10 +1128,9 @@ public void testObjectLinesResultFormatWithFullHeader() throws Exception doPostRaw(new SqlQuery(query, ResultFormat.OBJECTLINES, true, true, true, null, null)); Assert.assertNull(pair.lhs); final String response = pair.rhs; - final String nullStr = NullHandling.replaceWithDefault() ? "" : null; final Function, Map> transformer = m -> Maps.transformEntries( m, - (k, v) -> "EXPR$8".equals(k) || ("dim2".equals(k) && v.toString().isEmpty()) ? nullStr : v + (k, v) -> "EXPR$8".equals(k) || ("dim2".equals(k) && v.toString().isEmpty()) ? null : v ); final List lines = Splitter.on('\n').splitToList(response); diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn.iq index b0b5281a5cc9..e3eb200495df 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn.iq @@ -1,4 +1,4 @@ -# testUnnestExtractionFn@NullHandling=sql case-crc:33ee4d88 +# testUnnestExtractionFn case-crc:33ee4d88 # quidem testcase reason: UNNEST_SUBSTRING_EMPTY !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=default.iq deleted file mode 100644 index b0328f4db531..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=default.iq +++ /dev/null @@ -1,81 +0,0 @@ -# testUnnestExtractionFn@NullHandling=default case-crc:33ee4d88 -# quidem testcase reason: UNNEST_SUBSTRING_EMPTY -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set sqlStringifyArrays false -!set outputformat mysql -!use druidtest:/// -SELECT substring(d3,1) FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3) WHERE substring(d3,1) <> 'b'; -+--------+ -| EXPR$0 | -+--------+ -| a | -| c | -| d | -+--------+ -(3 rows) - -!ok -LogicalProject(EXPR$0=[SUBSTRING($18, 1)]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[<>(SUBSTRING($0, 1), 'b')]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) - LogicalTableScan(table=[[druid, numfoo]]) - -!logicalPlan -DruidProject(EXPR$0=[SUBSTRING($18, 1)], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[<>(SUBSTRING($0, 1), 'b')]) - DruidProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "unnest", - "base" : { - "type" : "table", - "name" : "numfoo" - }, - "virtualColumn" : { - "type" : "expression", - "name" : "j0.unnest", - "expression" : "mv_to_array(\"dim3\")", - "outputType" : "ARRAY" - }, - "unnestFilter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "j0.unnest", - "value" : "b", - "extractionFn" : { - "type" : "substring", - "index" : 0, - "length" : null - } - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "substring(\"j0.unnest\", 0, -1)", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "v0" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters.iq index 19a176b8f82b..c1857232e026 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters.iq @@ -1,4 +1,4 @@ -# testUnnestWithFilters@NullHandling=sql case-crc:810b3e0d +# testUnnestWithFilters case-crc:810b3e0d # quidem testcase reason: UNNEST_EXTRA_SCAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=default.iq deleted file mode 100644 index 9356c032797c..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=default.iq +++ /dev/null @@ -1,92 +0,0 @@ -# testUnnestWithFilters@NullHandling=default case-crc:810b3e0d -# quidem testcase reason: UNNEST_EXTRA_SCAN -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set sqlStringifyArrays false -!set outputformat mysql -!use druidtest:/// -SELECT d3 FROM (select * from druid.numfoo where dim2='a'), UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3); -+----+ -| d3 | -+----+ -| a | -| b | -+----+ -(2 rows) - -!ok -LogicalProject(d3=[$18]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($3)]) - LogicalProject(__time=[$0], dim1=[$1], $f2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) - LogicalFilter(condition=[=($2, 'a')]) - LogicalTableScan(table=[[druid, numfoo]]) - -!logicalPlan -DruidProject(d3=[$18], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($3)]) - DruidProject(__time=[$0], dim1=[$1], $f2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) - DruidFilter(condition=[=($2, 'a')]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "unnest", - "base" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "numfoo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'a'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim2", - "value" : "a" - }, - "columns" : [ "__time", "dim1", "v0", "dim3", "dim4", "dim5", "dim6", "dbl1", "dbl2", "f1", "f2", "l1", "l2", "cnt", "m1", "m2", "unique_dim1" ], - "columnTypes" : [ "LONG", "STRING", "STRING", "STRING", "STRING", "STRING", "STRING", "DOUBLE", "DOUBLE", "FLOAT", "FLOAT", "LONG", "LONG", "LONG", "FLOAT", "DOUBLE", "COMPLEX" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "virtualColumn" : { - "type" : "expression", - "name" : "j0.unnest", - "expression" : "mv_to_array(\"dim3\")", - "outputType" : "ARRAY" - }, - "unnestFilter" : null - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "j0.unnest" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInnerLimit@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInnerLimit.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInnerLimit@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInnerLimit.iq index 8c9c334e27f7..38de74c1f33a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInnerLimit@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInnerLimit.iq @@ -1,4 +1,4 @@ -# testUnnestWithFiltersInnerLimit@NullHandling=sql case-crc:1f5acfc8 +# testUnnestWithFiltersInnerLimit case-crc:1f5acfc8 # quidem testcase reason: UNUSED_VIRTUALCOLUMN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInnerLimit@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInnerLimit@NullHandling=default.iq deleted file mode 100644 index cedfdd6fc78c..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInnerLimit@NullHandling=default.iq +++ /dev/null @@ -1,95 +0,0 @@ -# testUnnestWithFiltersInnerLimit@NullHandling=default case-crc:1f5acfc8 -# quidem testcase reason: UNUSED_VIRTUALCOLUMN -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set sqlStringifyArrays false -!set outputformat mysql -!use druidtest:/// -SELECT d3 FROM (select dim2,dim3 from druid.numfoo where dim2='a' LIMIT 2), UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3); -+----+ -| d3 | -+----+ -| a | -| b | -+----+ -(2 rows) - -!ok -LogicalProject(d3=[$3]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)]) - LogicalProject($f0=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], __time=[$0]) - LogicalSort(fetch=[2]) - LogicalFilter(condition=[=($2, 'a')]) - LogicalTableScan(table=[[druid, numfoo]]) - -!logicalPlan -DruidProject(d3=[$3], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)]) - DruidProject($f0=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], __time=[$0], druid=[logical]) - DruidSort(fetch=[2], druid=[logical]) - DruidFilter(condition=[=($2, 'a')]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "unnest", - "base" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "numfoo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'a'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "limit" : 2, - "filter" : { - "type" : "selector", - "dimension" : "dim2", - "value" : "a" - }, - "columns" : [ "v0", "dim3", "__time" ], - "columnTypes" : [ "STRING", "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "virtualColumn" : { - "type" : "expression", - "name" : "j0.unnest", - "expression" : "mv_to_array(\"dim3\")", - "outputType" : "ARRAY" - }, - "unnestFilter" : null - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "j0.unnest" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside.iq index a335a370acd8..a4e09dd578ed 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside.iq @@ -1,4 +1,4 @@ -# testUnnestWithFiltersInsideAndOutside@NullHandling=sql case-crc:10c26262 +# testUnnestWithFiltersInsideAndOutside case-crc:10c26262 # quidem testcase reason: UNNEST_EXTRA_SCAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=default.iq deleted file mode 100644 index 97b2692b1045..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=default.iq +++ /dev/null @@ -1,112 +0,0 @@ -# testUnnestWithFiltersInsideAndOutside@NullHandling=default case-crc:10c26262 -# quidem testcase reason: UNNEST_EXTRA_SCAN -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set sqlStringifyArrays false -!set outputformat mysql -!use druidtest:/// -SELECT d3 FROM - (select * from druid.numfoo where dim2='a') as t, - UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3) -WHERE t.dim1 <> 'foo' -AND unnested.d3 <> 'b'; -+----+ -| d3 | -+----+ -| a | -+----+ -(1 row) - -!ok -LogicalProject(d3=[$18]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[<>($0, 'b')]) - LogicalProject(__time=[$0], dim1=[$1], $f2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) - LogicalFilter(condition=[AND(=($2, 'a'), <>($1, 'foo'))]) - LogicalTableScan(table=[[druid, numfoo]]) - -!logicalPlan -DruidProject(d3=[$18], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[<>($0, 'b')]) - DruidProject(__time=[$0], dim1=[$1], $f2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) - DruidFilter(condition=[AND(=($2, 'a'), <>($1, 'foo'))]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "unnest", - "base" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "numfoo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'a'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "a" - }, { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "foo" - } - } ] - }, - "columns" : [ "__time", "dim1", "v0", "dim3", "dim4", "dim5", "dim6", "dbl1", "dbl2", "f1", "f2", "l1", "l2", "cnt", "m1", "m2", "unique_dim1" ], - "columnTypes" : [ "LONG", "STRING", "STRING", "STRING", "STRING", "STRING", "STRING", "DOUBLE", "DOUBLE", "FLOAT", "FLOAT", "LONG", "LONG", "LONG", "FLOAT", "DOUBLE", "COMPLEX" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "virtualColumn" : { - "type" : "expression", - "name" : "j0.unnest", - "expression" : "mv_to_array(\"dim3\")", - "outputType" : "ARRAY" - }, - "unnestFilter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "j0.unnest", - "value" : "b" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "j0.unnest" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery.iq index dd3771f4b3b8..5d4d7c085bf9 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery.iq @@ -1,4 +1,4 @@ -# testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=sql case-crc:fa9be8db +# testUnnestWithFiltersWithExpressionInInnerQuery case-crc:fa9be8db # quidem testcase reason: UNNEST_EXTRA_SCAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=default.iq deleted file mode 100644 index 05790207aa95..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=default.iq +++ /dev/null @@ -1,92 +0,0 @@ -# testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=default case-crc:fa9be8db -# quidem testcase reason: UNNEST_EXTRA_SCAN -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set sqlStringifyArrays false -!set outputformat mysql -!use druidtest:/// -SELECT t,d3 FROM (select FLOOR(__time to hour) t, dim3 from druid.numfoo where dim2='a'), UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3); -+-------------------------+----+ -| t | d3 | -+-------------------------+----+ -| 2000-01-01 00:00:00.000 | a | -| 2000-01-01 00:00:00.000 | b | -+-------------------------+----+ -(2 rows) - -!ok -LogicalProject(t=[$0], d3=[$3]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)]) - LogicalProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3], __time=[$0]) - LogicalFilter(condition=[=($2, 'a')]) - LogicalTableScan(table=[[druid, numfoo]]) - -!logicalPlan -DruidProject(t=[$0], d3=[$3], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)]) - DruidProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($2, 'a')]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "unnest", - "base" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "numfoo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "timestamp_floor(\"__time\",'PT1H',null,'UTC')", - "outputType" : "LONG" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim2", - "value" : "a" - }, - "columns" : [ "v0", "dim3", "__time" ], - "columnTypes" : [ "LONG", "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "virtualColumn" : { - "type" : "expression", - "name" : "j0.unnest", - "expression" : "mv_to_array(\"dim3\")", - "outputType" : "ARRAY" - }, - "unnestFilter" : null - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "v0", "j0.unnest" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery.iq index 494dc9dc9d29..4041b8f8d179 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery.iq @@ -1,4 +1,4 @@ -# testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=sql case-crc:49354254 +# testUnnestWithInFiltersWithExpressionInInnerQuery case-crc:49354254 # quidem testcase reason: UNNEST_EXTRA_SCAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=default.iq deleted file mode 100644 index 9b9802c0645b..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=default.iq +++ /dev/null @@ -1,92 +0,0 @@ -# testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=default case-crc:49354254 -# quidem testcase reason: UNNEST_EXTRA_SCAN -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set sqlStringifyArrays false -!set outputformat mysql -!use druidtest:/// -SELECT t,d3 FROM (select FLOOR(__time to hour) t, dim3 from druid.numfoo where dim2 IN ('a','b')), UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3); -+-------------------------+----+ -| t | d3 | -+-------------------------+----+ -| 2000-01-01 00:00:00.000 | a | -| 2000-01-01 00:00:00.000 | b | -+-------------------------+----+ -(2 rows) - -!ok -LogicalProject(t=[$0], d3=[$3]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)]) - LogicalProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3], __time=[$0]) - LogicalFilter(condition=[SEARCH($2, Sarg['a':VARCHAR, 'b':VARCHAR]:VARCHAR)]) - LogicalTableScan(table=[[druid, numfoo]]) - -!logicalPlan -DruidProject(t=[$0], d3=[$3], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)]) - DruidProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3], __time=[$0], druid=[logical]) - DruidFilter(condition=[SEARCH($2, Sarg['a':VARCHAR, 'b':VARCHAR]:VARCHAR)]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "unnest", - "base" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "numfoo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "timestamp_floor(\"__time\",'PT1H',null,'UTC')", - "outputType" : "LONG" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim2", - "values" : [ "a", "b" ] - }, - "columns" : [ "v0", "dim3", "__time" ], - "columnTypes" : [ "LONG", "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "virtualColumn" : { - "type" : "expression", - "name" : "j0.unnest", - "expression" : "mv_to_array(\"dim3\")", - "outputType" : "ARRAY" - }, - "unnestFilter" : null - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "v0", "j0.unnest" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns.iq similarity index 95% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns.iq index 0a2bec94e338..8ef602b730df 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns.iq @@ -1,4 +1,4 @@ -# testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=sql case-crc:02630011 +# testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns case-crc:02630011 # quidem testcase reason: UNNEST_DIFFERENT_RESULTSET !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=default.iq deleted file mode 100644 index 616ce8399831..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=default.iq +++ /dev/null @@ -1,75 +0,0 @@ -# testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=default case-crc:02630011 -# quidem testcase reason: UNNEST_DIFFERENT_RESULTSET -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set sqlStringifyArrays false -!set outputformat mysql -!use druidtest:/// -SELECT d3 FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3) where strlen(d3) < 2 or d3='d' ; -+----+ -| d3 | -+----+ -| a | -| b | -| b | -| c | -| d | -+----+ -(5 rows) - -!ok -LogicalProject(d3=[$18]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[OR(<(STRLEN($0), 2), =($0, 'd'))]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) - LogicalTableScan(table=[[druid, numfoo]]) - -!logicalPlan -DruidProject(d3=[$18], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[OR(<(STRLEN($0), 2), =($0, 'd'))]) - DruidProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "unnest", - "base" : { - "type" : "table", - "name" : "numfoo" - }, - "virtualColumn" : { - "type" : "expression", - "name" : "j0.unnest", - "expression" : "mv_to_array(\"dim3\")", - "outputType" : "ARRAY" - }, - "unnestFilter" : { - "type" : "or", - "fields" : [ { - "type" : "expression", - "expression" : "(strlen(\"j0.unnest\") < 2)" - }, { - "type" : "selector", - "dimension" : "j0.unnest", - "value" : "d" - } ] - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "j0.unnest" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn.iq similarity index 96% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn.iq index 7b7bf5eecff0..39cc589ce621 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn.iq @@ -1,4 +1,4 @@ -# testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=sql case-crc:5fc83255 +# testUnnestWithNotFiltersOnUnnestedColumn case-crc:5fc83255 # quidem testcase reason: UNNEST_DIFFERENT_RESULTSET !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=default.iq deleted file mode 100644 index 0b63ec6fcb99..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=default.iq +++ /dev/null @@ -1,71 +0,0 @@ -# testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=default case-crc:5fc83255 -# quidem testcase reason: UNNEST_DIFFERENT_RESULTSET -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set sqlStringifyArrays false -!set outputformat mysql -!use druidtest:/// -SELECT d3 FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3) where d3!='d' ; -+----+ -| d3 | -+----+ -| a | -| b | -| b | -| c | -+----+ -(4 rows) - -!ok -LogicalProject(d3=[$18]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[<>($0, 'd')]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) - LogicalTableScan(table=[[druid, numfoo]]) - -!logicalPlan -DruidProject(d3=[$18], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[<>($0, 'd')]) - DruidProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "unnest", - "base" : { - "type" : "table", - "name" : "numfoo" - }, - "virtualColumn" : { - "type" : "expression", - "name" : "j0.unnest", - "expression" : "mv_to_array(\"dim3\")", - "outputType" : "ARRAY" - }, - "unnestFilter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "j0.unnest", - "value" : "d" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "j0.unnest" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit.iq index 89919ef819ae..d21e14cf9cdd 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit.iq @@ -1,4 +1,4 @@ -# testExactTopNOnInnerJoinWithLimit@NullHandling=sql case-crc:1b8b1878 +# testExactTopNOnInnerJoinWithLimit case-crc:1b8b1878 # quidem testcase reason: EQUIV_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=default.iq deleted file mode 100644 index d2f2548b675a..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=default.iq +++ /dev/null @@ -1,115 +0,0 @@ -# testExactTopNOnInnerJoinWithLimit@NullHandling=default case-crc:1b8b1878 -# quidem testcase reason: EQUIV_PLAN -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set useApproximateTopN false -!set outputformat mysql -!use druidtest:///?minTopNThreshold=1 -select f1."dim4", sum("m1") from numfoo f1 inner join ( - select "dim4" from numfoo where dim4 <> 'a' group by 1 -) f2 on f1."dim4" = f2."dim4" group by 1 limit 1; -+------+--------+ -| dim4 | EXPR$1 | -+------+--------+ -| b | 15.0 | -+------+--------+ -(1 row) - -!ok -LogicalSort(fetch=[1]) - LogicalAggregate(group=[{0}], EXPR$1=[SUM($1)]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(dim4=[$4], m1=[$14]) - LogicalTableScan(table=[[druid, numfoo]]) - LogicalAggregate(group=[{4}]) - LogicalFilter(condition=[<>($4, 'a')]) - LogicalTableScan(table=[[druid, numfoo]]) - -!logicalPlan -DruidSort(fetch=[1], druid=[logical]) - DruidAggregate(group=[{0}], EXPR$1=[SUM($1)], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(dim4=[$4], m1=[$14], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - DruidAggregate(group=[{4}], druid=[logical]) - DruidFilter(condition=[<>($4, 'a')]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "topN", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "numfoo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "numfoo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim4", - "value" : "a" - } - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim4", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim4\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "dimension" : { - "type" : "default", - "dimension" : "dim4", - "outputName" : "d0", - "outputType" : "STRING" - }, - "metric" : { - "type" : "dimension", - "ordering" : { - "type" : "lexicographic" - } - }, - "threshold" : 1, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "aggregations" : [ { - "type" : "doubleSum", - "name" : "a0", - "fieldName" : "m1" - } ] -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@all_disabled.iq similarity index 96% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@all_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@all_disabled.iq index 48f7793b1e8b..dac7ccb76343 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@all_disabled.iq @@ -1,4 +1,4 @@ -# testFilterAndGroupByLookupUsingJoinOperator@all_disabled@NullHandling=sql case-crc:6ad9dbcf +# testFilterAndGroupByLookupUsingJoinOperator@all_disabled case-crc:6ad9dbcf # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@all_disabled@NullHandling=default.iq deleted file mode 100644 index f74626ec64e7..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,101 +0,0 @@ -# testFilterAndGroupByLookupUsingJoinOperator@all_disabled@NullHandling=default case-crc:6ad9dbcf -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.k, COUNT(*) -FROM foo LEFT JOIN lookup.lookyloo ON foo.dim2 = lookyloo.k -WHERE lookyloo.v = 'xa' -GROUP BY lookyloo.k; -+---+--------+ -| k | EXPR$1 | -+---+--------+ -| a | 2 | -+---+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.k", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@all_enabled.iq similarity index 96% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@all_enabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@all_enabled.iq index 72386cc966d6..5be34d606ad4 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@all_enabled.iq @@ -1,4 +1,4 @@ -# testFilterAndGroupByLookupUsingJoinOperator@all_enabled@NullHandling=sql case-crc:b2f0e3d2 +# testFilterAndGroupByLookupUsingJoinOperator@all_enabled case-crc:b2f0e3d2 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@all_enabled@NullHandling=default.iq deleted file mode 100644 index 7d763dd4b63b..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,101 +0,0 @@ -# testFilterAndGroupByLookupUsingJoinOperator@all_enabled@NullHandling=default case-crc:b2f0e3d2 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.k, COUNT(*) -FROM foo LEFT JOIN lookup.lookyloo ON foo.dim2 = lookyloo.k -WHERE lookyloo.v = 'xa' -GROUP BY lookyloo.k; -+---+--------+ -| k | EXPR$1 | -+---+--------+ -| a | 2 | -+---+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.k", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@default.iq similarity index 96% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@default@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@default.iq index e7882c737f62..78a50ed9b0c9 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@default.iq @@ -1,4 +1,4 @@ -# testFilterAndGroupByLookupUsingJoinOperator@default@NullHandling=sql case-crc:ab2fdc58 +# testFilterAndGroupByLookupUsingJoinOperator@default case-crc:ab2fdc58 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@default@NullHandling=default.iq deleted file mode 100644 index 2f1458b4d94d..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@default@NullHandling=default.iq +++ /dev/null @@ -1,98 +0,0 @@ -# testFilterAndGroupByLookupUsingJoinOperator@default@NullHandling=default case-crc:ab2fdc58 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.k, COUNT(*) -FROM foo LEFT JOIN lookup.lookyloo ON foo.dim2 = lookyloo.k -WHERE lookyloo.v = 'xa' -GROUP BY lookyloo.k; -+---+--------+ -| k | EXPR$1 | -+---+--------+ -| a | 2 | -+---+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.k", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@filter-on-value-column_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@filter-on-value-column_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@filter-on-value-column_disabled.iq index 9e87aa3f991f..ee7414501048 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@filter-on-value-column_disabled.iq @@ -1,4 +1,4 @@ -# testFilterAndGroupByLookupUsingJoinOperator@filter-on-value-column_disabled@NullHandling=sql case-crc:f363558d +# testFilterAndGroupByLookupUsingJoinOperator@filter-on-value-column_disabled case-crc:f363558d # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index d51f3f4c2397..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,101 +0,0 @@ -# testFilterAndGroupByLookupUsingJoinOperator@filter-on-value-column_disabled@NullHandling=default case-crc:f363558d -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.k, COUNT(*) -FROM foo LEFT JOIN lookup.lookyloo ON foo.dim2 = lookyloo.k -WHERE lookyloo.v = 'xa' -GROUP BY lookyloo.k; -+---+--------+ -| k | EXPR$1 | -+---+--------+ -| a | 2 | -+---+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.k", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@filter-rewrites-disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@filter-rewrites-disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@filter-rewrites-disabled.iq index 86587e2d85f8..c5a8d5c7dc5f 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@filter-rewrites-disabled.iq @@ -1,4 +1,4 @@ -# testFilterAndGroupByLookupUsingJoinOperator@filter-rewrites-disabled@NullHandling=sql case-crc:4e59d27f +# testFilterAndGroupByLookupUsingJoinOperator@filter-rewrites-disabled case-crc:4e59d27f # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index f486a02f0409..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,101 +0,0 @@ -# testFilterAndGroupByLookupUsingJoinOperator@filter-rewrites-disabled@NullHandling=default case-crc:4e59d27f -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.k, COUNT(*) -FROM foo LEFT JOIN lookup.lookyloo ON foo.dim2 = lookyloo.k -WHERE lookyloo.v = 'xa' -GROUP BY lookyloo.k; -+---+--------+ -| k | EXPR$1 | -+---+--------+ -| a | 2 | -+---+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.k", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@filter-rewrites.iq similarity index 96% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@filter-rewrites@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@filter-rewrites.iq index 0e1160d4d54c..0d6b5c926485 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@filter-rewrites.iq @@ -1,4 +1,4 @@ -# testFilterAndGroupByLookupUsingJoinOperator@filter-rewrites@NullHandling=sql case-crc:33065cd9 +# testFilterAndGroupByLookupUsingJoinOperator@filter-rewrites case-crc:33065cd9 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index 03b779317541..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,101 +0,0 @@ -# testFilterAndGroupByLookupUsingJoinOperator@filter-rewrites@NullHandling=default case-crc:33065cd9 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.k, COUNT(*) -FROM foo LEFT JOIN lookup.lookyloo ON foo.dim2 = lookyloo.k -WHERE lookyloo.v = 'xa' -GROUP BY lookyloo.k; -+---+--------+ -| k | EXPR$1 | -+---+--------+ -| a | 2 | -+---+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.k", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@join-to-filter.iq similarity index 96% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@join-to-filter@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@join-to-filter.iq index 410d0a5707ec..6b5572959f61 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@join-to-filter.iq @@ -1,4 +1,4 @@ -# testFilterAndGroupByLookupUsingJoinOperator@join-to-filter@NullHandling=sql case-crc:6decf339 +# testFilterAndGroupByLookupUsingJoinOperator@join-to-filter case-crc:6decf339 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@join-to-filter@NullHandling=default.iq deleted file mode 100644 index 9716b7ab6d29..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperator@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,101 +0,0 @@ -# testFilterAndGroupByLookupUsingJoinOperator@join-to-filter@NullHandling=default case-crc:6decf339 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.k, COUNT(*) -FROM foo LEFT JOIN lookup.lookyloo ON foo.dim2 = lookyloo.k -WHERE lookyloo.v = 'xa' -GROUP BY lookyloo.k; -+---+--------+ -| k | EXPR$1 | -+---+--------+ -| a | 2 | -+---+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.k", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@all_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@all_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@all_disabled.iq index 0a766c31034c..18976eca4af7 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@all_disabled.iq @@ -1,4 +1,4 @@ -# testFilterAndGroupByLookupUsingJoinOperatorBackwards@all_disabled@NullHandling=sql case-crc:969035d8 +# testFilterAndGroupByLookupUsingJoinOperatorBackwards@all_disabled case-crc:969035d8 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@all_disabled@NullHandling=default.iq deleted file mode 100644 index 62f7d1a5be6a..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,121 +0,0 @@ -# testFilterAndGroupByLookupUsingJoinOperatorBackwards@all_disabled@NullHandling=default case-crc:969035d8 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.v, COUNT(*) -FROM lookup.lookyloo RIGHT JOIN foo ON foo.dim2 = lookyloo.k -WHERE lookyloo.v <> 'xa' -GROUP BY lookyloo.v; -+------+--------+ -| v | EXPR$1 | -+------+--------+ -| xabc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalFilter(condition=[<>($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[<>($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - } - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim2" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"k\" == \"j0.dim2\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@all_enabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@all_enabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@all_enabled.iq index 157ffa39e6ec..246601b4cace 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@all_enabled.iq @@ -1,4 +1,4 @@ -# testFilterAndGroupByLookupUsingJoinOperatorBackwards@all_enabled@NullHandling=sql case-crc:d55a66d3 +# testFilterAndGroupByLookupUsingJoinOperatorBackwards@all_enabled case-crc:d55a66d3 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@all_enabled@NullHandling=default.iq deleted file mode 100644 index f7695328f309..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,121 +0,0 @@ -# testFilterAndGroupByLookupUsingJoinOperatorBackwards@all_enabled@NullHandling=default case-crc:d55a66d3 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.v, COUNT(*) -FROM lookup.lookyloo RIGHT JOIN foo ON foo.dim2 = lookyloo.k -WHERE lookyloo.v <> 'xa' -GROUP BY lookyloo.v; -+------+--------+ -| v | EXPR$1 | -+------+--------+ -| xabc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalFilter(condition=[<>($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[<>($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - } - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim2" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"k\" == \"j0.dim2\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@default.iq similarity index 96% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@default@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@default.iq index 15e03e9e9679..7794865eb7b3 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@default.iq @@ -1,4 +1,4 @@ -# testFilterAndGroupByLookupUsingJoinOperatorBackwards@default@NullHandling=sql case-crc:b7b60a5e +# testFilterAndGroupByLookupUsingJoinOperatorBackwards@default case-crc:b7b60a5e # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@default@NullHandling=default.iq deleted file mode 100644 index 2dbf990aeaed..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@default@NullHandling=default.iq +++ /dev/null @@ -1,118 +0,0 @@ -# testFilterAndGroupByLookupUsingJoinOperatorBackwards@default@NullHandling=default case-crc:b7b60a5e -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.v, COUNT(*) -FROM lookup.lookyloo RIGHT JOIN foo ON foo.dim2 = lookyloo.k -WHERE lookyloo.v <> 'xa' -GROUP BY lookyloo.v; -+------+--------+ -| v | EXPR$1 | -+------+--------+ -| xabc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalFilter(condition=[<>($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[<>($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - } - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim2" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"k\" == \"j0.dim2\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-on-value-column_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-on-value-column_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-on-value-column_disabled.iq index 76db2a82cc50..c67544a9e3bc 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-on-value-column_disabled.iq @@ -1,4 +1,4 @@ -# testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-on-value-column_disabled@NullHandling=sql case-crc:d9b90253 +# testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-on-value-column_disabled case-crc:d9b90253 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index c84f1a640cd5..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,121 +0,0 @@ -# testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-on-value-column_disabled@NullHandling=default case-crc:d9b90253 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.v, COUNT(*) -FROM lookup.lookyloo RIGHT JOIN foo ON foo.dim2 = lookyloo.k -WHERE lookyloo.v <> 'xa' -GROUP BY lookyloo.v; -+------+--------+ -| v | EXPR$1 | -+------+--------+ -| xabc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalFilter(condition=[<>($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[<>($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - } - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim2" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"k\" == \"j0.dim2\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-rewrites-disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-rewrites-disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-rewrites-disabled.iq index 6e73fa0cbef4..ce1b4e1779cd 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-rewrites-disabled.iq @@ -1,4 +1,4 @@ -# testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-rewrites-disabled@NullHandling=sql case-crc:194265c4 +# testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-rewrites-disabled case-crc:194265c4 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index d9c9900d9a36..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,121 +0,0 @@ -# testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-rewrites-disabled@NullHandling=default case-crc:194265c4 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.v, COUNT(*) -FROM lookup.lookyloo RIGHT JOIN foo ON foo.dim2 = lookyloo.k -WHERE lookyloo.v <> 'xa' -GROUP BY lookyloo.v; -+------+--------+ -| v | EXPR$1 | -+------+--------+ -| xabc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalFilter(condition=[<>($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[<>($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - } - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim2" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"k\" == \"j0.dim2\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-rewrites.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-rewrites@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-rewrites.iq index 761bf0192931..60a9dd6bee91 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-rewrites.iq @@ -1,4 +1,4 @@ -# testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-rewrites@NullHandling=sql case-crc:49af20a5 +# testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-rewrites case-crc:49af20a5 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index 1e53d7e699dc..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,121 +0,0 @@ -# testFilterAndGroupByLookupUsingJoinOperatorBackwards@filter-rewrites@NullHandling=default case-crc:49af20a5 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.v, COUNT(*) -FROM lookup.lookyloo RIGHT JOIN foo ON foo.dim2 = lookyloo.k -WHERE lookyloo.v <> 'xa' -GROUP BY lookyloo.v; -+------+--------+ -| v | EXPR$1 | -+------+--------+ -| xabc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalFilter(condition=[<>($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[<>($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - } - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim2" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"k\" == \"j0.dim2\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@join-to-filter.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@join-to-filter@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@join-to-filter.iq index c029a14c277a..d12ea592f1b2 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@join-to-filter.iq @@ -1,4 +1,4 @@ -# testFilterAndGroupByLookupUsingJoinOperatorBackwards@join-to-filter@NullHandling=sql case-crc:5a34c7c1 +# testFilterAndGroupByLookupUsingJoinOperatorBackwards@join-to-filter case-crc:5a34c7c1 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@join-to-filter@NullHandling=default.iq deleted file mode 100644 index 1e34768d3404..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorBackwards@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,121 +0,0 @@ -# testFilterAndGroupByLookupUsingJoinOperatorBackwards@join-to-filter@NullHandling=default case-crc:5a34c7c1 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.v, COUNT(*) -FROM lookup.lookyloo RIGHT JOIN foo ON foo.dim2 = lookyloo.k -WHERE lookyloo.v <> 'xa' -GROUP BY lookyloo.v; -+------+--------+ -| v | EXPR$1 | -+------+--------+ -| xabc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalFilter(condition=[<>($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[<>($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - } - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim2" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"k\" == \"j0.dim2\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@all_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@all_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@all_disabled.iq index 05005055e0c6..905b7dafbfbe 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@all_disabled.iq @@ -1,4 +1,4 @@ -# testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@all_disabled@NullHandling=sql case-crc:99a0fb62 +# testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@all_disabled case-crc:99a0fb62 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@all_disabled@NullHandling=default.iq deleted file mode 100644 index 1532fe93ef10..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,104 +0,0 @@ -# testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@all_disabled@NullHandling=default case-crc:99a0fb62 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.v, COUNT(*) -FROM foo LEFT JOIN lookup.lookyloo ON foo.dim2 = lookyloo.k -WHERE lookyloo.v <> 'xa' -GROUP BY lookyloo.v; -+------+--------+ -| v | EXPR$1 | -+------+--------+ -| xabc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{2}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[<>($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidAggregate(group=[{2}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[<>($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - } - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.v", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@all_enabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@all_enabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@all_enabled.iq index bd3115e360e3..1e56d21b3e16 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@all_enabled.iq @@ -1,4 +1,4 @@ -# testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@all_enabled@NullHandling=sql case-crc:56c2eeea +# testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@all_enabled case-crc:56c2eeea # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@all_enabled@NullHandling=default.iq deleted file mode 100644 index 8a6b05916ac0..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,104 +0,0 @@ -# testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@all_enabled@NullHandling=default case-crc:56c2eeea -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.v, COUNT(*) -FROM foo LEFT JOIN lookup.lookyloo ON foo.dim2 = lookyloo.k -WHERE lookyloo.v <> 'xa' -GROUP BY lookyloo.v; -+------+--------+ -| v | EXPR$1 | -+------+--------+ -| xabc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{2}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[<>($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidAggregate(group=[{2}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[<>($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - } - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.v", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@default.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@default@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@default.iq index 24a981c6d7f4..2410259fe249 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@default.iq @@ -1,4 +1,4 @@ -# testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@default@NullHandling=sql case-crc:49550f8e +# testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@default case-crc:49550f8e # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@default@NullHandling=default.iq deleted file mode 100644 index ccdba478dbe3..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@default@NullHandling=default.iq +++ /dev/null @@ -1,101 +0,0 @@ -# testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@default@NullHandling=default case-crc:49550f8e -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.v, COUNT(*) -FROM foo LEFT JOIN lookup.lookyloo ON foo.dim2 = lookyloo.k -WHERE lookyloo.v <> 'xa' -GROUP BY lookyloo.v; -+------+--------+ -| v | EXPR$1 | -+------+--------+ -| xabc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{2}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[<>($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidAggregate(group=[{2}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[<>($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - } - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.v", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-on-value-column_disabled.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-on-value-column_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-on-value-column_disabled.iq index 0db5b7d18765..e2cbe8f7d19f 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-on-value-column_disabled.iq @@ -1,4 +1,4 @@ -# testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-on-value-column_disabled@NullHandling=sql case-crc:c3056aeb +# testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-on-value-column_disabled case-crc:c3056aeb # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index e152ce672f32..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,104 +0,0 @@ -# testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-on-value-column_disabled@NullHandling=default case-crc:c3056aeb -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.v, COUNT(*) -FROM foo LEFT JOIN lookup.lookyloo ON foo.dim2 = lookyloo.k -WHERE lookyloo.v <> 'xa' -GROUP BY lookyloo.v; -+------+--------+ -| v | EXPR$1 | -+------+--------+ -| xabc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{2}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[<>($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidAggregate(group=[{2}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[<>($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - } - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.v", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-rewrites-disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-rewrites-disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-rewrites-disabled.iq index 7f2871723643..594d949d2863 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-rewrites-disabled.iq @@ -1,4 +1,4 @@ -# testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-rewrites-disabled@NullHandling=sql case-crc:c84d485e +# testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-rewrites-disabled case-crc:c84d485e # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index c97ba352aef9..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,104 +0,0 @@ -# testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-rewrites-disabled@NullHandling=default case-crc:c84d485e -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.v, COUNT(*) -FROM foo LEFT JOIN lookup.lookyloo ON foo.dim2 = lookyloo.k -WHERE lookyloo.v <> 'xa' -GROUP BY lookyloo.v; -+------+--------+ -| v | EXPR$1 | -+------+--------+ -| xabc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{2}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[<>($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidAggregate(group=[{2}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[<>($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - } - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.v", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-rewrites.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-rewrites@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-rewrites.iq index 7aa073faaf93..6711fe4326a6 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-rewrites.iq @@ -1,4 +1,4 @@ -# testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-rewrites@NullHandling=sql case-crc:16ce5a70 +# testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-rewrites case-crc:16ce5a70 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index b5cd6a9b7cff..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,104 +0,0 @@ -# testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@filter-rewrites@NullHandling=default case-crc:16ce5a70 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.v, COUNT(*) -FROM foo LEFT JOIN lookup.lookyloo ON foo.dim2 = lookyloo.k -WHERE lookyloo.v <> 'xa' -GROUP BY lookyloo.v; -+------+--------+ -| v | EXPR$1 | -+------+--------+ -| xabc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{2}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[<>($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidAggregate(group=[{2}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[<>($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - } - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.v", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@join-to-filter.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@join-to-filter@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@join-to-filter.iq index 59db4614b477..e315d7e6ac74 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@join-to-filter.iq @@ -1,4 +1,4 @@ -# testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@join-to-filter@NullHandling=sql case-crc:0f1d69fc +# testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@join-to-filter case-crc:0f1d69fc # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@join-to-filter@NullHandling=default.iq deleted file mode 100644 index 33b491c2f143..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,104 +0,0 @@ -# testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter@join-to-filter@NullHandling=default case-crc:0f1d69fc -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.v, COUNT(*) -FROM foo LEFT JOIN lookup.lookyloo ON foo.dim2 = lookyloo.k -WHERE lookyloo.v <> 'xa' -GROUP BY lookyloo.v; -+------+--------+ -| v | EXPR$1 | -+------+--------+ -| xabc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{2}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[<>($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidAggregate(group=[{2}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[<>($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - } - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.v", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@all_disabled.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@all_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@all_disabled.iq index 0fea9c0817ad..3463c7eb7459 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@all_disabled.iq @@ -1,4 +1,4 @@ -# testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@all_disabled@NullHandling=sql case-crc:b506c194 +# testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@all_disabled case-crc:b506c194 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@all_disabled@NullHandling=default.iq deleted file mode 100644 index 7e399655709c..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,100 +0,0 @@ -# testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@all_disabled@NullHandling=default case-crc:b506c194 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.k, COUNT(*) -FROM foo LEFT JOIN lookup.lookyloo ON foo.dim2 = lookyloo.k -WHERE lookyloo.v = '123' -GROUP BY lookyloo.k; -+---+--------+ -| k | EXPR$1 | -+---+--------+ -+---+--------+ -(0 rows) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, '123')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, '123')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "123" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.k", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@all_enabled.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@all_enabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@all_enabled.iq index 15ad5587a40d..e623b79503fa 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@all_enabled.iq @@ -1,4 +1,4 @@ -# testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@all_enabled@NullHandling=sql case-crc:7a64d41c +# testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@all_enabled case-crc:7a64d41c # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@all_enabled@NullHandling=default.iq deleted file mode 100644 index 2eb9e3dd3420..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,100 +0,0 @@ -# testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@all_enabled@NullHandling=default case-crc:7a64d41c -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.k, COUNT(*) -FROM foo LEFT JOIN lookup.lookyloo ON foo.dim2 = lookyloo.k -WHERE lookyloo.v = '123' -GROUP BY lookyloo.k; -+---+--------+ -| k | EXPR$1 | -+---+--------+ -+---+--------+ -(0 rows) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, '123')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, '123')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "123" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.k", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@default.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@default@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@default.iq index 49f864a5ec8e..13627f5270bb 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@default.iq @@ -1,4 +1,4 @@ -# testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@default@NullHandling=sql case-crc:65f33578 +# testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@default case-crc:65f33578 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@default@NullHandling=default.iq deleted file mode 100644 index 7acd6a610a19..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@default@NullHandling=default.iq +++ /dev/null @@ -1,97 +0,0 @@ -# testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@default@NullHandling=default case-crc:65f33578 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.k, COUNT(*) -FROM foo LEFT JOIN lookup.lookyloo ON foo.dim2 = lookyloo.k -WHERE lookyloo.v = '123' -GROUP BY lookyloo.k; -+---+--------+ -| k | EXPR$1 | -+---+--------+ -+---+--------+ -(0 rows) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, '123')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, '123')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "123" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.k", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-on-value-column_disabled.iq similarity index 96% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-on-value-column_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-on-value-column_disabled.iq index f054f1fcb101..38139c034f91 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-on-value-column_disabled.iq @@ -1,4 +1,4 @@ -# testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-on-value-column_disabled@NullHandling=sql case-crc:efa3501d +# testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-on-value-column_disabled case-crc:efa3501d # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index 97429f762d0c..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,100 +0,0 @@ -# testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-on-value-column_disabled@NullHandling=default case-crc:efa3501d -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.k, COUNT(*) -FROM foo LEFT JOIN lookup.lookyloo ON foo.dim2 = lookyloo.k -WHERE lookyloo.v = '123' -GROUP BY lookyloo.k; -+---+--------+ -| k | EXPR$1 | -+---+--------+ -+---+--------+ -(0 rows) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, '123')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, '123')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "123" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.k", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-rewrites-disabled.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-rewrites-disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-rewrites-disabled.iq index 93a5d135023f..a43a1a07e4d1 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-rewrites-disabled.iq @@ -1,4 +1,4 @@ -# testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-rewrites-disabled@NullHandling=sql case-crc:e4eb72a8 +# testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-rewrites-disabled case-crc:e4eb72a8 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index 4b75484d9217..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,100 +0,0 @@ -# testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-rewrites-disabled@NullHandling=default case-crc:e4eb72a8 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.k, COUNT(*) -FROM foo LEFT JOIN lookup.lookyloo ON foo.dim2 = lookyloo.k -WHERE lookyloo.v = '123' -GROUP BY lookyloo.k; -+---+--------+ -| k | EXPR$1 | -+---+--------+ -+---+--------+ -(0 rows) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, '123')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, '123')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "123" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.k", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-rewrites.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-rewrites@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-rewrites.iq index 2d63d026361e..cc8c35955b29 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-rewrites.iq @@ -1,4 +1,4 @@ -# testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-rewrites@NullHandling=sql case-crc:3a686086 +# testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-rewrites case-crc:3a686086 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index 820d83af355f..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,100 +0,0 @@ -# testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@filter-rewrites@NullHandling=default case-crc:3a686086 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.k, COUNT(*) -FROM foo LEFT JOIN lookup.lookyloo ON foo.dim2 = lookyloo.k -WHERE lookyloo.v = '123' -GROUP BY lookyloo.k; -+---+--------+ -| k | EXPR$1 | -+---+--------+ -+---+--------+ -(0 rows) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, '123')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, '123')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "123" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.k", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@join-to-filter.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@join-to-filter@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@join-to-filter.iq index f4a5ca3cd0f1..40e65ba06109 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@join-to-filter.iq @@ -1,4 +1,4 @@ -# testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@join-to-filter@NullHandling=sql case-crc:23bb530a +# testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@join-to-filter case-crc:23bb530a # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@join-to-filter@NullHandling=default.iq deleted file mode 100644 index 5bed173887fb..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,100 +0,0 @@ -# testFilterAndGroupByLookupUsingJoinOperatorWithValueFilterPushdownMatchesNothing@join-to-filter@NullHandling=default case-crc:23bb530a -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.k, COUNT(*) -FROM foo LEFT JOIN lookup.lookyloo ON foo.dim2 = lookyloo.k -WHERE lookyloo.v = '123' -GROUP BY lookyloo.k; -+---+--------+ -| k | EXPR$1 | -+---+--------+ -+---+--------+ -(0 rows) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, '123')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, '123')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "123" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.k", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled.iq index 52087ed62765..93a5df16724d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled.iq @@ -1,4 +1,4 @@ -# testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled@NullHandling=sql case-crc:9802d63b +# testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled case-crc:9802d63b # quidem testcase reason: EQUIV_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled@NullHandling=default.iq deleted file mode 100644 index 699b9c230520..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,163 +0,0 @@ -# testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled@NullHandling=default case-crc:9802d63b -# quidem testcase reason: EQUIV_PLAN -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT dim1 from (SELECT dim1,__time FROM (SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1) GROUP BY 1,2) GROUP BY dim1 -; -+------+ -| dim1 | -+------+ -| 10.1 | -+------+ -(1 row) - -!ok -LogicalAggregate(group=[{0}]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) - LogicalAggregate(group=[{1}]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "__time", - "outputName" : "d0", - "outputType" : "LONG" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "_d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled.iq index 33556cd485fa..76229ff6d16b 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled.iq @@ -1,4 +1,4 @@ -# testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled@NullHandling=sql case-crc:06fe6714 +# testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled case-crc:06fe6714 # quidem testcase reason: EQUIV_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled@NullHandling=default.iq deleted file mode 100644 index 559eadb36320..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,163 +0,0 @@ -# testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled@NullHandling=default case-crc:06fe6714 -# quidem testcase reason: EQUIV_PLAN -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT dim1 from (SELECT dim1,__time FROM (SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1) GROUP BY 1,2) GROUP BY dim1 -; -+------+ -| dim1 | -+------+ -| 10.1 | -+------+ -(1 row) - -!ok -LogicalAggregate(group=[{0}]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) - LogicalAggregate(group=[{1}]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "__time", - "outputName" : "d0", - "outputType" : "LONG" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "_d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default.iq index 09785d5c178c..1310538097df 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default.iq @@ -1,4 +1,4 @@ -# testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default@NullHandling=sql case-crc:2e780a44 +# testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default case-crc:2e780a44 # quidem testcase reason: EQUIV_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default@NullHandling=default.iq deleted file mode 100644 index b6c55a471df1..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default@NullHandling=default.iq +++ /dev/null @@ -1,160 +0,0 @@ -# testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default@NullHandling=default case-crc:2e780a44 -# quidem testcase reason: EQUIV_PLAN -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT dim1 from (SELECT dim1,__time FROM (SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1) GROUP BY 1,2) GROUP BY dim1 -; -+------+ -| dim1 | -+------+ -| 10.1 | -+------+ -(1 row) - -!ok -LogicalAggregate(group=[{0}]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) - LogicalAggregate(group=[{1}]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "__time", - "outputName" : "d0", - "outputType" : "LONG" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "_d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled.iq index 8ce84d69e397..24e718a6bd21 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled.iq @@ -1,4 +1,4 @@ -# testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled@NullHandling=sql case-crc:ec1996e8 +# testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled case-crc:ec1996e8 # quidem testcase reason: EQUIV_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index fd3f5b44f810..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,163 +0,0 @@ -# testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled@NullHandling=default case-crc:ec1996e8 -# quidem testcase reason: EQUIV_PLAN -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT dim1 from (SELECT dim1,__time FROM (SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1) GROUP BY 1,2) GROUP BY dim1 -; -+------+ -| dim1 | -+------+ -| 10.1 | -+------+ -(1 row) - -!ok -LogicalAggregate(group=[{0}]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) - LogicalAggregate(group=[{1}]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "__time", - "outputName" : "d0", - "outputType" : "LONG" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "_d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled.iq index 82d7dcdee5c0..0dd9ac3db1c8 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled.iq @@ -1,4 +1,4 @@ -# testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled@NullHandling=sql case-crc:ddcd7387 +# testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled case-crc:ddcd7387 # quidem testcase reason: EQUIV_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index 05bc33e20708..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,163 +0,0 @@ -# testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled@NullHandling=default case-crc:ddcd7387 -# quidem testcase reason: EQUIV_PLAN -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT dim1 from (SELECT dim1,__time FROM (SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1) GROUP BY 1,2) GROUP BY dim1 -; -+------+ -| dim1 | -+------+ -| 10.1 | -+------+ -(1 row) - -!ok -LogicalAggregate(group=[{0}]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) - LogicalAggregate(group=[{1}]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "__time", - "outputName" : "d0", - "outputType" : "LONG" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "_d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites.iq index eb38a3c33f01..a0520b4ce2fe 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites.iq @@ -1,4 +1,4 @@ -# testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites@NullHandling=sql case-crc:cf16e9a6 +# testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites case-crc:cf16e9a6 # quidem testcase reason: EQUIV_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index f554299bc8be..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,163 +0,0 @@ -# testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites@NullHandling=default case-crc:cf16e9a6 -# quidem testcase reason: EQUIV_PLAN -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT dim1 from (SELECT dim1,__time FROM (SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1) GROUP BY 1,2) GROUP BY dim1 -; -+------+ -| dim1 | -+------+ -| 10.1 | -+------+ -(1 row) - -!ok -LogicalAggregate(group=[{0}]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) - LogicalAggregate(group=[{1}]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "__time", - "outputName" : "d0", - "outputType" : "LONG" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "_d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter.iq index 5ae0e78c10c8..31ab8d86f4b2 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter.iq @@ -1,4 +1,4 @@ -# testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter@NullHandling=sql case-crc:830604f9 +# testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter case-crc:830604f9 # quidem testcase reason: EQUIV_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter@NullHandling=default.iq deleted file mode 100644 index ede90bee602d..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,163 +0,0 @@ -# testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter@NullHandling=default case-crc:830604f9 -# quidem testcase reason: EQUIV_PLAN -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT dim1 from (SELECT dim1,__time FROM (SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1) GROUP BY 1,2) GROUP BY dim1 -; -+------+ -| dim1 | -+------+ -| 10.1 | -+------+ -(1 row) - -!ok -LogicalAggregate(group=[{0}]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) - LogicalAggregate(group=[{1}]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "__time", - "outputName" : "d0", - "outputType" : "LONG" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "_d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_disabled.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_disabled.iq index c9644e43b2ec..43388400085b 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinCastLeft@all_disabled@NullHandling=sql case-crc:8cd9e460 +# testInnerJoinCastLeft@all_disabled case-crc:8cd9e460 # quidem testcase reason: JOIN_FILTER_LOCATIONS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_disabled@NullHandling=default.iq deleted file mode 100644 index c178c13cddb0..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,90 +0,0 @@ -# testInnerJoinCastLeft@all_disabled@NullHandling=default case-crc:8cd9e460 -# quidem testcase reason: JOIN_FILTER_LOCATIONS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT foo.m1, l.k, l.v -FROM foo -INNER JOIN lookup.lookyloo l ON CAST(foo.m1 AS VARCHAR) = l.k -; -+----+---+---+ -| m1 | k | v | -+----+---+---+ -+----+---+---+ -(0 rows) - -!ok -LogicalProject(m1=[$0], k=[$2], v=[$3]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(m1=[$5], m10=[CAST($5):VARCHAR NOT NULL]) - LogicalTableScan(table=[[druid, foo]]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(m1=[$5], m10=[CAST($5):VARCHAR NOT NULL], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "CAST(\"m1\", 'STRING')", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "m1", "v0" ], - "columnTypes" : [ "FLOAT", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.k", "j0.v" ], - "columnTypes" : [ "FLOAT", "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_enabled.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_enabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_enabled.iq index e662c85f7053..828fa22013b5 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_enabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinCastLeft@all_enabled@NullHandling=sql case-crc:57e7eb69 +# testInnerJoinCastLeft@all_enabled case-crc:57e7eb69 # quidem testcase reason: JOIN_FILTER_LOCATIONS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_enabled@NullHandling=default.iq deleted file mode 100644 index 11b8ada4085b..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,90 +0,0 @@ -# testInnerJoinCastLeft@all_enabled@NullHandling=default case-crc:57e7eb69 -# quidem testcase reason: JOIN_FILTER_LOCATIONS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT foo.m1, l.k, l.v -FROM foo -INNER JOIN lookup.lookyloo l ON CAST(foo.m1 AS VARCHAR) = l.k -; -+----+---+---+ -| m1 | k | v | -+----+---+---+ -+----+---+---+ -(0 rows) - -!ok -LogicalProject(m1=[$0], k=[$2], v=[$3]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(m1=[$5], m10=[CAST($5):VARCHAR NOT NULL]) - LogicalTableScan(table=[[druid, foo]]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(m1=[$5], m10=[CAST($5):VARCHAR NOT NULL], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "CAST(\"m1\", 'STRING')", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "m1", "v0" ], - "columnTypes" : [ "FLOAT", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.k", "j0.v" ], - "columnTypes" : [ "FLOAT", "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@default.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@default@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@default.iq index 18b7b1a29f8f..ee4d48e9e4d8 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@default.iq @@ -1,4 +1,4 @@ -# testInnerJoinCastLeft@default@NullHandling=sql case-crc:55da2e8b +# testInnerJoinCastLeft@default case-crc:55da2e8b # quidem testcase reason: JOIN_FILTER_LOCATIONS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@default@NullHandling=default.iq deleted file mode 100644 index 6ef633d9977b..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@default@NullHandling=default.iq +++ /dev/null @@ -1,87 +0,0 @@ -# testInnerJoinCastLeft@default@NullHandling=default case-crc:55da2e8b -# quidem testcase reason: JOIN_FILTER_LOCATIONS -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT foo.m1, l.k, l.v -FROM foo -INNER JOIN lookup.lookyloo l ON CAST(foo.m1 AS VARCHAR) = l.k -; -+----+---+---+ -| m1 | k | v | -+----+---+---+ -+----+---+---+ -(0 rows) - -!ok -LogicalProject(m1=[$0], k=[$2], v=[$3]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(m1=[$5], m10=[CAST($5):VARCHAR NOT NULL]) - LogicalTableScan(table=[[druid, foo]]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(m1=[$5], m10=[CAST($5):VARCHAR NOT NULL], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "CAST(\"m1\", 'STRING')", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "m1", "v0" ], - "columnTypes" : [ "FLOAT", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.k", "j0.v" ], - "columnTypes" : [ "FLOAT", "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-on-value-column_disabled.iq similarity index 96% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-on-value-column_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-on-value-column_disabled.iq index 7b9352b740e2..839f2a6c5021 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-on-value-column_disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinCastLeft@filter-on-value-column_disabled@NullHandling=sql case-crc:7f9dea41 +# testInnerJoinCastLeft@filter-on-value-column_disabled case-crc:7f9dea41 # quidem testcase reason: JOIN_FILTER_LOCATIONS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index 6b97e9055c78..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,90 +0,0 @@ -# testInnerJoinCastLeft@filter-on-value-column_disabled@NullHandling=default case-crc:7f9dea41 -# quidem testcase reason: JOIN_FILTER_LOCATIONS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT foo.m1, l.k, l.v -FROM foo -INNER JOIN lookup.lookyloo l ON CAST(foo.m1 AS VARCHAR) = l.k -; -+----+---+---+ -| m1 | k | v | -+----+---+---+ -+----+---+---+ -(0 rows) - -!ok -LogicalProject(m1=[$0], k=[$2], v=[$3]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(m1=[$5], m10=[CAST($5):VARCHAR NOT NULL]) - LogicalTableScan(table=[[druid, foo]]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(m1=[$5], m10=[CAST($5):VARCHAR NOT NULL], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "CAST(\"m1\", 'STRING')", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "m1", "v0" ], - "columnTypes" : [ "FLOAT", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.k", "j0.v" ], - "columnTypes" : [ "FLOAT", "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites-disabled.iq similarity index 96% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites-disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites-disabled.iq index c11d79f00bf9..3564d960d0c3 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites-disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinCastLeft@filter-rewrites-disabled@NullHandling=sql case-crc:1723b06b +# testInnerJoinCastLeft@filter-rewrites-disabled case-crc:1723b06b # quidem testcase reason: JOIN_FILTER_LOCATIONS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index f5b22aebce95..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,90 +0,0 @@ -# testInnerJoinCastLeft@filter-rewrites-disabled@NullHandling=default case-crc:1723b06b -# quidem testcase reason: JOIN_FILTER_LOCATIONS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT foo.m1, l.k, l.v -FROM foo -INNER JOIN lookup.lookyloo l ON CAST(foo.m1 AS VARCHAR) = l.k -; -+----+---+---+ -| m1 | k | v | -+----+---+---+ -+----+---+---+ -(0 rows) - -!ok -LogicalProject(m1=[$0], k=[$2], v=[$3]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(m1=[$5], m10=[CAST($5):VARCHAR NOT NULL]) - LogicalTableScan(table=[[druid, foo]]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(m1=[$5], m10=[CAST($5):VARCHAR NOT NULL], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "CAST(\"m1\", 'STRING')", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "m1", "v0" ], - "columnTypes" : [ "FLOAT", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.k", "j0.v" ], - "columnTypes" : [ "FLOAT", "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites.iq index 651d9c50d741..0ece43e5eea7 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites.iq @@ -1,4 +1,4 @@ -# testInnerJoinCastLeft@filter-rewrites@NullHandling=sql case-crc:fb3b0939 +# testInnerJoinCastLeft@filter-rewrites case-crc:fb3b0939 # quidem testcase reason: JOIN_FILTER_LOCATIONS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index e0c05e781941..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,90 +0,0 @@ -# testInnerJoinCastLeft@filter-rewrites@NullHandling=default case-crc:fb3b0939 -# quidem testcase reason: JOIN_FILTER_LOCATIONS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT foo.m1, l.k, l.v -FROM foo -INNER JOIN lookup.lookyloo l ON CAST(foo.m1 AS VARCHAR) = l.k -; -+----+---+---+ -| m1 | k | v | -+----+---+---+ -+----+---+---+ -(0 rows) - -!ok -LogicalProject(m1=[$0], k=[$2], v=[$3]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(m1=[$5], m10=[CAST($5):VARCHAR NOT NULL]) - LogicalTableScan(table=[[druid, foo]]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(m1=[$5], m10=[CAST($5):VARCHAR NOT NULL], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "CAST(\"m1\", 'STRING')", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "m1", "v0" ], - "columnTypes" : [ "FLOAT", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.k", "j0.v" ], - "columnTypes" : [ "FLOAT", "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@join-to-filter.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@join-to-filter@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@join-to-filter.iq index 91b896f8e989..d7175feff9e9 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@join-to-filter.iq @@ -1,4 +1,4 @@ -# testInnerJoinCastLeft@join-to-filter@NullHandling=sql case-crc:2b873437 +# testInnerJoinCastLeft@join-to-filter case-crc:2b873437 # quidem testcase reason: JOIN_FILTER_LOCATIONS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@join-to-filter@NullHandling=default.iq deleted file mode 100644 index e2f29d5f6320..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,90 +0,0 @@ -# testInnerJoinCastLeft@join-to-filter@NullHandling=default case-crc:2b873437 -# quidem testcase reason: JOIN_FILTER_LOCATIONS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT foo.m1, l.k, l.v -FROM foo -INNER JOIN lookup.lookyloo l ON CAST(foo.m1 AS VARCHAR) = l.k -; -+----+---+---+ -| m1 | k | v | -+----+---+---+ -+----+---+---+ -(0 rows) - -!ok -LogicalProject(m1=[$0], k=[$2], v=[$3]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(m1=[$5], m10=[CAST($5):VARCHAR NOT NULL]) - LogicalTableScan(table=[[druid, foo]]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(m1=[$5], m10=[CAST($5):VARCHAR NOT NULL], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "CAST(\"m1\", 'STRING')", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "m1", "v0" ], - "columnTypes" : [ "FLOAT", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.k", "j0.v" ], - "columnTypes" : [ "FLOAT", "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled.iq index e553be29d9f1..d44735861c41 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=sql case-crc:c8387bad +# testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled case-crc:c8387bad # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=default.iq deleted file mode 100644 index 6a7c709365b9..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,133 +0,0 @@ -# testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=default case-crc:c8387bad -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableJoinLeftTableScanDirect true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1' -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled.iq index fa054c162254..cf08657d734d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=sql case-crc:3117d34a +# testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled case-crc:3117d34a # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=default.iq deleted file mode 100644 index 4829e9398151..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,133 +0,0 @@ -# testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=default case-crc:3117d34a -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableJoinLeftTableScanDirect true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1' -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default.iq index 9f04823844c1..69dc04fce908 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default.iq @@ -1,4 +1,4 @@ -# testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=sql case-crc:8573b42e +# testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default case-crc:8573b42e # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=default.iq deleted file mode 100644 index 587178dde591..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=default.iq +++ /dev/null @@ -1,130 +0,0 @@ -# testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=default case-crc:8573b42e -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinLeftTableScanDirect true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1' -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled.iq index 8ab934aa38b5..3905b6a86688 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql case-crc:aba2d8ac +# testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled case-crc:aba2d8ac # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index d33427702e8b..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,133 +0,0 @@ -# testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default case-crc:aba2d8ac -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableJoinLeftTableScanDirect true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1' -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled.iq index 68861b993c76..8f203442e334 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql case-crc:6bf67b17 +# testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled case-crc:6bf67b17 # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index 3a5f56259901..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,133 +0,0 @@ -# testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default case-crc:6bf67b17 -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableJoinLeftTableScanDirect true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1' -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites.iq index 3b35adf2a126..48bcdf0db6a0 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites.iq @@ -1,4 +1,4 @@ -# testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=sql case-crc:bf731e2a +# testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites case-crc:bf731e2a # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index 5cfae3e4b94a..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,133 +0,0 @@ -# testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=default case-crc:bf731e2a -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableJoinLeftTableScanDirect true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1' -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter.iq index 154056ddf061..0fd15bd4aef0 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter.iq @@ -1,4 +1,4 @@ -# testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=sql case-crc:a0b23b27 +# testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter case-crc:a0b23b27 # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=default.iq deleted file mode 100644 index 758f4c48bf4d..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,133 +0,0 @@ -# testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=default case-crc:a0b23b27 -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableJoinLeftTableScanDirect true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1' -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled.iq index bd2b636c01d4..025a6f97f428 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=sql case-crc:bc06e265 +# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled case-crc:bc06e265 # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=default.iq deleted file mode 100644 index 24f52e8a1c0d..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,133 +0,0 @@ -# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=default case-crc:bc06e265 -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableJoinLeftTableScanDirect true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1 -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled.iq index 246e608caa57..a1bbdc9d1bee 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=sql case-crc:19717e46 +# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled case-crc:19717e46 # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=default.iq deleted file mode 100644 index 8151cc91a3ae..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,133 +0,0 @@ -# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=default case-crc:19717e46 -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableJoinLeftTableScanDirect true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1 -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default.iq index c8506ace31dc..c19194b0d253 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default.iq @@ -1,4 +1,4 @@ -# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=sql case-crc:cddd4617 +# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default case-crc:cddd4617 # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=default.iq deleted file mode 100644 index 87d1ef730e79..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=default.iq +++ /dev/null @@ -1,130 +0,0 @@ -# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=default case-crc:cddd4617 -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinLeftTableScanDirect true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1 -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled.iq index fced12990b83..2bcdd1ba891a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql case-crc:e72bd235 +# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled case-crc:e72bd235 # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index 2c622d5977fc..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,133 +0,0 @@ -# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default case-crc:e72bd235 -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableJoinLeftTableScanDirect true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1 -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled.iq index 610260e4e65d..76302f0928a2 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql case-crc:50015dc5 +# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled case-crc:50015dc5 # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index d5d73892fc1a..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,133 +0,0 @@ -# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default case-crc:50015dc5 -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableJoinLeftTableScanDirect true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1 -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites.iq index 9ebbc7e18d35..0a7e4eae8200 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites.iq @@ -1,4 +1,4 @@ -# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=sql case-crc:ae732a4e +# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites case-crc:ae732a4e # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index 3efe170e8085..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,133 +0,0 @@ -# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=default case-crc:ae732a4e -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableJoinLeftTableScanDirect true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1 -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter.iq index 50484dab8b94..da22fbb491ad 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter.iq @@ -1,4 +1,4 @@ -# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=sql case-crc:a3f1513a +# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter case-crc:a3f1513a # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=default.iq deleted file mode 100644 index 1bd6a87b9a07..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,133 +0,0 @@ -# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=default case-crc:a3f1513a -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableJoinLeftTableScanDirect true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1 -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@all_disabled.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@all_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@all_disabled.iq index a8d6bb7ebddf..1fc1cd2546f4 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@all_disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinSubqueryWithSelectorFilter@all_disabled@NullHandling=sql case-crc:ab8e838b +# testInnerJoinSubqueryWithSelectorFilter@all_disabled case-crc:ab8e838b # quidem testcase reason: FILTER_PUSHED_DOWN_FROM_JOIN_CAN_BE_MORE !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@all_disabled@NullHandling=default.iq deleted file mode 100644 index 6217c2a18e9e..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,106 +0,0 @@ -# testInnerJoinSubqueryWithSelectorFilter@all_disabled@NullHandling=default case-crc:ab8e838b -# quidem testcase reason: FILTER_PUSHED_DOWN_FROM_JOIN_CAN_BE_MORE -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, l1.k FROM foo INNER JOIN (select k || '' as k from lookup.lookyloo group by 1) l1 ON foo.dim1 = l1.k and l1.k = 'abc'; -+------+-----+ -| dim1 | k | -+------+-----+ -| abc | abc | -+------+-----+ -(1 row) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, 'abc')]) - LogicalAggregate(group=[{0}]) - LogicalProject(k=[||($0, '')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, 'abc')]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(k=[||($0, '')], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "concat(\"k\",'')", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "having" : { - "type" : "filter", - "filter" : { - "type" : "selector", - "dimension" : "d0", - "value" : "abc" - }, - "finalize" : true - }, - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "j0.d0" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@all_enabled.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@all_enabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@all_enabled.iq index 0ba46744a826..ac27f9a39137 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@all_enabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinSubqueryWithSelectorFilter@all_enabled@NullHandling=sql case-crc:77939a13 +# testInnerJoinSubqueryWithSelectorFilter@all_enabled case-crc:77939a13 # quidem testcase reason: FILTER_PUSHED_DOWN_FROM_JOIN_CAN_BE_MORE !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@all_enabled@NullHandling=default.iq deleted file mode 100644 index 23a5053dcb85..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,106 +0,0 @@ -# testInnerJoinSubqueryWithSelectorFilter@all_enabled@NullHandling=default case-crc:77939a13 -# quidem testcase reason: FILTER_PUSHED_DOWN_FROM_JOIN_CAN_BE_MORE -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, l1.k FROM foo INNER JOIN (select k || '' as k from lookup.lookyloo group by 1) l1 ON foo.dim1 = l1.k and l1.k = 'abc'; -+------+-----+ -| dim1 | k | -+------+-----+ -| abc | abc | -+------+-----+ -(1 row) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, 'abc')]) - LogicalAggregate(group=[{0}]) - LogicalProject(k=[||($0, '')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, 'abc')]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(k=[||($0, '')], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "concat(\"k\",'')", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "having" : { - "type" : "filter", - "filter" : { - "type" : "selector", - "dimension" : "d0", - "value" : "abc" - }, - "finalize" : true - }, - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "j0.d0" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@default.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@default@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@default.iq index 70d30179c9f8..1097327ec464 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@default.iq @@ -1,4 +1,4 @@ -# testInnerJoinSubqueryWithSelectorFilter@default@NullHandling=sql case-crc:8fb61cd8 +# testInnerJoinSubqueryWithSelectorFilter@default case-crc:8fb61cd8 # quidem testcase reason: FILTER_PUSHED_DOWN_FROM_JOIN_CAN_BE_MORE !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@default@NullHandling=default.iq deleted file mode 100644 index 0dfb90135518..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@default@NullHandling=default.iq +++ /dev/null @@ -1,103 +0,0 @@ -# testInnerJoinSubqueryWithSelectorFilter@default@NullHandling=default case-crc:8fb61cd8 -# quidem testcase reason: FILTER_PUSHED_DOWN_FROM_JOIN_CAN_BE_MORE -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, l1.k FROM foo INNER JOIN (select k || '' as k from lookup.lookyloo group by 1) l1 ON foo.dim1 = l1.k and l1.k = 'abc'; -+------+-----+ -| dim1 | k | -+------+-----+ -| abc | abc | -+------+-----+ -(1 row) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, 'abc')]) - LogicalAggregate(group=[{0}]) - LogicalProject(k=[||($0, '')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, 'abc')]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(k=[||($0, '')], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "concat(\"k\",'')", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "having" : { - "type" : "filter", - "filter" : { - "type" : "selector", - "dimension" : "d0", - "value" : "abc" - }, - "finalize" : true - }, - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "j0.d0" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@filter-on-value-column_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@filter-on-value-column_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@filter-on-value-column_disabled.iq index 17c679a8095b..229adccad3f7 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@filter-on-value-column_disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinSubqueryWithSelectorFilter@filter-on-value-column_disabled@NullHandling=sql case-crc:cf03d9f0 +# testInnerJoinSubqueryWithSelectorFilter@filter-on-value-column_disabled case-crc:cf03d9f0 # quidem testcase reason: FILTER_PUSHED_DOWN_FROM_JOIN_CAN_BE_MORE !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index ba94c15f690a..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,106 +0,0 @@ -# testInnerJoinSubqueryWithSelectorFilter@filter-on-value-column_disabled@NullHandling=default case-crc:cf03d9f0 -# quidem testcase reason: FILTER_PUSHED_DOWN_FROM_JOIN_CAN_BE_MORE -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, l1.k FROM foo INNER JOIN (select k || '' as k from lookup.lookyloo group by 1) l1 ON foo.dim1 = l1.k and l1.k = 'abc'; -+------+-----+ -| dim1 | k | -+------+-----+ -| abc | abc | -+------+-----+ -(1 row) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, 'abc')]) - LogicalAggregate(group=[{0}]) - LogicalProject(k=[||($0, '')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, 'abc')]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(k=[||($0, '')], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "concat(\"k\",'')", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "having" : { - "type" : "filter", - "filter" : { - "type" : "selector", - "dimension" : "d0", - "value" : "abc" - }, - "finalize" : true - }, - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "j0.d0" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@filter-rewrites-disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@filter-rewrites-disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@filter-rewrites-disabled.iq index 80f1859cd244..f40f4e79e105 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@filter-rewrites-disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinSubqueryWithSelectorFilter@filter-rewrites-disabled@NullHandling=sql case-crc:9cf0e315 +# testInnerJoinSubqueryWithSelectorFilter@filter-rewrites-disabled case-crc:9cf0e315 # quidem testcase reason: FILTER_PUSHED_DOWN_FROM_JOIN_CAN_BE_MORE !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index a9a953ea7fa8..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,106 +0,0 @@ -# testInnerJoinSubqueryWithSelectorFilter@filter-rewrites-disabled@NullHandling=default case-crc:9cf0e315 -# quidem testcase reason: FILTER_PUSHED_DOWN_FROM_JOIN_CAN_BE_MORE -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, l1.k FROM foo INNER JOIN (select k || '' as k from lookup.lookyloo group by 1) l1 ON foo.dim1 = l1.k and l1.k = 'abc'; -+------+-----+ -| dim1 | k | -+------+-----+ -| abc | abc | -+------+-----+ -(1 row) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, 'abc')]) - LogicalAggregate(group=[{0}]) - LogicalProject(k=[||($0, '')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, 'abc')]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(k=[||($0, '')], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "concat(\"k\",'')", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "having" : { - "type" : "filter", - "filter" : { - "type" : "selector", - "dimension" : "d0", - "value" : "abc" - }, - "finalize" : true - }, - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "j0.d0" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@filter-rewrites.iq similarity index 96% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@filter-rewrites@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@filter-rewrites.iq index c0f92aa3630d..c66ac5bb0570 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@filter-rewrites.iq @@ -1,4 +1,4 @@ -# testInnerJoinSubqueryWithSelectorFilter@filter-rewrites@NullHandling=sql case-crc:39eaeb27 +# testInnerJoinSubqueryWithSelectorFilter@filter-rewrites case-crc:39eaeb27 # quidem testcase reason: FILTER_PUSHED_DOWN_FROM_JOIN_CAN_BE_MORE !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index 99f56f4cea9e..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,106 +0,0 @@ -# testInnerJoinSubqueryWithSelectorFilter@filter-rewrites@NullHandling=default case-crc:39eaeb27 -# quidem testcase reason: FILTER_PUSHED_DOWN_FROM_JOIN_CAN_BE_MORE -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, l1.k FROM foo INNER JOIN (select k || '' as k from lookup.lookyloo group by 1) l1 ON foo.dim1 = l1.k and l1.k = 'abc'; -+------+-----+ -| dim1 | k | -+------+-----+ -| abc | abc | -+------+-----+ -(1 row) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, 'abc')]) - LogicalAggregate(group=[{0}]) - LogicalProject(k=[||($0, '')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, 'abc')]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(k=[||($0, '')], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "concat(\"k\",'')", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "having" : { - "type" : "filter", - "filter" : { - "type" : "selector", - "dimension" : "d0", - "value" : "abc" - }, - "finalize" : true - }, - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "j0.d0" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@join-to-filter.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@join-to-filter@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@join-to-filter.iq index 1cb08d2f91f1..fc4f7f939d58 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@join-to-filter.iq @@ -1,4 +1,4 @@ -# testInnerJoinSubqueryWithSelectorFilter@join-to-filter@NullHandling=sql case-crc:5c4107c7 +# testInnerJoinSubqueryWithSelectorFilter@join-to-filter case-crc:5c4107c7 # quidem testcase reason: FILTER_PUSHED_DOWN_FROM_JOIN_CAN_BE_MORE !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@join-to-filter@NullHandling=default.iq deleted file mode 100644 index 634c03424a95..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinSubqueryWithSelectorFilter@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,106 +0,0 @@ -# testInnerJoinSubqueryWithSelectorFilter@join-to-filter@NullHandling=default case-crc:5c4107c7 -# quidem testcase reason: FILTER_PUSHED_DOWN_FROM_JOIN_CAN_BE_MORE -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, l1.k FROM foo INNER JOIN (select k || '' as k from lookup.lookyloo group by 1) l1 ON foo.dim1 = l1.k and l1.k = 'abc'; -+------+-----+ -| dim1 | k | -+------+-----+ -| abc | abc | -+------+-----+ -(1 row) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, 'abc')]) - LogicalAggregate(group=[{0}]) - LogicalProject(k=[||($0, '')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, 'abc')]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(k=[||($0, '')], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "concat(\"k\",'')", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "having" : { - "type" : "filter", - "filter" : { - "type" : "selector", - "dimension" : "d0", - "value" : "abc" - }, - "finalize" : true - }, - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "j0.d0" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@all_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@all_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@all_disabled.iq index dd6bc7df8919..3a4aac3097d9 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@all_disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinTableLookupLookupWithFilterWithOuterLimit@all_disabled@NullHandling=sql case-crc:c0bbdf34 +# testInnerJoinTableLookupLookupWithFilterWithOuterLimit@all_disabled case-crc:c0bbdf34 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@all_disabled@NullHandling=default.iq deleted file mode 100644 index e877cf70afb5..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,115 +0,0 @@ -# testInnerJoinTableLookupLookupWithFilterWithOuterLimit@all_disabled@NullHandling=default case-crc:c0bbdf34 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -WHERE l.v = 'xa' -LIMIT 100 -; -+------+ -| dim1 | -+------+ -| | -| 1 | -+------+ -(2 rows) - -!ok -LogicalProject(dim1=[$0]) - LogicalSort(fetch=[100]) - LogicalJoin(condition=[=($1, $4)], joinType=[inner]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], druid=[logical]) - DruidSort(fetch=[100], druid=[logical]) - DruidJoin(condition=[=($1, $4)], joinType=[inner]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "limit" : 100, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@all_enabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@all_enabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@all_enabled.iq index 998268eebef2..66c42a010914 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@all_enabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinTableLookupLookupWithFilterWithOuterLimit@all_enabled@NullHandling=sql case-crc:a33b5d02 +# testInnerJoinTableLookupLookupWithFilterWithOuterLimit@all_enabled case-crc:a33b5d02 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@all_enabled@NullHandling=default.iq deleted file mode 100644 index d32b7d9edd6c..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,115 +0,0 @@ -# testInnerJoinTableLookupLookupWithFilterWithOuterLimit@all_enabled@NullHandling=default case-crc:a33b5d02 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -WHERE l.v = 'xa' -LIMIT 100 -; -+------+ -| dim1 | -+------+ -| | -| 1 | -+------+ -(2 rows) - -!ok -LogicalProject(dim1=[$0]) - LogicalSort(fetch=[100]) - LogicalJoin(condition=[=($1, $4)], joinType=[inner]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], druid=[logical]) - DruidSort(fetch=[100], druid=[logical]) - DruidJoin(condition=[=($1, $4)], joinType=[inner]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "limit" : 100, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@default.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@default@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@default.iq index 7dae799497ae..2c0e07313db9 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@default.iq @@ -1,4 +1,4 @@ -# testInnerJoinTableLookupLookupWithFilterWithOuterLimit@default@NullHandling=sql case-crc:1e1b5255 +# testInnerJoinTableLookupLookupWithFilterWithOuterLimit@default case-crc:1e1b5255 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@default@NullHandling=default.iq deleted file mode 100644 index 4fc3cf4d6513..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@default@NullHandling=default.iq +++ /dev/null @@ -1,112 +0,0 @@ -# testInnerJoinTableLookupLookupWithFilterWithOuterLimit@default@NullHandling=default case-crc:1e1b5255 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -WHERE l.v = 'xa' -LIMIT 100 -; -+------+ -| dim1 | -+------+ -| | -| 1 | -+------+ -(2 rows) - -!ok -LogicalProject(dim1=[$0]) - LogicalSort(fetch=[100]) - LogicalJoin(condition=[=($1, $4)], joinType=[inner]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], druid=[logical]) - DruidSort(fetch=[100], druid=[logical]) - DruidJoin(condition=[=($1, $4)], joinType=[inner]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "limit" : 100, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-on-value-column_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-on-value-column_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-on-value-column_disabled.iq index 5bd1e509cd16..9d0409466341 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-on-value-column_disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-on-value-column_disabled@NullHandling=sql case-crc:644a2686 +# testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-on-value-column_disabled case-crc:644a2686 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index 34401a596151..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,115 +0,0 @@ -# testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-on-value-column_disabled@NullHandling=default case-crc:644a2686 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -WHERE l.v = 'xa' -LIMIT 100 -; -+------+ -| dim1 | -+------+ -| | -| 1 | -+------+ -(2 rows) - -!ok -LogicalProject(dim1=[$0]) - LogicalSort(fetch=[100]) - LogicalJoin(condition=[=($1, $4)], joinType=[inner]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], druid=[logical]) - DruidSort(fetch=[100], druid=[logical]) - DruidJoin(condition=[=($1, $4)], joinType=[inner]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "limit" : 100, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-rewrites-disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-rewrites-disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-rewrites-disabled.iq index b399c29618c7..fbf542cea6bc 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-rewrites-disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-rewrites-disabled@NullHandling=sql case-crc:ff4064d2 +# testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-rewrites-disabled case-crc:ff4064d2 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index 224c51f36d41..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,115 +0,0 @@ -# testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-rewrites-disabled@NullHandling=default case-crc:ff4064d2 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -WHERE l.v = 'xa' -LIMIT 100 -; -+------+ -| dim1 | -+------+ -| | -| 1 | -+------+ -(2 rows) - -!ok -LogicalProject(dim1=[$0]) - LogicalSort(fetch=[100]) - LogicalJoin(condition=[=($1, $4)], joinType=[inner]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], druid=[logical]) - DruidSort(fetch=[100], druid=[logical]) - DruidJoin(condition=[=($1, $4)], joinType=[inner]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "limit" : 100, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-rewrites.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-rewrites@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-rewrites.iq index 0457d233041a..fda989610faf 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-rewrites.iq @@ -1,4 +1,4 @@ -# testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-rewrites@NullHandling=sql case-crc:77fd82e0 +# testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-rewrites case-crc:77fd82e0 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index e17a0911fec7..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,115 +0,0 @@ -# testInnerJoinTableLookupLookupWithFilterWithOuterLimit@filter-rewrites@NullHandling=default case-crc:77fd82e0 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -WHERE l.v = 'xa' -LIMIT 100 -; -+------+ -| dim1 | -+------+ -| | -| 1 | -+------+ -(2 rows) - -!ok -LogicalProject(dim1=[$0]) - LogicalSort(fetch=[100]) - LogicalJoin(condition=[=($1, $4)], joinType=[inner]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], druid=[logical]) - DruidSort(fetch=[100], druid=[logical]) - DruidJoin(condition=[=($1, $4)], joinType=[inner]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "limit" : 100, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@join-to-filter.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@join-to-filter@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@join-to-filter.iq index a42ad1c52dca..4350fccb1328 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@join-to-filter.iq @@ -1,4 +1,4 @@ -# testInnerJoinTableLookupLookupWithFilterWithOuterLimit@join-to-filter@NullHandling=sql case-crc:c06e2be4 +# testInnerJoinTableLookupLookupWithFilterWithOuterLimit@join-to-filter case-crc:c06e2be4 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@join-to-filter@NullHandling=default.iq deleted file mode 100644 index cf3cda46c824..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimit@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,115 +0,0 @@ -# testInnerJoinTableLookupLookupWithFilterWithOuterLimit@join-to-filter@NullHandling=default case-crc:c06e2be4 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -WHERE l.v = 'xa' -LIMIT 100 -; -+------+ -| dim1 | -+------+ -| | -| 1 | -+------+ -(2 rows) - -!ok -LogicalProject(dim1=[$0]) - LogicalSort(fetch=[100]) - LogicalJoin(condition=[=($1, $4)], joinType=[inner]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], druid=[logical]) - DruidSort(fetch=[100], druid=[logical]) - DruidJoin(condition=[=($1, $4)], joinType=[inner]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "limit" : 100, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@all_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@all_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@all_disabled.iq index bcacc5f15660..9a77b9390dec 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@all_disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@all_disabled@NullHandling=sql case-crc:42c7f2c6 +# testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@all_disabled case-crc:42c7f2c6 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@all_disabled@NullHandling=default.iq deleted file mode 100644 index 5b29f09d9cf0..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,113 +0,0 @@ -# testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@all_disabled@NullHandling=default case-crc:42c7f2c6 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT __time, cnt, dim1, dim2, dim3, m1, m2, unique_dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -WHERE l.v = 'xa' -LIMIT 100 -; -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -| __time | cnt | dim1 | dim2 | dim3 | m1 | m2 | unique_dim1 | -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -| 2000-01-01 00:00:00.000 | 1 | | a | ["a","b"] | 1.0 | 1.0 | "AQAAAEAAAA==" | -| 2001-01-01 00:00:00.000 | 1 | 1 | a | | 4.0 | 4.0 | "AQAAAQAAAAFREA==" | -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -(2 rows) - -!ok -LogicalProject(__time=[$0], cnt=[$4], dim1=[$1], dim2=[$2], dim3=[$3], m1=[$5], m2=[$6], unique_dim1=[$7]) - LogicalSort(fetch=[100]) - LogicalJoin(condition=[=($2, $10)], joinType=[inner]) - LogicalJoin(condition=[=($2, $8)], joinType=[inner]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(__time=[$0], cnt=[$4], dim1=[$1], dim2=[$2], dim3=[$3], m1=[$5], m2=[$6], unique_dim1=[$7], druid=[logical]) - DruidSort(fetch=[100], druid=[logical]) - DruidJoin(condition=[=($2, $10)], joinType=[inner]) - DruidJoin(condition=[=($2, $8)], joinType=[inner]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "limit" : 100, - "columns" : [ "__time", "cnt", "dim1", "dim2", "dim3", "m1", "m2", "unique_dim1" ], - "columnTypes" : [ "LONG", "LONG", "STRING", "STRING", "STRING", "FLOAT", "DOUBLE", "COMPLEX" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@all_enabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@all_enabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@all_enabled.iq index 125a27b5d745..46fad0a6839a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@all_enabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@all_enabled@NullHandling=sql case-crc:250bb174 +# testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@all_enabled case-crc:250bb174 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@all_enabled@NullHandling=default.iq deleted file mode 100644 index 2a9913cde1cf..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,113 +0,0 @@ -# testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@all_enabled@NullHandling=default case-crc:250bb174 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT __time, cnt, dim1, dim2, dim3, m1, m2, unique_dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -WHERE l.v = 'xa' -LIMIT 100 -; -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -| __time | cnt | dim1 | dim2 | dim3 | m1 | m2 | unique_dim1 | -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -| 2000-01-01 00:00:00.000 | 1 | | a | ["a","b"] | 1.0 | 1.0 | "AQAAAEAAAA==" | -| 2001-01-01 00:00:00.000 | 1 | 1 | a | | 4.0 | 4.0 | "AQAAAQAAAAFREA==" | -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -(2 rows) - -!ok -LogicalProject(__time=[$0], cnt=[$4], dim1=[$1], dim2=[$2], dim3=[$3], m1=[$5], m2=[$6], unique_dim1=[$7]) - LogicalSort(fetch=[100]) - LogicalJoin(condition=[=($2, $10)], joinType=[inner]) - LogicalJoin(condition=[=($2, $8)], joinType=[inner]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(__time=[$0], cnt=[$4], dim1=[$1], dim2=[$2], dim3=[$3], m1=[$5], m2=[$6], unique_dim1=[$7], druid=[logical]) - DruidSort(fetch=[100], druid=[logical]) - DruidJoin(condition=[=($2, $10)], joinType=[inner]) - DruidJoin(condition=[=($2, $8)], joinType=[inner]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "limit" : 100, - "columns" : [ "__time", "cnt", "dim1", "dim2", "dim3", "m1", "m2", "unique_dim1" ], - "columnTypes" : [ "LONG", "LONG", "STRING", "STRING", "STRING", "FLOAT", "DOUBLE", "COMPLEX" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@default.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@default@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@default.iq index 64960daffddc..668753a4c6f7 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@default.iq @@ -1,4 +1,4 @@ -# testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@default@NullHandling=sql case-crc:f4ae4910 +# testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@default case-crc:f4ae4910 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@default@NullHandling=default.iq deleted file mode 100644 index 1784d49f2de8..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@default@NullHandling=default.iq +++ /dev/null @@ -1,110 +0,0 @@ -# testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@default@NullHandling=default case-crc:f4ae4910 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT __time, cnt, dim1, dim2, dim3, m1, m2, unique_dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -WHERE l.v = 'xa' -LIMIT 100 -; -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -| __time | cnt | dim1 | dim2 | dim3 | m1 | m2 | unique_dim1 | -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -| 2000-01-01 00:00:00.000 | 1 | | a | ["a","b"] | 1.0 | 1.0 | "AQAAAEAAAA==" | -| 2001-01-01 00:00:00.000 | 1 | 1 | a | | 4.0 | 4.0 | "AQAAAQAAAAFREA==" | -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -(2 rows) - -!ok -LogicalProject(__time=[$0], cnt=[$4], dim1=[$1], dim2=[$2], dim3=[$3], m1=[$5], m2=[$6], unique_dim1=[$7]) - LogicalSort(fetch=[100]) - LogicalJoin(condition=[=($2, $10)], joinType=[inner]) - LogicalJoin(condition=[=($2, $8)], joinType=[inner]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(__time=[$0], cnt=[$4], dim1=[$1], dim2=[$2], dim3=[$3], m1=[$5], m2=[$6], unique_dim1=[$7], druid=[logical]) - DruidSort(fetch=[100], druid=[logical]) - DruidJoin(condition=[=($2, $10)], joinType=[inner]) - DruidJoin(condition=[=($2, $8)], joinType=[inner]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "limit" : 100, - "columns" : [ "__time", "cnt", "dim1", "dim2", "dim3", "m1", "m2", "unique_dim1" ], - "columnTypes" : [ "LONG", "LONG", "STRING", "STRING", "STRING", "FLOAT", "DOUBLE", "COMPLEX" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-on-value-column_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-on-value-column_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-on-value-column_disabled.iq index dff0889fc204..c7288df705ad 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-on-value-column_disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-on-value-column_disabled@NullHandling=sql case-crc:492f69c4 +# testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-on-value-column_disabled case-crc:492f69c4 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index 0fc76ae56bc7..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,113 +0,0 @@ -# testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-on-value-column_disabled@NullHandling=default case-crc:492f69c4 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT __time, cnt, dim1, dim2, dim3, m1, m2, unique_dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -WHERE l.v = 'xa' -LIMIT 100 -; -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -| __time | cnt | dim1 | dim2 | dim3 | m1 | m2 | unique_dim1 | -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -| 2000-01-01 00:00:00.000 | 1 | | a | ["a","b"] | 1.0 | 1.0 | "AQAAAEAAAA==" | -| 2001-01-01 00:00:00.000 | 1 | 1 | a | | 4.0 | 4.0 | "AQAAAQAAAAFREA==" | -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -(2 rows) - -!ok -LogicalProject(__time=[$0], cnt=[$4], dim1=[$1], dim2=[$2], dim3=[$3], m1=[$5], m2=[$6], unique_dim1=[$7]) - LogicalSort(fetch=[100]) - LogicalJoin(condition=[=($2, $10)], joinType=[inner]) - LogicalJoin(condition=[=($2, $8)], joinType=[inner]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(__time=[$0], cnt=[$4], dim1=[$1], dim2=[$2], dim3=[$3], m1=[$5], m2=[$6], unique_dim1=[$7], druid=[logical]) - DruidSort(fetch=[100], druid=[logical]) - DruidJoin(condition=[=($2, $10)], joinType=[inner]) - DruidJoin(condition=[=($2, $8)], joinType=[inner]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "limit" : 100, - "columns" : [ "__time", "cnt", "dim1", "dim2", "dim3", "m1", "m2", "unique_dim1" ], - "columnTypes" : [ "LONG", "LONG", "STRING", "STRING", "STRING", "FLOAT", "DOUBLE", "COMPLEX" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-rewrites-disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-rewrites-disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-rewrites-disabled.iq index 2fb3483a6587..7064c34aa371 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-rewrites-disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-rewrites-disabled@NullHandling=sql case-crc:c0ea913a +# testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-rewrites-disabled case-crc:c0ea913a # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index 7a65f384aa0f..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,113 +0,0 @@ -# testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-rewrites-disabled@NullHandling=default case-crc:c0ea913a -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT __time, cnt, dim1, dim2, dim3, m1, m2, unique_dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -WHERE l.v = 'xa' -LIMIT 100 -; -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -| __time | cnt | dim1 | dim2 | dim3 | m1 | m2 | unique_dim1 | -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -| 2000-01-01 00:00:00.000 | 1 | | a | ["a","b"] | 1.0 | 1.0 | "AQAAAEAAAA==" | -| 2001-01-01 00:00:00.000 | 1 | 1 | a | | 4.0 | 4.0 | "AQAAAQAAAAFREA==" | -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -(2 rows) - -!ok -LogicalProject(__time=[$0], cnt=[$4], dim1=[$1], dim2=[$2], dim3=[$3], m1=[$5], m2=[$6], unique_dim1=[$7]) - LogicalSort(fetch=[100]) - LogicalJoin(condition=[=($2, $10)], joinType=[inner]) - LogicalJoin(condition=[=($2, $8)], joinType=[inner]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(__time=[$0], cnt=[$4], dim1=[$1], dim2=[$2], dim3=[$3], m1=[$5], m2=[$6], unique_dim1=[$7], druid=[logical]) - DruidSort(fetch=[100], druid=[logical]) - DruidJoin(condition=[=($2, $10)], joinType=[inner]) - DruidJoin(condition=[=($2, $8)], joinType=[inner]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "limit" : 100, - "columns" : [ "__time", "cnt", "dim1", "dim2", "dim3", "m1", "m2", "unique_dim1" ], - "columnTypes" : [ "LONG", "LONG", "STRING", "STRING", "STRING", "FLOAT", "DOUBLE", "COMPLEX" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-rewrites.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-rewrites@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-rewrites.iq index 43c5077875f9..722c362a13c4 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-rewrites.iq @@ -1,4 +1,4 @@ -# testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-rewrites@NullHandling=sql case-crc:72a94276 +# testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-rewrites case-crc:72a94276 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index 89f63abf3458..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,113 +0,0 @@ -# testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@filter-rewrites@NullHandling=default case-crc:72a94276 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT __time, cnt, dim1, dim2, dim3, m1, m2, unique_dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -WHERE l.v = 'xa' -LIMIT 100 -; -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -| __time | cnt | dim1 | dim2 | dim3 | m1 | m2 | unique_dim1 | -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -| 2000-01-01 00:00:00.000 | 1 | | a | ["a","b"] | 1.0 | 1.0 | "AQAAAEAAAA==" | -| 2001-01-01 00:00:00.000 | 1 | 1 | a | | 4.0 | 4.0 | "AQAAAQAAAAFREA==" | -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -(2 rows) - -!ok -LogicalProject(__time=[$0], cnt=[$4], dim1=[$1], dim2=[$2], dim3=[$3], m1=[$5], m2=[$6], unique_dim1=[$7]) - LogicalSort(fetch=[100]) - LogicalJoin(condition=[=($2, $10)], joinType=[inner]) - LogicalJoin(condition=[=($2, $8)], joinType=[inner]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(__time=[$0], cnt=[$4], dim1=[$1], dim2=[$2], dim3=[$3], m1=[$5], m2=[$6], unique_dim1=[$7], druid=[logical]) - DruidSort(fetch=[100], druid=[logical]) - DruidJoin(condition=[=($2, $10)], joinType=[inner]) - DruidJoin(condition=[=($2, $8)], joinType=[inner]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "limit" : 100, - "columns" : [ "__time", "cnt", "dim1", "dim2", "dim3", "m1", "m2", "unique_dim1" ], - "columnTypes" : [ "LONG", "LONG", "STRING", "STRING", "STRING", "FLOAT", "DOUBLE", "COMPLEX" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@join-to-filter.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@join-to-filter@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@join-to-filter.iq index 7c1afeb6e2de..a3bbcb846a08 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@join-to-filter.iq @@ -1,4 +1,4 @@ -# testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@join-to-filter@NullHandling=sql case-crc:5f194714 +# testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@join-to-filter case-crc:5f194714 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@join-to-filter@NullHandling=default.iq deleted file mode 100644 index a6e56829354c..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,113 +0,0 @@ -# testInnerJoinTableLookupLookupWithFilterWithOuterLimitWithAllColumns@join-to-filter@NullHandling=default case-crc:5f194714 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT __time, cnt, dim1, dim2, dim3, m1, m2, unique_dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -WHERE l.v = 'xa' -LIMIT 100 -; -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -| __time | cnt | dim1 | dim2 | dim3 | m1 | m2 | unique_dim1 | -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -| 2000-01-01 00:00:00.000 | 1 | | a | ["a","b"] | 1.0 | 1.0 | "AQAAAEAAAA==" | -| 2001-01-01 00:00:00.000 | 1 | 1 | a | | 4.0 | 4.0 | "AQAAAQAAAAFREA==" | -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -(2 rows) - -!ok -LogicalProject(__time=[$0], cnt=[$4], dim1=[$1], dim2=[$2], dim3=[$3], m1=[$5], m2=[$6], unique_dim1=[$7]) - LogicalSort(fetch=[100]) - LogicalJoin(condition=[=($2, $10)], joinType=[inner]) - LogicalJoin(condition=[=($2, $8)], joinType=[inner]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(__time=[$0], cnt=[$4], dim1=[$1], dim2=[$2], dim3=[$3], m1=[$5], m2=[$6], unique_dim1=[$7], druid=[logical]) - DruidSort(fetch=[100], druid=[logical]) - DruidJoin(condition=[=($2, $10)], joinType=[inner]) - DruidJoin(condition=[=($2, $8)], joinType=[inner]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "limit" : 100, - "columns" : [ "__time", "cnt", "dim1", "dim2", "dim3", "m1", "m2", "unique_dim1" ], - "columnTypes" : [ "LONG", "LONG", "STRING", "STRING", "STRING", "FLOAT", "DOUBLE", "COMPLEX" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@all_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@all_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@all_disabled.iq index 4de06488b7cd..ffbae3bb3c11 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@all_disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinTableLookupLookupWithFilterWithoutLimit@all_disabled@NullHandling=sql case-crc:3cccedd2 +# testInnerJoinTableLookupLookupWithFilterWithoutLimit@all_disabled case-crc:3cccedd2 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@all_disabled@NullHandling=default.iq deleted file mode 100644 index 5a1dd26cf999..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,111 +0,0 @@ -# testInnerJoinTableLookupLookupWithFilterWithoutLimit@all_disabled@NullHandling=default case-crc:3cccedd2 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -WHERE l.v = 'xa' -; -+------+ -| dim1 | -+------+ -| | -| 1 | -+------+ -(2 rows) - -!ok -LogicalProject(dim1=[$0]) - LogicalJoin(condition=[=($1, $4)], joinType=[inner]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], druid=[logical]) - DruidJoin(condition=[=($1, $4)], joinType=[inner]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@all_enabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@all_enabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@all_enabled.iq index 1b8503d03f57..c9c70dad6908 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@all_enabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinTableLookupLookupWithFilterWithoutLimit@all_enabled@NullHandling=sql case-crc:dc8f333d +# testInnerJoinTableLookupLookupWithFilterWithoutLimit@all_enabled case-crc:dc8f333d # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@all_enabled@NullHandling=default.iq deleted file mode 100644 index d1be2e043f5f..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,111 +0,0 @@ -# testInnerJoinTableLookupLookupWithFilterWithoutLimit@all_enabled@NullHandling=default case-crc:dc8f333d -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -WHERE l.v = 'xa' -; -+------+ -| dim1 | -+------+ -| | -| 1 | -+------+ -(2 rows) - -!ok -LogicalProject(dim1=[$0]) - LogicalJoin(condition=[=($1, $4)], joinType=[inner]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], druid=[logical]) - DruidJoin(condition=[=($1, $4)], joinType=[inner]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@default.iq similarity index 96% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@default@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@default.iq index 38c3346b1dbd..6fba20b7743e 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@default.iq @@ -1,4 +1,4 @@ -# testInnerJoinTableLookupLookupWithFilterWithoutLimit@default@NullHandling=sql case-crc:44e3029e +# testInnerJoinTableLookupLookupWithFilterWithoutLimit@default case-crc:44e3029e # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@default@NullHandling=default.iq deleted file mode 100644 index b11e26248caa..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@default@NullHandling=default.iq +++ /dev/null @@ -1,108 +0,0 @@ -# testInnerJoinTableLookupLookupWithFilterWithoutLimit@default@NullHandling=default case-crc:44e3029e -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -WHERE l.v = 'xa' -; -+------+ -| dim1 | -+------+ -| | -| 1 | -+------+ -(2 rows) - -!ok -LogicalProject(dim1=[$0]) - LogicalJoin(condition=[=($1, $4)], joinType=[inner]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], druid=[logical]) - DruidJoin(condition=[=($1, $4)], joinType=[inner]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-on-value-column_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-on-value-column_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-on-value-column_disabled.iq index 1ea11b338747..fadf893b28ba 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-on-value-column_disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-on-value-column_disabled@NullHandling=sql case-crc:14a70534 +# testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-on-value-column_disabled case-crc:14a70534 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index 75d246bf4ac3..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,111 +0,0 @@ -# testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-on-value-column_disabled@NullHandling=default case-crc:14a70534 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -WHERE l.v = 'xa' -; -+------+ -| dim1 | -+------+ -| | -| 1 | -+------+ -(2 rows) - -!ok -LogicalProject(dim1=[$0]) - LogicalJoin(condition=[=($1, $4)], joinType=[inner]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], druid=[logical]) - DruidJoin(condition=[=($1, $4)], joinType=[inner]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-rewrites-disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-rewrites-disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-rewrites-disabled.iq index 7a2cd28df4de..36eb399231e4 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-rewrites-disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-rewrites-disabled@NullHandling=sql case-crc:5f02f6af +# testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-rewrites-disabled case-crc:5f02f6af # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index 6597bd7ebc56..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,111 +0,0 @@ -# testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-rewrites-disabled@NullHandling=default case-crc:5f02f6af -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -WHERE l.v = 'xa' -; -+------+ -| dim1 | -+------+ -| | -| 1 | -+------+ -(2 rows) - -!ok -LogicalProject(dim1=[$0]) - LogicalJoin(condition=[=($1, $4)], joinType=[inner]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], druid=[logical]) - DruidJoin(condition=[=($1, $4)], joinType=[inner]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-rewrites.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-rewrites@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-rewrites.iq index 41907829d629..43eca53dd919 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-rewrites.iq @@ -1,4 +1,4 @@ -# testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-rewrites@NullHandling=sql case-crc:4616fcc4 +# testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-rewrites case-crc:4616fcc4 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index 4a25441359ef..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,111 +0,0 @@ -# testInnerJoinTableLookupLookupWithFilterWithoutLimit@filter-rewrites@NullHandling=default case-crc:4616fcc4 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -WHERE l.v = 'xa' -; -+------+ -| dim1 | -+------+ -| | -| 1 | -+------+ -(2 rows) - -!ok -LogicalProject(dim1=[$0]) - LogicalJoin(condition=[=($1, $4)], joinType=[inner]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], druid=[logical]) - DruidJoin(condition=[=($1, $4)], joinType=[inner]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@join-to-filter.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@join-to-filter@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@join-to-filter.iq index ac41eb795d84..41b70d12e2f7 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@join-to-filter.iq @@ -1,4 +1,4 @@ -# testInnerJoinTableLookupLookupWithFilterWithoutLimit@join-to-filter@NullHandling=sql case-crc:03b02640 +# testInnerJoinTableLookupLookupWithFilterWithoutLimit@join-to-filter case-crc:03b02640 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@join-to-filter@NullHandling=default.iq deleted file mode 100644 index ba892f05ec1e..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimit@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,111 +0,0 @@ -# testInnerJoinTableLookupLookupWithFilterWithoutLimit@join-to-filter@NullHandling=default case-crc:03b02640 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -WHERE l.v = 'xa' -; -+------+ -| dim1 | -+------+ -| | -| 1 | -+------+ -(2 rows) - -!ok -LogicalProject(dim1=[$0]) - LogicalJoin(condition=[=($1, $4)], joinType=[inner]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], druid=[logical]) - DruidJoin(condition=[=($1, $4)], joinType=[inner]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@all_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@all_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@all_disabled.iq index 2e8b50eae78f..ab277ea896a6 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@all_disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@all_disabled@NullHandling=sql case-crc:bd0bd8bf +# testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@all_disabled case-crc:bd0bd8bf # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@all_disabled@NullHandling=default.iq deleted file mode 100644 index a582ab52ecc9..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,109 +0,0 @@ -# testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@all_disabled@NullHandling=default case-crc:bd0bd8bf -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT __time, cnt, dim1, dim2, dim3, m1, m2, unique_dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -WHERE l.v = 'xa' -; -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -| __time | cnt | dim1 | dim2 | dim3 | m1 | m2 | unique_dim1 | -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -| 2000-01-01 00:00:00.000 | 1 | | a | ["a","b"] | 1.0 | 1.0 | "AQAAAEAAAA==" | -| 2001-01-01 00:00:00.000 | 1 | 1 | a | | 4.0 | 4.0 | "AQAAAQAAAAFREA==" | -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -(2 rows) - -!ok -LogicalProject(__time=[$0], cnt=[$4], dim1=[$1], dim2=[$2], dim3=[$3], m1=[$5], m2=[$6], unique_dim1=[$7]) - LogicalJoin(condition=[=($2, $10)], joinType=[inner]) - LogicalJoin(condition=[=($2, $8)], joinType=[inner]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(__time=[$0], cnt=[$4], dim1=[$1], dim2=[$2], dim3=[$3], m1=[$5], m2=[$6], unique_dim1=[$7], druid=[logical]) - DruidJoin(condition=[=($2, $10)], joinType=[inner]) - DruidJoin(condition=[=($2, $8)], joinType=[inner]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "__time", "cnt", "dim1", "dim2", "dim3", "m1", "m2", "unique_dim1" ], - "columnTypes" : [ "LONG", "LONG", "STRING", "STRING", "STRING", "FLOAT", "DOUBLE", "COMPLEX" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@all_enabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@all_enabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@all_enabled.iq index 7092bd37643b..7d5282b91681 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@all_enabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@all_enabled@NullHandling=sql case-crc:5b16ab5b +# testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@all_enabled case-crc:5b16ab5b # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@all_enabled@NullHandling=default.iq deleted file mode 100644 index 1355671848c5..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,109 +0,0 @@ -# testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@all_enabled@NullHandling=default case-crc:5b16ab5b -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT __time, cnt, dim1, dim2, dim3, m1, m2, unique_dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -WHERE l.v = 'xa' -; -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -| __time | cnt | dim1 | dim2 | dim3 | m1 | m2 | unique_dim1 | -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -| 2000-01-01 00:00:00.000 | 1 | | a | ["a","b"] | 1.0 | 1.0 | "AQAAAEAAAA==" | -| 2001-01-01 00:00:00.000 | 1 | 1 | a | | 4.0 | 4.0 | "AQAAAQAAAAFREA==" | -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -(2 rows) - -!ok -LogicalProject(__time=[$0], cnt=[$4], dim1=[$1], dim2=[$2], dim3=[$3], m1=[$5], m2=[$6], unique_dim1=[$7]) - LogicalJoin(condition=[=($2, $10)], joinType=[inner]) - LogicalJoin(condition=[=($2, $8)], joinType=[inner]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(__time=[$0], cnt=[$4], dim1=[$1], dim2=[$2], dim3=[$3], m1=[$5], m2=[$6], unique_dim1=[$7], druid=[logical]) - DruidJoin(condition=[=($2, $10)], joinType=[inner]) - DruidJoin(condition=[=($2, $8)], joinType=[inner]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "__time", "cnt", "dim1", "dim2", "dim3", "m1", "m2", "unique_dim1" ], - "columnTypes" : [ "LONG", "LONG", "STRING", "STRING", "STRING", "FLOAT", "DOUBLE", "COMPLEX" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@default.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@default@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@default.iq index 0fa857e89184..84f05188b411 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@default.iq @@ -1,4 +1,4 @@ -# testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@default@NullHandling=sql case-crc:f2c3960e +# testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@default case-crc:f2c3960e # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@default@NullHandling=default.iq deleted file mode 100644 index 0c3545233a9c..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@default@NullHandling=default.iq +++ /dev/null @@ -1,106 +0,0 @@ -# testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@default@NullHandling=default case-crc:f2c3960e -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT __time, cnt, dim1, dim2, dim3, m1, m2, unique_dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -WHERE l.v = 'xa' -; -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -| __time | cnt | dim1 | dim2 | dim3 | m1 | m2 | unique_dim1 | -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -| 2000-01-01 00:00:00.000 | 1 | | a | ["a","b"] | 1.0 | 1.0 | "AQAAAEAAAA==" | -| 2001-01-01 00:00:00.000 | 1 | 1 | a | | 4.0 | 4.0 | "AQAAAQAAAAFREA==" | -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -(2 rows) - -!ok -LogicalProject(__time=[$0], cnt=[$4], dim1=[$1], dim2=[$2], dim3=[$3], m1=[$5], m2=[$6], unique_dim1=[$7]) - LogicalJoin(condition=[=($2, $10)], joinType=[inner]) - LogicalJoin(condition=[=($2, $8)], joinType=[inner]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(__time=[$0], cnt=[$4], dim1=[$1], dim2=[$2], dim3=[$3], m1=[$5], m2=[$6], unique_dim1=[$7], druid=[logical]) - DruidJoin(condition=[=($2, $10)], joinType=[inner]) - DruidJoin(condition=[=($2, $8)], joinType=[inner]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "__time", "cnt", "dim1", "dim2", "dim3", "m1", "m2", "unique_dim1" ], - "columnTypes" : [ "LONG", "LONG", "STRING", "STRING", "STRING", "FLOAT", "DOUBLE", "COMPLEX" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-on-value-column_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-on-value-column_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-on-value-column_disabled.iq index 4cd0c8591237..d9883bd3fea4 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-on-value-column_disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-on-value-column_disabled@NullHandling=sql case-crc:8706fb61 +# testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-on-value-column_disabled case-crc:8706fb61 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index ff35fbe2cfa5..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,109 +0,0 @@ -# testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-on-value-column_disabled@NullHandling=default case-crc:8706fb61 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT __time, cnt, dim1, dim2, dim3, m1, m2, unique_dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -WHERE l.v = 'xa' -; -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -| __time | cnt | dim1 | dim2 | dim3 | m1 | m2 | unique_dim1 | -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -| 2000-01-01 00:00:00.000 | 1 | | a | ["a","b"] | 1.0 | 1.0 | "AQAAAEAAAA==" | -| 2001-01-01 00:00:00.000 | 1 | 1 | a | | 4.0 | 4.0 | "AQAAAQAAAAFREA==" | -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -(2 rows) - -!ok -LogicalProject(__time=[$0], cnt=[$4], dim1=[$1], dim2=[$2], dim3=[$3], m1=[$5], m2=[$6], unique_dim1=[$7]) - LogicalJoin(condition=[=($2, $10)], joinType=[inner]) - LogicalJoin(condition=[=($2, $8)], joinType=[inner]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(__time=[$0], cnt=[$4], dim1=[$1], dim2=[$2], dim3=[$3], m1=[$5], m2=[$6], unique_dim1=[$7], druid=[logical]) - DruidJoin(condition=[=($2, $10)], joinType=[inner]) - DruidJoin(condition=[=($2, $8)], joinType=[inner]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "__time", "cnt", "dim1", "dim2", "dim3", "m1", "m2", "unique_dim1" ], - "columnTypes" : [ "LONG", "LONG", "STRING", "STRING", "STRING", "FLOAT", "DOUBLE", "COMPLEX" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-rewrites-disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-rewrites-disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-rewrites-disabled.iq index e8620a6b747c..5e9463689eef 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-rewrites-disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-rewrites-disabled@NullHandling=sql case-crc:efab2e71 +# testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-rewrites-disabled case-crc:efab2e71 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index 457e26b259f9..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,109 +0,0 @@ -# testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-rewrites-disabled@NullHandling=default case-crc:efab2e71 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT __time, cnt, dim1, dim2, dim3, m1, m2, unique_dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -WHERE l.v = 'xa' -; -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -| __time | cnt | dim1 | dim2 | dim3 | m1 | m2 | unique_dim1 | -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -| 2000-01-01 00:00:00.000 | 1 | | a | ["a","b"] | 1.0 | 1.0 | "AQAAAEAAAA==" | -| 2001-01-01 00:00:00.000 | 1 | 1 | a | | 4.0 | 4.0 | "AQAAAQAAAAFREA==" | -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -(2 rows) - -!ok -LogicalProject(__time=[$0], cnt=[$4], dim1=[$1], dim2=[$2], dim3=[$3], m1=[$5], m2=[$6], unique_dim1=[$7]) - LogicalJoin(condition=[=($2, $10)], joinType=[inner]) - LogicalJoin(condition=[=($2, $8)], joinType=[inner]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(__time=[$0], cnt=[$4], dim1=[$1], dim2=[$2], dim3=[$3], m1=[$5], m2=[$6], unique_dim1=[$7], druid=[logical]) - DruidJoin(condition=[=($2, $10)], joinType=[inner]) - DruidJoin(condition=[=($2, $8)], joinType=[inner]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "__time", "cnt", "dim1", "dim2", "dim3", "m1", "m2", "unique_dim1" ], - "columnTypes" : [ "LONG", "LONG", "STRING", "STRING", "STRING", "FLOAT", "DOUBLE", "COMPLEX" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-rewrites.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-rewrites@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-rewrites.iq index 1a5340f1f019..83ec14a808ad 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-rewrites.iq @@ -1,4 +1,4 @@ -# testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-rewrites@NullHandling=sql case-crc:5a4bfe05 +# testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-rewrites case-crc:5a4bfe05 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index cfdb7dcc062e..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,109 +0,0 @@ -# testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@filter-rewrites@NullHandling=default case-crc:5a4bfe05 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT __time, cnt, dim1, dim2, dim3, m1, m2, unique_dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -WHERE l.v = 'xa' -; -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -| __time | cnt | dim1 | dim2 | dim3 | m1 | m2 | unique_dim1 | -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -| 2000-01-01 00:00:00.000 | 1 | | a | ["a","b"] | 1.0 | 1.0 | "AQAAAEAAAA==" | -| 2001-01-01 00:00:00.000 | 1 | 1 | a | | 4.0 | 4.0 | "AQAAAQAAAAFREA==" | -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -(2 rows) - -!ok -LogicalProject(__time=[$0], cnt=[$4], dim1=[$1], dim2=[$2], dim3=[$3], m1=[$5], m2=[$6], unique_dim1=[$7]) - LogicalJoin(condition=[=($2, $10)], joinType=[inner]) - LogicalJoin(condition=[=($2, $8)], joinType=[inner]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(__time=[$0], cnt=[$4], dim1=[$1], dim2=[$2], dim3=[$3], m1=[$5], m2=[$6], unique_dim1=[$7], druid=[logical]) - DruidJoin(condition=[=($2, $10)], joinType=[inner]) - DruidJoin(condition=[=($2, $8)], joinType=[inner]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "__time", "cnt", "dim1", "dim2", "dim3", "m1", "m2", "unique_dim1" ], - "columnTypes" : [ "LONG", "LONG", "STRING", "STRING", "STRING", "FLOAT", "DOUBLE", "COMPLEX" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@join-to-filter.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@join-to-filter@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@join-to-filter.iq index cae65ad23fbf..aa72054afc3e 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@join-to-filter.iq @@ -1,4 +1,4 @@ -# testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@join-to-filter@NullHandling=sql case-crc:aff4ddad +# testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@join-to-filter case-crc:aff4ddad # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@join-to-filter@NullHandling=default.iq deleted file mode 100644 index 47afb97d104d..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,109 +0,0 @@ -# testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns@join-to-filter@NullHandling=default case-crc:aff4ddad -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT __time, cnt, dim1, dim2, dim3, m1, m2, unique_dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -WHERE l.v = 'xa' -; -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -| __time | cnt | dim1 | dim2 | dim3 | m1 | m2 | unique_dim1 | -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -| 2000-01-01 00:00:00.000 | 1 | | a | ["a","b"] | 1.0 | 1.0 | "AQAAAEAAAA==" | -| 2001-01-01 00:00:00.000 | 1 | 1 | a | | 4.0 | 4.0 | "AQAAAQAAAAFREA==" | -+-------------------------+-----+------+------+-----------+-----+-----+--------------------+ -(2 rows) - -!ok -LogicalProject(__time=[$0], cnt=[$4], dim1=[$1], dim2=[$2], dim3=[$3], m1=[$5], m2=[$6], unique_dim1=[$7]) - LogicalJoin(condition=[=($2, $10)], joinType=[inner]) - LogicalJoin(condition=[=($2, $8)], joinType=[inner]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(__time=[$0], cnt=[$4], dim1=[$1], dim2=[$2], dim3=[$3], m1=[$5], m2=[$6], unique_dim1=[$7], druid=[logical]) - DruidJoin(condition=[=($2, $10)], joinType=[inner]) - DruidJoin(condition=[=($2, $8)], joinType=[inner]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "__time", "cnt", "dim1", "dim2", "dim3", "m1", "m2", "unique_dim1" ], - "columnTypes" : [ "LONG", "LONG", "STRING", "STRING", "STRING", "FLOAT", "DOUBLE", "COMPLEX" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_disabled.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_disabled.iq index a67633991e41..e9c0d770f135 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_disabled@NullHandling=sql case-crc:41547876 +# testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_disabled case-crc:41547876 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_disabled@NullHandling=default.iq deleted file mode 100644 index aa37bd300eff..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,275 +0,0 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_disabled@NullHandling=default case-crc:41547876 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT f1.m1, f2.m1 -FROM foo f1 -INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('A', 'B'), ('C', 'D'), ('A', 'C'), ('C', 'E'), ('D', 'H'), ('A', 'D'), ('B', 'C'), -('H', 'E'), ('I', 'J'), ('I', 'K'), ('J', 'I'), ('Q', 'R'), ('Q', 'S'), ('S', 'Q'), ('X', 'Y'), ('Z', 'U'), ('U', 'Z'), ('P', 'Q'), ('X', 'A')) -; -+----+----+ -| m1 | m1 | -+----+----+ -+----+----+ -(0 rows) - -!ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "D" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "C" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "C" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "B" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "E" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "C", "H" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "Q" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "P", "S" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "A" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "B" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "D" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "H" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "J" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "K" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "J" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "I" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "R" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "S" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Y" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Z" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "U" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "U" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Z" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "A" - } ] - } ] - }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"m1\" == \"j0.m1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.m1" ], - "columnTypes" : [ "FLOAT", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_enabled.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_enabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_enabled.iq index 362c59a2d5f1..77ae5e2904e6 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_enabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_enabled@NullHandling=sql case-crc:edf72f8f +# testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_enabled case-crc:edf72f8f # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_enabled@NullHandling=default.iq deleted file mode 100644 index f157cad2924f..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,275 +0,0 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_enabled@NullHandling=default case-crc:edf72f8f -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT f1.m1, f2.m1 -FROM foo f1 -INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('A', 'B'), ('C', 'D'), ('A', 'C'), ('C', 'E'), ('D', 'H'), ('A', 'D'), ('B', 'C'), -('H', 'E'), ('I', 'J'), ('I', 'K'), ('J', 'I'), ('Q', 'R'), ('Q', 'S'), ('S', 'Q'), ('X', 'Y'), ('Z', 'U'), ('U', 'Z'), ('P', 'Q'), ('X', 'A')) -; -+----+----+ -| m1 | m1 | -+----+----+ -+----+----+ -(0 rows) - -!ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "D" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "C" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "C" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "B" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "E" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "C", "H" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "Q" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "P", "S" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "A" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "B" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "D" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "H" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "J" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "K" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "J" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "I" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "R" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "S" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Y" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Z" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "U" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "U" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Z" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "A" - } ] - } ] - }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"m1\" == \"j0.m1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.m1" ], - "columnTypes" : [ "FLOAT", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@default.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@default@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@default.iq index b9f8ae2b6cfc..2bb019ceea7b 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@default.iq @@ -1,4 +1,4 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@default@NullHandling=sql case-crc:580b0963 +# testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@default case-crc:580b0963 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@default@NullHandling=default.iq deleted file mode 100644 index ba86267509c3..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@default@NullHandling=default.iq +++ /dev/null @@ -1,272 +0,0 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@default@NullHandling=default case-crc:580b0963 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT f1.m1, f2.m1 -FROM foo f1 -INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('A', 'B'), ('C', 'D'), ('A', 'C'), ('C', 'E'), ('D', 'H'), ('A', 'D'), ('B', 'C'), -('H', 'E'), ('I', 'J'), ('I', 'K'), ('J', 'I'), ('Q', 'R'), ('Q', 'S'), ('S', 'Q'), ('X', 'Y'), ('Z', 'U'), ('U', 'Z'), ('P', 'Q'), ('X', 'A')) -; -+----+----+ -| m1 | m1 | -+----+----+ -+----+----+ -(0 rows) - -!ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "D" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "C" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "C" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "B" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "E" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "C", "H" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "Q" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "P", "S" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "A" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "B" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "D" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "H" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "J" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "K" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "J" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "I" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "R" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "S" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Y" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Z" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "U" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "U" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Z" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "A" - } ] - } ] - }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"m1\" == \"j0.m1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.m1" ], - "columnTypes" : [ "FLOAT", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-on-value-column_disabled.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-on-value-column_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-on-value-column_disabled.iq index 94fe9ca1953c..780ca95f8925 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-on-value-column_disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-on-value-column_disabled@NullHandling=sql case-crc:cabec9b7 +# testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-on-value-column_disabled case-crc:cabec9b7 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index 76bfe6dcd33b..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,275 +0,0 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-on-value-column_disabled@NullHandling=default case-crc:cabec9b7 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT f1.m1, f2.m1 -FROM foo f1 -INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('A', 'B'), ('C', 'D'), ('A', 'C'), ('C', 'E'), ('D', 'H'), ('A', 'D'), ('B', 'C'), -('H', 'E'), ('I', 'J'), ('I', 'K'), ('J', 'I'), ('Q', 'R'), ('Q', 'S'), ('S', 'Q'), ('X', 'Y'), ('Z', 'U'), ('U', 'Z'), ('P', 'Q'), ('X', 'A')) -; -+----+----+ -| m1 | m1 | -+----+----+ -+----+----+ -(0 rows) - -!ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "D" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "C" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "C" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "B" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "E" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "C", "H" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "Q" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "P", "S" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "A" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "B" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "D" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "H" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "J" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "K" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "J" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "I" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "R" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "S" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Y" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Z" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "U" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "U" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Z" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "A" - } ] - } ] - }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"m1\" == \"j0.m1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.m1" ], - "columnTypes" : [ "FLOAT", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites-disabled.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites-disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites-disabled.iq index d3ac1b35a610..5b895803ae00 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites-disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites-disabled@NullHandling=sql case-crc:32c73cb4 +# testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites-disabled case-crc:32c73cb4 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index 03b29f1cd24a..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,275 +0,0 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites-disabled@NullHandling=default case-crc:32c73cb4 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT f1.m1, f2.m1 -FROM foo f1 -INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('A', 'B'), ('C', 'D'), ('A', 'C'), ('C', 'E'), ('D', 'H'), ('A', 'D'), ('B', 'C'), -('H', 'E'), ('I', 'J'), ('I', 'K'), ('J', 'I'), ('Q', 'R'), ('Q', 'S'), ('S', 'Q'), ('X', 'Y'), ('Z', 'U'), ('U', 'Z'), ('P', 'Q'), ('X', 'A')) -; -+----+----+ -| m1 | m1 | -+----+----+ -+----+----+ -(0 rows) - -!ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "D" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "C" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "C" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "B" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "E" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "C", "H" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "Q" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "P", "S" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "A" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "B" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "D" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "H" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "J" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "K" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "J" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "I" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "R" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "S" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Y" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Z" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "U" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "U" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Z" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "A" - } ] - } ] - }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"m1\" == \"j0.m1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.m1" ], - "columnTypes" : [ "FLOAT", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites.iq index 32543d4b310a..3eadd50d580e 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites.iq @@ -1,4 +1,4 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites@NullHandling=sql case-crc:0cd533f3 +# testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites case-crc:0cd533f3 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index 5d5cdf00e572..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,275 +0,0 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites@NullHandling=default case-crc:0cd533f3 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT f1.m1, f2.m1 -FROM foo f1 -INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('A', 'B'), ('C', 'D'), ('A', 'C'), ('C', 'E'), ('D', 'H'), ('A', 'D'), ('B', 'C'), -('H', 'E'), ('I', 'J'), ('I', 'K'), ('J', 'I'), ('Q', 'R'), ('Q', 'S'), ('S', 'Q'), ('X', 'Y'), ('Z', 'U'), ('U', 'Z'), ('P', 'Q'), ('X', 'A')) -; -+----+----+ -| m1 | m1 | -+----+----+ -+----+----+ -(0 rows) - -!ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "D" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "C" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "C" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "B" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "E" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "C", "H" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "Q" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "P", "S" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "A" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "B" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "D" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "H" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "J" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "K" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "J" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "I" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "R" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "S" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Y" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Z" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "U" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "U" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Z" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "A" - } ] - } ] - }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"m1\" == \"j0.m1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.m1" ], - "columnTypes" : [ "FLOAT", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@join-to-filter.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@join-to-filter@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@join-to-filter.iq index a90c49a5c08c..ab6ea3e9a666 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@join-to-filter.iq @@ -1,4 +1,4 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@join-to-filter@NullHandling=sql case-crc:bf629ea1 +# testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@join-to-filter case-crc:bf629ea1 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@join-to-filter@NullHandling=default.iq deleted file mode 100644 index 206049e87fe0..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,275 +0,0 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@join-to-filter@NullHandling=default case-crc:bf629ea1 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT f1.m1, f2.m1 -FROM foo f1 -INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('A', 'B'), ('C', 'D'), ('A', 'C'), ('C', 'E'), ('D', 'H'), ('A', 'D'), ('B', 'C'), -('H', 'E'), ('I', 'J'), ('I', 'K'), ('J', 'I'), ('Q', 'R'), ('Q', 'S'), ('S', 'Q'), ('X', 'Y'), ('Z', 'U'), ('U', 'Z'), ('P', 'Q'), ('X', 'A')) -; -+----+----+ -| m1 | m1 | -+----+----+ -+----+----+ -(0 rows) - -!ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "D" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "C" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "C" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "B" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "E" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "C", "H" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "Q" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "P", "S" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "A" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "B" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "D" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "H" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "J" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "K" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "J" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "I" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "R" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "S" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Y" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Z" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "U" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "U" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Z" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "A" - } ] - } ] - }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"m1\" == \"j0.m1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.m1" ], - "columnTypes" : [ "FLOAT", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_disabled.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_disabled.iq index 97cebac6335f..a9a1a7fbbd12 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_disabled@NullHandling=sql case-crc:01ca7eac +# testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_disabled case-crc:01ca7eac # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_disabled@NullHandling=default.iq deleted file mode 100644 index 8190d2d01e32..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,276 +0,0 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_disabled@NullHandling=default case-crc:01ca7eac -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT f1.m1, f2.m1 -FROM foo f1 -INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('1', 'a'), ('C', 'D'), ('A', 'C'), ('C', 'E'), ('D', 'H'), ('A', 'D'), ('B', 'C'), -('H', 'E'), ('I', 'J'), ('I', 'K'), ('J', 'I'), ('Q', 'R'), ('Q', 'S'), ('S', 'Q'), ('X', 'Y'), ('Z', 'U'), ('U', 'Z'), ('P', 'Q'), ('X', 'A')) -; -+-----+-----+ -| m1 | m1 | -+-----+-----+ -| 4.0 | 4.0 | -+-----+-----+ -(1 row) - -!ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "D" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "C" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "C" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "B" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "E" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "C", "H" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "Q" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "P", "S" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "1" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "a" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "D" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "H" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "J" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "K" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "J" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "I" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "R" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "S" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Y" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Z" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "U" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "U" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Z" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "A" - } ] - } ] - }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"m1\" == \"j0.m1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.m1" ], - "columnTypes" : [ "FLOAT", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_enabled.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_enabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_enabled.iq index 8dece7f89ea9..b551c046adee 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_enabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_enabled@NullHandling=sql case-crc:ad692955 +# testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_enabled case-crc:ad692955 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_enabled@NullHandling=default.iq deleted file mode 100644 index f465747dcb1c..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,276 +0,0 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_enabled@NullHandling=default case-crc:ad692955 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT f1.m1, f2.m1 -FROM foo f1 -INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('1', 'a'), ('C', 'D'), ('A', 'C'), ('C', 'E'), ('D', 'H'), ('A', 'D'), ('B', 'C'), -('H', 'E'), ('I', 'J'), ('I', 'K'), ('J', 'I'), ('Q', 'R'), ('Q', 'S'), ('S', 'Q'), ('X', 'Y'), ('Z', 'U'), ('U', 'Z'), ('P', 'Q'), ('X', 'A')) -; -+-----+-----+ -| m1 | m1 | -+-----+-----+ -| 4.0 | 4.0 | -+-----+-----+ -(1 row) - -!ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "D" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "C" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "C" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "B" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "E" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "C", "H" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "Q" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "P", "S" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "1" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "a" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "D" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "H" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "J" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "K" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "J" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "I" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "R" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "S" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Y" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Z" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "U" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "U" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Z" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "A" - } ] - } ] - }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"m1\" == \"j0.m1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.m1" ], - "columnTypes" : [ "FLOAT", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@default.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@default@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@default.iq index d927029ea2c8..b761b624a5fa 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@default.iq @@ -1,4 +1,4 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@default@NullHandling=sql case-crc:18950fb9 +# testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@default case-crc:18950fb9 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@default@NullHandling=default.iq deleted file mode 100644 index 9a6d6b99c771..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@default@NullHandling=default.iq +++ /dev/null @@ -1,273 +0,0 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@default@NullHandling=default case-crc:18950fb9 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT f1.m1, f2.m1 -FROM foo f1 -INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('1', 'a'), ('C', 'D'), ('A', 'C'), ('C', 'E'), ('D', 'H'), ('A', 'D'), ('B', 'C'), -('H', 'E'), ('I', 'J'), ('I', 'K'), ('J', 'I'), ('Q', 'R'), ('Q', 'S'), ('S', 'Q'), ('X', 'Y'), ('Z', 'U'), ('U', 'Z'), ('P', 'Q'), ('X', 'A')) -; -+-----+-----+ -| m1 | m1 | -+-----+-----+ -| 4.0 | 4.0 | -+-----+-----+ -(1 row) - -!ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "D" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "C" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "C" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "B" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "E" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "C", "H" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "Q" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "P", "S" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "1" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "a" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "D" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "H" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "J" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "K" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "J" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "I" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "R" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "S" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Y" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Z" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "U" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "U" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Z" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "A" - } ] - } ] - }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"m1\" == \"j0.m1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.m1" ], - "columnTypes" : [ "FLOAT", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-on-value-column_disabled.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-on-value-column_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-on-value-column_disabled.iq index 02455d8a2787..720799b150ed 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-on-value-column_disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-on-value-column_disabled@NullHandling=sql case-crc:8a20cf6d +# testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-on-value-column_disabled case-crc:8a20cf6d # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index 4b34d9f112bf..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,276 +0,0 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-on-value-column_disabled@NullHandling=default case-crc:8a20cf6d -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT f1.m1, f2.m1 -FROM foo f1 -INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('1', 'a'), ('C', 'D'), ('A', 'C'), ('C', 'E'), ('D', 'H'), ('A', 'D'), ('B', 'C'), -('H', 'E'), ('I', 'J'), ('I', 'K'), ('J', 'I'), ('Q', 'R'), ('Q', 'S'), ('S', 'Q'), ('X', 'Y'), ('Z', 'U'), ('U', 'Z'), ('P', 'Q'), ('X', 'A')) -; -+-----+-----+ -| m1 | m1 | -+-----+-----+ -| 4.0 | 4.0 | -+-----+-----+ -(1 row) - -!ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "D" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "C" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "C" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "B" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "E" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "C", "H" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "Q" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "P", "S" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "1" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "a" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "D" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "H" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "J" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "K" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "J" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "I" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "R" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "S" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Y" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Z" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "U" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "U" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Z" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "A" - } ] - } ] - }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"m1\" == \"j0.m1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.m1" ], - "columnTypes" : [ "FLOAT", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites-disabled.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites-disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites-disabled.iq index aec779732b7a..d54c2145a52e 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites-disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites-disabled@NullHandling=sql case-crc:72593a6e +# testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites-disabled case-crc:72593a6e # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index 69a3f68d7a40..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,276 +0,0 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites-disabled@NullHandling=default case-crc:72593a6e -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT f1.m1, f2.m1 -FROM foo f1 -INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('1', 'a'), ('C', 'D'), ('A', 'C'), ('C', 'E'), ('D', 'H'), ('A', 'D'), ('B', 'C'), -('H', 'E'), ('I', 'J'), ('I', 'K'), ('J', 'I'), ('Q', 'R'), ('Q', 'S'), ('S', 'Q'), ('X', 'Y'), ('Z', 'U'), ('U', 'Z'), ('P', 'Q'), ('X', 'A')) -; -+-----+-----+ -| m1 | m1 | -+-----+-----+ -| 4.0 | 4.0 | -+-----+-----+ -(1 row) - -!ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "D" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "C" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "C" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "B" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "E" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "C", "H" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "Q" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "P", "S" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "1" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "a" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "D" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "H" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "J" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "K" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "J" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "I" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "R" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "S" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Y" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Z" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "U" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "U" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Z" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "A" - } ] - } ] - }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"m1\" == \"j0.m1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.m1" ], - "columnTypes" : [ "FLOAT", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites.iq index 3d5da0011b20..8af27a9e0269 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites.iq @@ -1,4 +1,4 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites@NullHandling=sql case-crc:4c4b3529 +# testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites case-crc:4c4b3529 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index a917edeea1b9..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,276 +0,0 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites@NullHandling=default case-crc:4c4b3529 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT f1.m1, f2.m1 -FROM foo f1 -INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('1', 'a'), ('C', 'D'), ('A', 'C'), ('C', 'E'), ('D', 'H'), ('A', 'D'), ('B', 'C'), -('H', 'E'), ('I', 'J'), ('I', 'K'), ('J', 'I'), ('Q', 'R'), ('Q', 'S'), ('S', 'Q'), ('X', 'Y'), ('Z', 'U'), ('U', 'Z'), ('P', 'Q'), ('X', 'A')) -; -+-----+-----+ -| m1 | m1 | -+-----+-----+ -| 4.0 | 4.0 | -+-----+-----+ -(1 row) - -!ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "D" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "C" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "C" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "B" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "E" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "C", "H" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "Q" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "P", "S" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "1" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "a" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "D" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "H" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "J" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "K" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "J" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "I" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "R" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "S" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Y" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Z" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "U" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "U" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Z" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "A" - } ] - } ] - }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"m1\" == \"j0.m1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.m1" ], - "columnTypes" : [ "FLOAT", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@join-to-filter.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@join-to-filter@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@join-to-filter.iq index 7d01bbbc1639..7541140ba924 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@join-to-filter.iq @@ -1,4 +1,4 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@join-to-filter@NullHandling=sql case-crc:fffc987b +# testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@join-to-filter case-crc:fffc987b # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@join-to-filter@NullHandling=default.iq deleted file mode 100644 index 5d596d102bd6..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,276 +0,0 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@join-to-filter@NullHandling=default case-crc:fffc987b -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT f1.m1, f2.m1 -FROM foo f1 -INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('1', 'a'), ('C', 'D'), ('A', 'C'), ('C', 'E'), ('D', 'H'), ('A', 'D'), ('B', 'C'), -('H', 'E'), ('I', 'J'), ('I', 'K'), ('J', 'I'), ('Q', 'R'), ('Q', 'S'), ('S', 'Q'), ('X', 'Y'), ('Z', 'U'), ('U', 'Z'), ('P', 'Q'), ('X', 'A')) -; -+-----+-----+ -| m1 | m1 | -+-----+-----+ -| 4.0 | 4.0 | -+-----+-----+ -(1 row) - -!ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "D" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "C" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "C" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "B" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "E" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "C", "H" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "Q" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "P", "S" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "1" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "a" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "D" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "H" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "J" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "K" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "J" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "I" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "R" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "S" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Y" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Z" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "U" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "U" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Z" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "A" - } ] - } ] - }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"m1\" == \"j0.m1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.m1" ], - "columnTypes" : [ "FLOAT", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_disabled.iq similarity index 96% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_disabled.iq index 5494c70717d5..60e365331ec8 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinWithIsNullFilter@all_disabled@NullHandling=sql case-crc:d168560a +# testInnerJoinWithIsNullFilter@all_disabled case-crc:d168560a # quidem testcase reason: EQUIV_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_disabled@NullHandling=default.iq deleted file mode 100644 index 91325d00f580..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,89 +0,0 @@ -# testInnerJoinWithIsNullFilter@all_disabled@NullHandling=default case-crc:d168560a -# quidem testcase reason: EQUIV_PLAN -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, l.v from druid.foo f inner join lookup.lookyloo l on f.dim1 = l.k where f.dim2 is null; -+------+------+ -| dim1 | v | -+------+------+ -| abc | xabc | -+------+------+ -(1 row) - -!ok -LogicalProject(dim1=[$0], v=[$3]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[IS NULL($1)]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], v=[$3], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[IS NULL($1)]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim2", - "value" : null - }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "j0.v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_enabled.iq similarity index 96% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_enabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_enabled.iq index 71ff3c513153..78ec622e75d8 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_enabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinWithIsNullFilter@all_enabled@NullHandling=sql case-crc:0ff7d829 +# testInnerJoinWithIsNullFilter@all_enabled case-crc:0ff7d829 # quidem testcase reason: EQUIV_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_enabled@NullHandling=default.iq deleted file mode 100644 index b786ccdd1b9e..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,89 +0,0 @@ -# testInnerJoinWithIsNullFilter@all_enabled@NullHandling=default case-crc:0ff7d829 -# quidem testcase reason: EQUIV_PLAN -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, l.v from druid.foo f inner join lookup.lookyloo l on f.dim1 = l.k where f.dim2 is null; -+------+------+ -| dim1 | v | -+------+------+ -| abc | xabc | -+------+------+ -(1 row) - -!ok -LogicalProject(dim1=[$0], v=[$3]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[IS NULL($1)]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], v=[$3], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[IS NULL($1)]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim2", - "value" : null - }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "j0.v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@default.iq similarity index 96% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@default@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@default.iq index ac808026cd40..d4f9da3a7a92 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@default.iq @@ -1,4 +1,4 @@ -# testInnerJoinWithIsNullFilter@default@NullHandling=sql case-crc:a18273fc +# testInnerJoinWithIsNullFilter@default case-crc:a18273fc # quidem testcase reason: EQUIV_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@default@NullHandling=default.iq deleted file mode 100644 index 1e16acec1d99..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@default@NullHandling=default.iq +++ /dev/null @@ -1,86 +0,0 @@ -# testInnerJoinWithIsNullFilter@default@NullHandling=default case-crc:a18273fc -# quidem testcase reason: EQUIV_PLAN -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, l.v from druid.foo f inner join lookup.lookyloo l on f.dim1 = l.k where f.dim2 is null; -+------+------+ -| dim1 | v | -+------+------+ -| abc | xabc | -+------+------+ -(1 row) - -!ok -LogicalProject(dim1=[$0], v=[$3]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[IS NULL($1)]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], v=[$3], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[IS NULL($1)]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim2", - "value" : null - }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "j0.v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-on-value-column_disabled.iq similarity index 96% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-on-value-column_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-on-value-column_disabled.iq index de1730371b66..2c8dcdd161ee 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-on-value-column_disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinWithIsNullFilter@filter-on-value-column_disabled@NullHandling=sql case-crc:4376e2fd +# testInnerJoinWithIsNullFilter@filter-on-value-column_disabled case-crc:4376e2fd # quidem testcase reason: EQUIV_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index cb40c7f8f5fc..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,89 +0,0 @@ -# testInnerJoinWithIsNullFilter@filter-on-value-column_disabled@NullHandling=default case-crc:4376e2fd -# quidem testcase reason: EQUIV_PLAN -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, l.v from druid.foo f inner join lookup.lookyloo l on f.dim1 = l.k where f.dim2 is null; -+------+------+ -| dim1 | v | -+------+------+ -| abc | xabc | -+------+------+ -(1 row) - -!ok -LogicalProject(dim1=[$0], v=[$3]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[IS NULL($1)]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], v=[$3], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[IS NULL($1)]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim2", - "value" : null - }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "j0.v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites-disabled.iq similarity index 96% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites-disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites-disabled.iq index 5258e3f9c9a8..703bb55be39e 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites-disabled.iq @@ -1,4 +1,4 @@ -# testInnerJoinWithIsNullFilter@filter-rewrites-disabled@NullHandling=sql case-crc:bd065f57 +# testInnerJoinWithIsNullFilter@filter-rewrites-disabled case-crc:bd065f57 # quidem testcase reason: EQUIV_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index 10746f2a1122..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,89 +0,0 @@ -# testInnerJoinWithIsNullFilter@filter-rewrites-disabled@NullHandling=default case-crc:bd065f57 -# quidem testcase reason: EQUIV_PLAN -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, l.v from druid.foo f inner join lookup.lookyloo l on f.dim1 = l.k where f.dim2 is null; -+------+------+ -| dim1 | v | -+------+------+ -| abc | xabc | -+------+------+ -(1 row) - -!ok -LogicalProject(dim1=[$0], v=[$3]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[IS NULL($1)]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], v=[$3], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[IS NULL($1)]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim2", - "value" : null - }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "j0.v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites.iq similarity index 96% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites.iq index 0cd43017a00b..d2234333b66f 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites.iq @@ -1,4 +1,4 @@ -# testInnerJoinWithIsNullFilter@filter-rewrites@NullHandling=sql case-crc:dc2fa169 +# testInnerJoinWithIsNullFilter@filter-rewrites case-crc:dc2fa169 # quidem testcase reason: EQUIV_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index e3ba40f56d1b..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,89 +0,0 @@ -# testInnerJoinWithIsNullFilter@filter-rewrites@NullHandling=default case-crc:dc2fa169 -# quidem testcase reason: EQUIV_PLAN -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, l.v from druid.foo f inner join lookup.lookyloo l on f.dim1 = l.k where f.dim2 is null; -+------+------+ -| dim1 | v | -+------+------+ -| abc | xabc | -+------+------+ -(1 row) - -!ok -LogicalProject(dim1=[$0], v=[$3]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[IS NULL($1)]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], v=[$3], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[IS NULL($1)]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim2", - "value" : null - }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "j0.v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@join-to-filter.iq similarity index 96% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@join-to-filter@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@join-to-filter.iq index 07a954368eff..42ed729ef68a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@join-to-filter.iq @@ -1,4 +1,4 @@ -# testInnerJoinWithIsNullFilter@join-to-filter@NullHandling=sql case-crc:1223f3d8 +# testInnerJoinWithIsNullFilter@join-to-filter case-crc:1223f3d8 # quidem testcase reason: EQUIV_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@join-to-filter@NullHandling=default.iq deleted file mode 100644 index c0b7ca271a3d..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,89 +0,0 @@ -# testInnerJoinWithIsNullFilter@join-to-filter@NullHandling=default case-crc:1223f3d8 -# quidem testcase reason: EQUIV_PLAN -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, l.v from druid.foo f inner join lookup.lookyloo l on f.dim1 = l.k where f.dim2 is null; -+------+------+ -| dim1 | v | -+------+------+ -| abc | xabc | -+------+------+ -(1 row) - -!ok -LogicalProject(dim1=[$0], v=[$3]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[IS NULL($1)]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], v=[$3], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[IS NULL($1)]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim2", - "value" : null - }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "j0.v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime.iq index 07124f8cac04..061ca3431798 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime.iq @@ -1,4 +1,4 @@ -# testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime@NullHandling=sql case-crc:6c775193 +# testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime case-crc:6c775193 # quidem testcase reason: JOIN_FILTER_LOCATIONS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime@NullHandling=default.iq deleted file mode 100644 index c08b970f1617..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime@NullHandling=default.iq +++ /dev/null @@ -1,155 +0,0 @@ -# testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime@NullHandling=default case-crc:6c775193 -# quidem testcase reason: JOIN_FILTER_LOCATIONS -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT CAST(__time AS BIGINT), m1, ANY_VALUE(dim3, 100) FROM foo WHERE (CAST(TIME_FLOOR(__time, 'PT1H') AS BIGINT) + 1, m1) IN - ( - SELECT CAST(TIME_FLOOR(__time, 'PT1H') AS BIGINT) + 1 AS t1, MIN(m1) AS t2 FROM foo WHERE dim3 = 'b' - AND __time BETWEEN '1994-04-29 00:00:00' AND '2020-01-11 00:00:00' GROUP BY 1 - ) -GROUP BY 1, 2 -; -+--------------+-----+--------+ -| EXPR$0 | m1 | EXPR$2 | -+--------------+-----+--------+ -| 946684800000 | 1.0 | [a, b] | -| 946771200000 | 2.0 | [b, c] | -+--------------+-----+--------+ -(2 rows) - -!ok -LogicalAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3)]) - LogicalProject(EXPR$0=[CAST($0):BIGINT NOT NULL], m1=[$2], dim3=[$1], $f3=[100]) - LogicalJoin(condition=[AND(=($3, $4), =($2, $5))], joinType=[inner]) - LogicalProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}], t2=[MIN($1)]) - LogicalProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$5]) - LogicalFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3)], druid=[logical]) - DruidProject(EXPR$0=[CAST($0):BIGINT NOT NULL], m1=[$2], dim3=[$1], $f3=[100], druid=[logical]) - DruidJoin(condition=[AND(=($3, $4), =($2, $5))], joinType=[inner]) - DruidProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], t2=[MIN($1)], druid=[logical]) - DruidProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$5], druid=[logical]) - DruidFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "(timestamp_floor(\"__time\",'PT1H',null,'UTC') + 1)", - "outputType" : "LONG" - } ], - "resultFormat" : "compactedList", - "columns" : [ "__time", "dim3", "m1", "v0" ], - "columnTypes" : [ "LONG", "STRING", "FLOAT", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "1994-04-29T00:00:00.000Z/2020-01-11T00:00:00.001Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "(timestamp_floor(\"__time\",'PT1H',null,'UTC') + 1)", - "outputType" : "LONG" - } ], - "filter" : { - "type" : "selector", - "dimension" : "dim3", - "value" : "b" - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "LONG" - } ], - "aggregations" : [ { - "type" : "floatMin", - "name" : "a0", - "fieldName" : "m1" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "((\"v0\" == \"j0.d0\") && (\"m1\" == \"j0.a0\"))", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "__time", - "outputName" : "d0", - "outputType" : "LONG" - }, { - "type" : "default", - "dimension" : "m1", - "outputName" : "d1", - "outputType" : "FLOAT" - } ], - "aggregations" : [ { - "type" : "stringAny", - "name" : "a0", - "fieldName" : "dim3", - "maxStringBytes" : 100, - "aggregateMultipleValues" : true - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues.iq index 2a03f6e25160..dfed2fd4df96 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues.iq @@ -1,4 +1,4 @@ -# testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues@NullHandling=sql case-crc:86f4769d +# testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues case-crc:86f4769d # quidem testcase reason: JOIN_FILTER_LOCATIONS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues@NullHandling=default.iq deleted file mode 100644 index 2f78608ebffd..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues@NullHandling=default.iq +++ /dev/null @@ -1,155 +0,0 @@ -# testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues@NullHandling=default case-crc:86f4769d -# quidem testcase reason: JOIN_FILTER_LOCATIONS -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT CAST(__time AS BIGINT), m1, ANY_VALUE(dim3, 100, false) FROM foo WHERE (CAST(TIME_FLOOR(__time, 'PT1H') AS BIGINT) + 1, m1) IN - ( - SELECT CAST(TIME_FLOOR(__time, 'PT1H') AS BIGINT) + 1 AS t1, MIN(m1) AS t2 FROM foo WHERE dim3 = 'b' - AND __time BETWEEN '1994-04-29 00:00:00' AND '2020-01-11 00:00:00' GROUP BY 1 - ) -GROUP BY 1, 2 -; -+--------------+-----+--------+ -| EXPR$0 | m1 | EXPR$2 | -+--------------+-----+--------+ -| 946684800000 | 1.0 | a | -| 946771200000 | 2.0 | b | -+--------------+-----+--------+ -(2 rows) - -!ok -LogicalAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)]) - LogicalProject(EXPR$0=[CAST($0):BIGINT NOT NULL], m1=[$2], dim3=[$1], $f3=[100], $f4=[false]) - LogicalJoin(condition=[AND(=($3, $4), =($2, $5))], joinType=[inner]) - LogicalProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}], t2=[MIN($1)]) - LogicalProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$5]) - LogicalFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)], druid=[logical]) - DruidProject(EXPR$0=[CAST($0):BIGINT NOT NULL], m1=[$2], dim3=[$1], $f3=[100], $f4=[false], druid=[logical]) - DruidJoin(condition=[AND(=($3, $4), =($2, $5))], joinType=[inner]) - DruidProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], t2=[MIN($1)], druid=[logical]) - DruidProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$5], druid=[logical]) - DruidFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "(timestamp_floor(\"__time\",'PT1H',null,'UTC') + 1)", - "outputType" : "LONG" - } ], - "resultFormat" : "compactedList", - "columns" : [ "__time", "dim3", "m1", "v0" ], - "columnTypes" : [ "LONG", "STRING", "FLOAT", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "1994-04-29T00:00:00.000Z/2020-01-11T00:00:00.001Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "(timestamp_floor(\"__time\",'PT1H',null,'UTC') + 1)", - "outputType" : "LONG" - } ], - "filter" : { - "type" : "selector", - "dimension" : "dim3", - "value" : "b" - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "LONG" - } ], - "aggregations" : [ { - "type" : "floatMin", - "name" : "a0", - "fieldName" : "m1" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "((\"v0\" == \"j0.d0\") && (\"m1\" == \"j0.a0\"))", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "__time", - "outputName" : "d0", - "outputType" : "LONG" - }, { - "type" : "default", - "dimension" : "m1", - "outputName" : "d1", - "outputType" : "FLOAT" - } ], - "aggregations" : [ { - "type" : "stringAny", - "name" : "a0", - "fieldName" : "dim3", - "maxStringBytes" : 100, - "aggregateMultipleValues" : false - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnTimeseriesWithFloorOnTime@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnTimeseriesWithFloorOnTime.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnTimeseriesWithFloorOnTime@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnTimeseriesWithFloorOnTime.iq index 077841f3fe90..e5017b9622c4 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnTimeseriesWithFloorOnTime@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnTimeseriesWithFloorOnTime.iq @@ -1,4 +1,4 @@ -# testJoinOnTimeseriesWithFloorOnTime@NullHandling=sql case-crc:5df8fd08 +# testJoinOnTimeseriesWithFloorOnTime case-crc:5df8fd08 # quidem testcase reason: JOIN_FILTER_LOCATIONS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnTimeseriesWithFloorOnTime@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnTimeseriesWithFloorOnTime@NullHandling=default.iq deleted file mode 100644 index f2275d4db00f..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnTimeseriesWithFloorOnTime@NullHandling=default.iq +++ /dev/null @@ -1,138 +0,0 @@ -# testJoinOnTimeseriesWithFloorOnTime@NullHandling=default case-crc:5df8fd08 -# quidem testcase reason: JOIN_FILTER_LOCATIONS -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT CAST(__time AS BIGINT), m1, ANY_VALUE(dim3, 100, true) FROM foo WHERE (TIME_FLOOR(__time, 'PT1H'), m1) IN - ( - SELECT TIME_FLOOR(__time, 'PT1H') AS t1, MIN(m1) AS t2 FROM foo WHERE dim3 = 'b' - AND __time BETWEEN '1994-04-29 00:00:00' AND '2020-01-11 00:00:00' GROUP BY 1 - ) -GROUP BY 1, 2 -; -+--------------+-----+--------+ -| EXPR$0 | m1 | EXPR$2 | -+--------------+-----+--------+ -| 946684800000 | 1.0 | [a, b] | -| 946771200000 | 2.0 | [b, c] | -+--------------+-----+--------+ -(2 rows) - -!ok -LogicalAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)]) - LogicalProject(EXPR$0=[CAST($0):BIGINT NOT NULL], m1=[$2], dim3=[$1], $f3=[100], $f4=[true]) - LogicalJoin(condition=[AND(=($3, $4), =($2, $5))], joinType=[inner]) - LogicalProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[TIME_FLOOR($0, 'PT1H')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}], t2=[MIN($1)]) - LogicalProject(t1=[TIME_FLOOR($0, 'PT1H')], m1=[$5]) - LogicalFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)], druid=[logical]) - DruidProject(EXPR$0=[CAST($0):BIGINT NOT NULL], m1=[$2], dim3=[$1], $f3=[100], $f4=[true], druid=[logical]) - DruidJoin(condition=[AND(=($3, $4), =($2, $5))], joinType=[inner]) - DruidProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[TIME_FLOOR($0, 'PT1H')], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], t2=[MIN($1)], druid=[logical]) - DruidProject(t1=[TIME_FLOOR($0, 'PT1H')], m1=[$5], druid=[logical]) - DruidFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "timestamp_floor(\"__time\",'PT1H',null,'UTC')", - "outputType" : "LONG" - } ], - "resultFormat" : "compactedList", - "columns" : [ "__time", "dim3", "m1", "v0" ], - "columnTypes" : [ "LONG", "STRING", "FLOAT", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeseries", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "1994-04-29T00:00:00.000Z/2020-01-11T00:00:00.001Z" ] - }, - "filter" : { - "type" : "selector", - "dimension" : "dim3", - "value" : "b" - }, - "granularity" : "HOUR", - "aggregations" : [ { - "type" : "floatMin", - "name" : "a0", - "fieldName" : "m1" - } ] - } - }, - "rightPrefix" : "j0.", - "condition" : "((\"v0\" == \"j0.d0\") && (\"m1\" == \"j0.a0\"))", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "__time", - "outputName" : "d0", - "outputType" : "LONG" - }, { - "type" : "default", - "dimension" : "m1", - "outputName" : "d1", - "outputType" : "FLOAT" - } ], - "aggregations" : [ { - "type" : "stringAny", - "name" : "a0", - "fieldName" : "dim3", - "maxStringBytes" : 100, - "aggregateMultipleValues" : true - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOuterGroupByAndSubqueryHasLimit@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOuterGroupByAndSubqueryHasLimit.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOuterGroupByAndSubqueryHasLimit@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOuterGroupByAndSubqueryHasLimit.iq index f8829b31e1f1..747214b73863 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOuterGroupByAndSubqueryHasLimit@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOuterGroupByAndSubqueryHasLimit.iq @@ -1,4 +1,4 @@ -# testJoinOuterGroupByAndSubqueryHasLimit@NullHandling=sql case-crc:2e733a5b +# testJoinOuterGroupByAndSubqueryHasLimit case-crc:2e733a5b # quidem testcase reason: EQUIV_PLAN_EXTRA_COLUMNS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOuterGroupByAndSubqueryHasLimit@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOuterGroupByAndSubqueryHasLimit@NullHandling=default.iq deleted file mode 100644 index 0cd12b64c22e..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOuterGroupByAndSubqueryHasLimit@NullHandling=default.iq +++ /dev/null @@ -1,128 +0,0 @@ -# testJoinOuterGroupByAndSubqueryHasLimit@NullHandling=default case-crc:2e733a5b -# quidem testcase reason: EQUIV_PLAN_EXTRA_COLUMNS -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim2, AVG(m2) FROM (SELECT * FROM foo AS t1 INNER JOIN foo AS t2 ON t1.m1 = t2.m1 LIMIT 10) AS t3 GROUP BY dim2; -+------+--------------------+ -| dim2 | EXPR$1 | -+------+--------------------+ -| | 3.6666666666666665 | -| a | 2.5 | -| abc | 5.0 | -+------+--------------------+ -(3 rows) - -!ok -LogicalAggregate(group=[{0}], EXPR$1=[AVG($2)]) - LogicalSort(fetch=[10]) - LogicalJoin(condition=[=($1, $3)], joinType=[inner]) - LogicalProject(dim2=[$2], m1=[$5], m2=[$6]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{0}], EXPR$1=[AVG($2)], druid=[logical]) - DruidSort(fetch=[10], druid=[logical]) - DruidJoin(condition=[=($1, $3)], joinType=[inner]) - DruidProject(dim2=[$2], m1=[$5], m2=[$6], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"m1\" == \"j0.m1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "limit" : 10, - "columns" : [ "dim2", "m1", "m2", "j0.m1" ], - "columnTypes" : [ "STRING", "FLOAT", "DOUBLE", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "doubleSum", - "name" : "a0:sum", - "fieldName" : "m2" - }, { - "type" : "count", - "name" : "a0:count" - } ], - "postAggregations" : [ { - "type" : "arithmetic", - "name" : "a0", - "fn" : "quotient", - "fields" : [ { - "type" : "fieldAccess", - "fieldName" : "a0:sum" - }, { - "type" : "fieldAccess", - "fieldName" : "a0:count" - } ] - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@all_disabled.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@all_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@all_disabled.iq index f79216b870af..42bbbdb0b54a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@all_disabled.iq @@ -1,4 +1,4 @@ -# testJoinUnionTablesOnLookup@all_disabled@NullHandling=sql case-crc:0f858af9 +# testJoinUnionTablesOnLookup@all_disabled case-crc:0f858af9 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@all_disabled@NullHandling=default.iq deleted file mode 100644 index 9db056cde3a5..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,118 +0,0 @@ -# testJoinUnionTablesOnLookup@all_disabled@NullHandling=default case-crc:0f858af9 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.v, COUNT(*) -FROM - (SELECT dim2 FROM foo UNION ALL SELECT dim2 FROM numfoo) u - LEFT JOIN lookup.lookyloo ON u.dim2 = lookyloo.k -WHERE lookyloo.v <> 'xa' -GROUP BY lookyloo.v; -+------+--------+ -| v | EXPR$1 | -+------+--------+ -| xabc | 2 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{2}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalUnion(all=[true]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, numfoo]]) - LogicalFilter(condition=[<>($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidAggregate(group=[{2}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidUnion(all=[true]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - DruidFilter(condition=[<>($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "union", - "dataSources" : [ { - "type" : "table", - "name" : "foo" - }, { - "type" : "table", - "name" : "numfoo" - } ] - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - } - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.v", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@all_enabled.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@all_enabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@all_enabled.iq index 96aaf3777412..39348c8897e4 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@all_enabled.iq @@ -1,4 +1,4 @@ -# testJoinUnionTablesOnLookup@all_enabled@NullHandling=sql case-crc:b6ca4d07 +# testJoinUnionTablesOnLookup@all_enabled case-crc:b6ca4d07 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@all_enabled@NullHandling=default.iq deleted file mode 100644 index d8920354d5f4..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,118 +0,0 @@ -# testJoinUnionTablesOnLookup@all_enabled@NullHandling=default case-crc:b6ca4d07 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.v, COUNT(*) -FROM - (SELECT dim2 FROM foo UNION ALL SELECT dim2 FROM numfoo) u - LEFT JOIN lookup.lookyloo ON u.dim2 = lookyloo.k -WHERE lookyloo.v <> 'xa' -GROUP BY lookyloo.v; -+------+--------+ -| v | EXPR$1 | -+------+--------+ -| xabc | 2 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{2}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalUnion(all=[true]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, numfoo]]) - LogicalFilter(condition=[<>($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidAggregate(group=[{2}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidUnion(all=[true]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - DruidFilter(condition=[<>($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "union", - "dataSources" : [ { - "type" : "table", - "name" : "foo" - }, { - "type" : "table", - "name" : "numfoo" - } ] - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - } - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.v", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@default.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@default@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@default.iq index aca438fdfd44..6c13f3c3d80d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@default.iq @@ -1,4 +1,4 @@ -# testJoinUnionTablesOnLookup@default@NullHandling=sql case-crc:afdb4094 +# testJoinUnionTablesOnLookup@default case-crc:afdb4094 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@default@NullHandling=default.iq deleted file mode 100644 index 749b75cc5a3e..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@default@NullHandling=default.iq +++ /dev/null @@ -1,115 +0,0 @@ -# testJoinUnionTablesOnLookup@default@NullHandling=default case-crc:afdb4094 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.v, COUNT(*) -FROM - (SELECT dim2 FROM foo UNION ALL SELECT dim2 FROM numfoo) u - LEFT JOIN lookup.lookyloo ON u.dim2 = lookyloo.k -WHERE lookyloo.v <> 'xa' -GROUP BY lookyloo.v; -+------+--------+ -| v | EXPR$1 | -+------+--------+ -| xabc | 2 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{2}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalUnion(all=[true]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, numfoo]]) - LogicalFilter(condition=[<>($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidAggregate(group=[{2}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidUnion(all=[true]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - DruidFilter(condition=[<>($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "union", - "dataSources" : [ { - "type" : "table", - "name" : "foo" - }, { - "type" : "table", - "name" : "numfoo" - } ] - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - } - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.v", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@filter-on-value-column_disabled.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@filter-on-value-column_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@filter-on-value-column_disabled.iq index 9cbca800f56a..c32aaa49ae45 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@filter-on-value-column_disabled.iq @@ -1,4 +1,4 @@ -# testJoinUnionTablesOnLookup@filter-on-value-column_disabled@NullHandling=sql case-crc:cc84f10f +# testJoinUnionTablesOnLookup@filter-on-value-column_disabled case-crc:cc84f10f # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index 31e6ccdc5be1..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,118 +0,0 @@ -# testJoinUnionTablesOnLookup@filter-on-value-column_disabled@NullHandling=default case-crc:cc84f10f -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.v, COUNT(*) -FROM - (SELECT dim2 FROM foo UNION ALL SELECT dim2 FROM numfoo) u - LEFT JOIN lookup.lookyloo ON u.dim2 = lookyloo.k -WHERE lookyloo.v <> 'xa' -GROUP BY lookyloo.v; -+------+--------+ -| v | EXPR$1 | -+------+--------+ -| xabc | 2 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{2}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalUnion(all=[true]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, numfoo]]) - LogicalFilter(condition=[<>($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidAggregate(group=[{2}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidUnion(all=[true]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - DruidFilter(condition=[<>($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "union", - "dataSources" : [ { - "type" : "table", - "name" : "foo" - }, { - "type" : "table", - "name" : "numfoo" - } ] - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - } - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.v", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@filter-rewrites-disabled.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@filter-rewrites-disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@filter-rewrites-disabled.iq index 61a740559d9b..cf604930cef5 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@filter-rewrites-disabled.iq @@ -1,4 +1,4 @@ -# testJoinUnionTablesOnLookup@filter-rewrites-disabled@NullHandling=sql case-crc:547b2f23 +# testJoinUnionTablesOnLookup@filter-rewrites-disabled case-crc:547b2f23 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index 35800f37074d..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,118 +0,0 @@ -# testJoinUnionTablesOnLookup@filter-rewrites-disabled@NullHandling=default case-crc:547b2f23 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.v, COUNT(*) -FROM - (SELECT dim2 FROM foo UNION ALL SELECT dim2 FROM numfoo) u - LEFT JOIN lookup.lookyloo ON u.dim2 = lookyloo.k -WHERE lookyloo.v <> 'xa' -GROUP BY lookyloo.v; -+------+--------+ -| v | EXPR$1 | -+------+--------+ -| xabc | 2 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{2}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalUnion(all=[true]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, numfoo]]) - LogicalFilter(condition=[<>($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidAggregate(group=[{2}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidUnion(all=[true]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - DruidFilter(condition=[<>($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "union", - "dataSources" : [ { - "type" : "table", - "name" : "foo" - }, { - "type" : "table", - "name" : "numfoo" - } ] - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - } - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.v", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@filter-rewrites.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@filter-rewrites@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@filter-rewrites.iq index c84c653bd993..2d7abddf136a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@filter-rewrites.iq @@ -1,4 +1,4 @@ -# testJoinUnionTablesOnLookup@filter-rewrites@NullHandling=sql case-crc:75977c99 +# testJoinUnionTablesOnLookup@filter-rewrites case-crc:75977c99 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index f0a6386c8a61..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,118 +0,0 @@ -# testJoinUnionTablesOnLookup@filter-rewrites@NullHandling=default case-crc:75977c99 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.v, COUNT(*) -FROM - (SELECT dim2 FROM foo UNION ALL SELECT dim2 FROM numfoo) u - LEFT JOIN lookup.lookyloo ON u.dim2 = lookyloo.k -WHERE lookyloo.v <> 'xa' -GROUP BY lookyloo.v; -+------+--------+ -| v | EXPR$1 | -+------+--------+ -| xabc | 2 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{2}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalUnion(all=[true]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, numfoo]]) - LogicalFilter(condition=[<>($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidAggregate(group=[{2}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidUnion(all=[true]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - DruidFilter(condition=[<>($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "union", - "dataSources" : [ { - "type" : "table", - "name" : "foo" - }, { - "type" : "table", - "name" : "numfoo" - } ] - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - } - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.v", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@join-to-filter.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@join-to-filter@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@join-to-filter.iq index 912b0521ddd5..c4e81fac1f17 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@join-to-filter.iq @@ -1,4 +1,4 @@ -# testJoinUnionTablesOnLookup@join-to-filter@NullHandling=sql case-crc:2965d141 +# testJoinUnionTablesOnLookup@join-to-filter case-crc:2965d141 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@join-to-filter@NullHandling=default.iq deleted file mode 100644 index 1b2b5b1db9cc..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinUnionTablesOnLookup@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,118 +0,0 @@ -# testJoinUnionTablesOnLookup@join-to-filter@NullHandling=default case-crc:2965d141 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT lookyloo.v, COUNT(*) -FROM - (SELECT dim2 FROM foo UNION ALL SELECT dim2 FROM numfoo) u - LEFT JOIN lookup.lookyloo ON u.dim2 = lookyloo.k -WHERE lookyloo.v <> 'xa' -GROUP BY lookyloo.v; -+------+--------+ -| v | EXPR$1 | -+------+--------+ -| xabc | 2 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{2}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalUnion(all=[true]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, numfoo]]) - LogicalFilter(condition=[<>($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidAggregate(group=[{2}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidUnion(all=[true]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - DruidFilter(condition=[<>($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "union", - "dataSources" : [ { - "type" : "table", - "name" : "foo" - }, { - "type" : "table", - "name" : "numfoo" - } ] - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - } - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.v", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition.iq index 1f2ac13cefef..f27977ca570d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition.iq @@ -1,4 +1,4 @@ -# testJoinWithInputRefCondition@NullHandling=sql case-crc:9a6c217b +# testJoinWithInputRefCondition case-crc:9a6c217b # quidem testcase reason: JOIN_FILTER_LOCATIONS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition@NullHandling=default.iq deleted file mode 100644 index b29ee72ab4f1..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition@NullHandling=default.iq +++ /dev/null @@ -1,126 +0,0 @@ -# testJoinWithInputRefCondition@NullHandling=default case-crc:9a6c217b -# quidem testcase reason: JOIN_FILTER_LOCATIONS -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT COUNT(*) FILTER (WHERE FLOOR(100) NOT IN (SELECT m1 FROM foo)) FROM foo; -+--------+ -| EXPR$0 | -+--------+ -| 6 | -+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{}], EXPR$0=[COUNT() FILTER $0]) - LogicalProject($f0=[IS NULL($2)]) - LogicalJoin(condition=[=(CAST(FLOOR(100)):FLOAT NOT NULL, $1)], joinType=[left]) - LogicalProject(DUMMY=[0]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{5}], i=[LITERAL_AGG(true)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{}], EXPR$0=[COUNT() FILTER $0], druid=[logical]) - DruidProject($f0=[IS NULL($2)], druid=[logical]) - DruidJoin(condition=[=(CAST(FLOOR(100)):FLOAT NOT NULL, $1)], joinType=[left]) - DruidProject(DUMMY=[0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{5}], i=[LITERAL_AGG(true)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "timeseries", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "0", - "outputType" : "LONG" - } ], - "resultFormat" : "compactedList", - "columns" : [ "v0" ], - "columnTypes" : [ "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "m1", - "outputName" : "d0", - "outputType" : "FLOAT" - } ], - "postAggregations" : [ { - "type" : "expression", - "name" : "a0", - "expression" : "1", - "outputType" : "LONG" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(CAST(floor(100), 'DOUBLE') == \"j0.d0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "aggregations" : [ { - "type" : "filtered", - "aggregator" : { - "type" : "count", - "name" : "a0" - }, - "filter" : { - "type" : "selector", - "dimension" : "j0.a0", - "value" : null - }, - "name" : "a0" - } ] -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled.iq index 93293e3f7e80..c8d6d5129c20 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled.iq @@ -1,4 +1,4 @@ -# testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=sql case-crc:812bafe2 +# testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled case-crc:812bafe2 # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=default.iq deleted file mode 100644 index 2f4290fed6de..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,133 +0,0 @@ -# testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=default case-crc:812bafe2 -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableJoinLeftTableScanDirect true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1' -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[left]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[left]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled.iq index 90f37d025af6..b62c7c726ce6 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled.iq @@ -1,4 +1,4 @@ -# testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=sql case-crc:8fd5adf2 +# testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled case-crc:8fd5adf2 # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=default.iq deleted file mode 100644 index 27d860eb9f04..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,133 +0,0 @@ -# testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=default case-crc:8fd5adf2 -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableJoinLeftTableScanDirect true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1' -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[left]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[left]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default.iq index ab43f9604a69..c5f86b1b5ce2 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default.iq @@ -1,4 +1,4 @@ -# testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=sql case-crc:96a161fe +# testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default case-crc:96a161fe # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=default.iq deleted file mode 100644 index 845d81b6a3fc..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=default.iq +++ /dev/null @@ -1,130 +0,0 @@ -# testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=default case-crc:96a161fe -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinLeftTableScanDirect true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1' -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[left]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[left]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled.iq index 0d4e75093b95..14dcd6073484 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled.iq @@ -1,4 +1,4 @@ -# testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql case-crc:c04e449a +# testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled case-crc:c04e449a # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index 8f7728670181..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,133 +0,0 @@ -# testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default case-crc:c04e449a -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableJoinLeftTableScanDirect true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1' -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[left]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[left]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled.iq index 602e70825959..cfed876bbef9 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled.iq @@ -1,4 +1,4 @@ -# testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql case-crc:758d5732 +# testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled case-crc:758d5732 # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index eaf39cc2e5a8..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,133 +0,0 @@ -# testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default case-crc:758d5732 -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableJoinLeftTableScanDirect true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1' -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[left]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[left]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites.iq index e719d27e6dff..07df8c2ad9f0 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites.iq @@ -1,4 +1,4 @@ -# testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=sql case-crc:108e478f +# testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites case-crc:108e478f # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index fe73169674d1..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,133 +0,0 @@ -# testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=default case-crc:108e478f -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableJoinLeftTableScanDirect true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1' -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[left]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[left]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter.iq index c74c2744c540..377b05fce6df 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter.iq @@ -1,4 +1,4 @@ -# testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=sql case-crc:9aafecc7 +# testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter case-crc:9aafecc7 # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=default.iq deleted file mode 100644 index 0e75a816828a..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,133 +0,0 @@ -# testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=default case-crc:9aafecc7 -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableJoinLeftTableScanDirect true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1' -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[left]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[left]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled.iq index 5682326c03e0..16752a96142b 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled.iq @@ -1,4 +1,4 @@ -# testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled@NullHandling=sql case-crc:8c906e38 +# testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled case-crc:8c906e38 # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled@NullHandling=default.iq deleted file mode 100644 index 9856d6880d74..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,139 +0,0 @@ -# testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled@NullHandling=default case-crc:8c906e38 -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableJoinLeftTableScanDirect true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' AND "__time" >= '1999' -) -SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1' -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[left]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) - LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[left]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) - DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "1999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "1999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.v0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled.iq index 098f6a50bc90..4ffd048861a9 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled.iq @@ -1,4 +1,4 @@ -# testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled@NullHandling=sql case-crc:82cd66be +# testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled case-crc:82cd66be # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled@NullHandling=default.iq deleted file mode 100644 index dd18a691b267..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,139 +0,0 @@ -# testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled@NullHandling=default case-crc:82cd66be -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableJoinLeftTableScanDirect true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' AND "__time" >= '1999' -) -SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1' -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[left]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) - LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[left]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) - DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "1999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "1999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.v0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default.iq index a27da638639d..af089c203ad6 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default.iq @@ -1,4 +1,4 @@ -# testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default@NullHandling=sql case-crc:0d6a36b1 +# testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default case-crc:0d6a36b1 # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default@NullHandling=default.iq deleted file mode 100644 index dd0fe8341b5d..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default@NullHandling=default.iq +++ /dev/null @@ -1,136 +0,0 @@ -# testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default@NullHandling=default case-crc:0d6a36b1 -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinLeftTableScanDirect true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' AND "__time" >= '1999' -) -SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1' -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[left]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) - LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[left]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) - DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "1999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "1999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.v0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled.iq index 295802c72308..35075b5f0b01 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled.iq @@ -1,4 +1,4 @@ -# testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql case-crc:39d6e0f2 +# testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled case-crc:39d6e0f2 # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index 22719f86aea2..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,139 +0,0 @@ -# testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default case-crc:39d6e0f2 -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableJoinLeftTableScanDirect true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' AND "__time" >= '1999' -) -SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1' -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[left]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) - LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[left]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) - DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "1999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "1999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.v0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled.iq index 8815732fe58c..b943b7d9ab8a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled.iq @@ -1,4 +1,4 @@ -# testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql case-crc:18bc3b01 +# testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled case-crc:18bc3b01 # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index de427c4ece07..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,139 +0,0 @@ -# testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default case-crc:18bc3b01 -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableJoinLeftTableScanDirect true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' AND "__time" >= '1999' -) -SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1' -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[left]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) - LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[left]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) - DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "1999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "1999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.v0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites.iq index d5e5d614e3dc..1d38352fd49d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites.iq @@ -1,4 +1,4 @@ -# testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites@NullHandling=sql case-crc:f4e03dc8 +# testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites case-crc:f4e03dc8 # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index 7973786f10ec..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,139 +0,0 @@ -# testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites@NullHandling=default case-crc:f4e03dc8 -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableJoinLeftTableScanDirect true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' AND "__time" >= '1999' -) -SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1' -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[left]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) - LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[left]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) - DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "1999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "1999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.v0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter.iq index 0a1b6a66606f..7ea960f65adc 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter.iq @@ -1,4 +1,4 @@ -# testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter@NullHandling=sql case-crc:12f185e2 +# testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter case-crc:12f185e2 # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter@NullHandling=default.iq deleted file mode 100644 index c1b280b3803c..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,139 +0,0 @@ -# testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter@NullHandling=default case-crc:12f185e2 -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableJoinLeftTableScanDirect true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' AND "__time" >= '1999' -) -SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1' -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[left]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) - LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[left]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) - DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "1999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "1999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.v0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled.iq index 7dbc2ff6923d..dd765b30d72d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled.iq @@ -1,4 +1,4 @@ -# testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=sql case-crc:4fbedf89 +# testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled case-crc:4fbedf89 # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=default.iq deleted file mode 100644 index 9149b1cebb62..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,133 +0,0 @@ -# testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=default case-crc:4fbedf89 -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableJoinLeftTableScanDirect true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[left]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[left]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled.iq index e4c05ae03b3c..3ecc78a4c645 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled.iq @@ -1,4 +1,4 @@ -# testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=sql case-crc:b8a4cfcc +# testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled case-crc:b8a4cfcc # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=default.iq deleted file mode 100644 index ba5ed17c9e7e..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,133 +0,0 @@ -# testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=default case-crc:b8a4cfcc -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableJoinLeftTableScanDirect true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[left]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[left]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default.iq index 40515f8b62d5..d86ade21596c 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default.iq @@ -1,4 +1,4 @@ -# testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=sql case-crc:894a632a +# testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default case-crc:894a632a # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=default.iq deleted file mode 100644 index fd632f528467..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=default.iq +++ /dev/null @@ -1,130 +0,0 @@ -# testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=default case-crc:894a632a -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinLeftTableScanDirect true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[left]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[left]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled.iq index 54427093b152..c727879f2c88 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled.iq @@ -1,4 +1,4 @@ -# testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql case-crc:3fd983bc +# testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled case-crc:3fd983bc # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index eb287c5eeedd..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,133 +0,0 @@ -# testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default case-crc:3fd983bc -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableJoinLeftTableScanDirect true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[left]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[left]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled.iq index 9227fb31b5e3..68ef9aa83106 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled.iq @@ -1,4 +1,4 @@ -# testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql case-crc:af2a3a3c +# testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled case-crc:af2a3a3c # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index e36e08bdf07d..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,133 +0,0 @@ -# testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default case-crc:af2a3a3c -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableJoinLeftTableScanDirect true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[left]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[left]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites.iq index 580ed6694725..620bce6f23d1 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites.iq @@ -1,4 +1,4 @@ -# testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=sql case-crc:f53ef0f5 +# testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites case-crc:f53ef0f5 # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index 6d586cb7eebd..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,133 +0,0 @@ -# testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=default case-crc:f53ef0f5 -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableJoinLeftTableScanDirect true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[left]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[left]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter.iq index 800a422b8f09..67c9f05dd8da 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter.iq @@ -1,4 +1,4 @@ -# testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=sql case-crc:76a9a03f +# testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter case-crc:76a9a03f # quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=default.iq deleted file mode 100644 index e108a87115d4..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,133 +0,0 @@ -# testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=default case-crc:76a9a03f -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableJoinLeftTableScanDirect true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[left]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[left]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@all_disabled.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@all_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@all_disabled.iq index 948f9d6ccc02..d61065e62da6 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@all_disabled.iq @@ -1,4 +1,4 @@ -# testLeftJoinSubqueryWithSelectorFilter@all_disabled@NullHandling=sql case-crc:69cf0894 +# testLeftJoinSubqueryWithSelectorFilter@all_disabled case-crc:69cf0894 # quidem testcase reason: IMPROVED_PLAN !set computeInnerJoinCostAsFilter false !set debug true diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@all_disabled@NullHandling=default.iq deleted file mode 100644 index 44ab3d35751f..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,111 +0,0 @@ -# testLeftJoinSubqueryWithSelectorFilter@all_disabled@NullHandling=default case-crc:69cf0894 -# quidem testcase reason: IMPROVED_PLAN -!set computeInnerJoinCostAsFilter false -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, l1.k -FROM foo -LEFT JOIN (select k || '' as k from lookup.lookyloo group by 1) l1 ON foo.dim1 = l1.k -WHERE l1.k = 'abc' -; -+------+-----+ -| dim1 | k | -+------+-----+ -| abc | abc | -+------+-----+ -(1 row) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, 'abc')]) - LogicalAggregate(group=[{0}]) - LogicalProject(k=[||($0, '')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, 'abc')]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(k=[||($0, '')], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "concat(\"k\",'')", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "having" : { - "type" : "filter", - "filter" : { - "type" : "selector", - "dimension" : "d0", - "value" : "abc" - }, - "finalize" : true - }, - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "j0.d0" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@all_enabled.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@all_enabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@all_enabled.iq index 4d11fcca9772..45d5c82ebeba 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@all_enabled.iq @@ -1,4 +1,4 @@ -# testLeftJoinSubqueryWithSelectorFilter@all_enabled@NullHandling=sql case-crc:0644d80d +# testLeftJoinSubqueryWithSelectorFilter@all_enabled case-crc:0644d80d # quidem testcase reason: IMPROVED_PLAN !set computeInnerJoinCostAsFilter false !set debug true diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@all_enabled@NullHandling=default.iq deleted file mode 100644 index f00101048108..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,111 +0,0 @@ -# testLeftJoinSubqueryWithSelectorFilter@all_enabled@NullHandling=default case-crc:0644d80d -# quidem testcase reason: IMPROVED_PLAN -!set computeInnerJoinCostAsFilter false -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, l1.k -FROM foo -LEFT JOIN (select k || '' as k from lookup.lookyloo group by 1) l1 ON foo.dim1 = l1.k -WHERE l1.k = 'abc' -; -+------+-----+ -| dim1 | k | -+------+-----+ -| abc | abc | -+------+-----+ -(1 row) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, 'abc')]) - LogicalAggregate(group=[{0}]) - LogicalProject(k=[||($0, '')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, 'abc')]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(k=[||($0, '')], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "concat(\"k\",'')", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "having" : { - "type" : "filter", - "filter" : { - "type" : "selector", - "dimension" : "d0", - "value" : "abc" - }, - "finalize" : true - }, - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "j0.d0" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@default.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@default@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@default.iq index d52362bb637d..2960d0865203 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@default.iq @@ -1,4 +1,4 @@ -# testLeftJoinSubqueryWithSelectorFilter@default@NullHandling=sql case-crc:8c5a723c +# testLeftJoinSubqueryWithSelectorFilter@default case-crc:8c5a723c # quidem testcase reason: IMPROVED_PLAN !set computeInnerJoinCostAsFilter false !set debug true diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@default@NullHandling=default.iq deleted file mode 100644 index 506d51e7424a..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@default@NullHandling=default.iq +++ /dev/null @@ -1,108 +0,0 @@ -# testLeftJoinSubqueryWithSelectorFilter@default@NullHandling=default case-crc:8c5a723c -# quidem testcase reason: IMPROVED_PLAN -!set computeInnerJoinCostAsFilter false -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, l1.k -FROM foo -LEFT JOIN (select k || '' as k from lookup.lookyloo group by 1) l1 ON foo.dim1 = l1.k -WHERE l1.k = 'abc' -; -+------+-----+ -| dim1 | k | -+------+-----+ -| abc | abc | -+------+-----+ -(1 row) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, 'abc')]) - LogicalAggregate(group=[{0}]) - LogicalProject(k=[||($0, '')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, 'abc')]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(k=[||($0, '')], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "concat(\"k\",'')", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "having" : { - "type" : "filter", - "filter" : { - "type" : "selector", - "dimension" : "d0", - "value" : "abc" - }, - "finalize" : true - }, - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "j0.d0" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@filter-on-value-column_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@filter-on-value-column_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@filter-on-value-column_disabled.iq index f4dc5ee0c02e..62bf0f7a8556 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@filter-on-value-column_disabled.iq @@ -1,4 +1,4 @@ -# testLeftJoinSubqueryWithSelectorFilter@filter-on-value-column_disabled@NullHandling=sql case-crc:38fee93f +# testLeftJoinSubqueryWithSelectorFilter@filter-on-value-column_disabled case-crc:38fee93f # quidem testcase reason: IMPROVED_PLAN !set computeInnerJoinCostAsFilter false !set debug true diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index 8e3703bf9c08..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,111 +0,0 @@ -# testLeftJoinSubqueryWithSelectorFilter@filter-on-value-column_disabled@NullHandling=default case-crc:38fee93f -# quidem testcase reason: IMPROVED_PLAN -!set computeInnerJoinCostAsFilter false -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, l1.k -FROM foo -LEFT JOIN (select k || '' as k from lookup.lookyloo group by 1) l1 ON foo.dim1 = l1.k -WHERE l1.k = 'abc' -; -+------+-----+ -| dim1 | k | -+------+-----+ -| abc | abc | -+------+-----+ -(1 row) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, 'abc')]) - LogicalAggregate(group=[{0}]) - LogicalProject(k=[||($0, '')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, 'abc')]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(k=[||($0, '')], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "concat(\"k\",'')", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "having" : { - "type" : "filter", - "filter" : { - "type" : "selector", - "dimension" : "d0", - "value" : "abc" - }, - "finalize" : true - }, - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "j0.d0" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@filter-rewrites-disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@filter-rewrites-disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@filter-rewrites-disabled.iq index 6ed1d1821240..6c385c1f872e 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@filter-rewrites-disabled.iq @@ -1,4 +1,4 @@ -# testLeftJoinSubqueryWithSelectorFilter@filter-rewrites-disabled@NullHandling=sql case-crc:33b6cb8a +# testLeftJoinSubqueryWithSelectorFilter@filter-rewrites-disabled case-crc:33b6cb8a # quidem testcase reason: IMPROVED_PLAN !set computeInnerJoinCostAsFilter false !set debug true diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index 68477e65d17b..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,111 +0,0 @@ -# testLeftJoinSubqueryWithSelectorFilter@filter-rewrites-disabled@NullHandling=default case-crc:33b6cb8a -# quidem testcase reason: IMPROVED_PLAN -!set computeInnerJoinCostAsFilter false -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, l1.k -FROM foo -LEFT JOIN (select k || '' as k from lookup.lookyloo group by 1) l1 ON foo.dim1 = l1.k -WHERE l1.k = 'abc' -; -+------+-----+ -| dim1 | k | -+------+-----+ -| abc | abc | -+------+-----+ -(1 row) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, 'abc')]) - LogicalAggregate(group=[{0}]) - LogicalProject(k=[||($0, '')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, 'abc')]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(k=[||($0, '')], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "concat(\"k\",'')", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "having" : { - "type" : "filter", - "filter" : { - "type" : "selector", - "dimension" : "d0", - "value" : "abc" - }, - "finalize" : true - }, - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "j0.d0" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@filter-rewrites.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@filter-rewrites@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@filter-rewrites.iq index 0fea9905f6a4..a3dc3098cfe8 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@filter-rewrites.iq @@ -1,4 +1,4 @@ -# testLeftJoinSubqueryWithSelectorFilter@filter-rewrites@NullHandling=sql case-crc:ed35d9a4 +# testLeftJoinSubqueryWithSelectorFilter@filter-rewrites case-crc:ed35d9a4 # quidem testcase reason: IMPROVED_PLAN !set computeInnerJoinCostAsFilter false !set debug true diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index 1d5313323856..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,111 +0,0 @@ -# testLeftJoinSubqueryWithSelectorFilter@filter-rewrites@NullHandling=default case-crc:ed35d9a4 -# quidem testcase reason: IMPROVED_PLAN -!set computeInnerJoinCostAsFilter false -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, l1.k -FROM foo -LEFT JOIN (select k || '' as k from lookup.lookyloo group by 1) l1 ON foo.dim1 = l1.k -WHERE l1.k = 'abc' -; -+------+-----+ -| dim1 | k | -+------+-----+ -| abc | abc | -+------+-----+ -(1 row) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, 'abc')]) - LogicalAggregate(group=[{0}]) - LogicalProject(k=[||($0, '')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, 'abc')]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(k=[||($0, '')], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "concat(\"k\",'')", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "having" : { - "type" : "filter", - "filter" : { - "type" : "selector", - "dimension" : "d0", - "value" : "abc" - }, - "finalize" : true - }, - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "j0.d0" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@join-to-filter.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@join-to-filter@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@join-to-filter.iq index 941c40c62642..add1bba6413a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@join-to-filter.iq @@ -1,4 +1,4 @@ -# testLeftJoinSubqueryWithSelectorFilter@join-to-filter@NullHandling=sql case-crc:e929dd69 +# testLeftJoinSubqueryWithSelectorFilter@join-to-filter case-crc:e929dd69 # quidem testcase reason: IMPROVED_PLAN !set computeInnerJoinCostAsFilter false !set debug true diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@join-to-filter@NullHandling=default.iq deleted file mode 100644 index e00b99d60234..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinSubqueryWithSelectorFilter@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,111 +0,0 @@ -# testLeftJoinSubqueryWithSelectorFilter@join-to-filter@NullHandling=default case-crc:e929dd69 -# quidem testcase reason: IMPROVED_PLAN -!set computeInnerJoinCostAsFilter false -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, l1.k -FROM foo -LEFT JOIN (select k || '' as k from lookup.lookyloo group by 1) l1 ON foo.dim1 = l1.k -WHERE l1.k = 'abc' -; -+------+-----+ -| dim1 | k | -+------+-----+ -| abc | abc | -+------+-----+ -(1 row) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, 'abc')]) - LogicalAggregate(group=[{0}]) - LogicalProject(k=[||($0, '')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, 'abc')]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(k=[||($0, '')], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "concat(\"k\",'')", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "having" : { - "type" : "filter", - "filter" : { - "type" : "selector", - "dimension" : "d0", - "value" : "abc" - }, - "finalize" : true - }, - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "j0.d0" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@all_disabled.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@all_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@all_disabled.iq index d488371257f8..63556afaf8d1 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@all_disabled.iq @@ -1,4 +1,4 @@ -# testManyManyInnerJoinOnManyManyLookup@all_disabled@NullHandling=sql case-crc:90406045 +# testManyManyInnerJoinOnManyManyLookup@all_disabled case-crc:90406045 # quidem testcase reason: IMPROVED_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@all_disabled@NullHandling=default.iq deleted file mode 100644 index 224cb623af4e..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,400 +0,0 @@ -# testManyManyInnerJoinOnManyManyLookup@all_disabled@NullHandling=default case-crc:90406045 -# quidem testcase reason: IMPROVED_PLAN -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -INNER JOIN lookup.lookyloo l3 ON foo.dim2 = l3.k -INNER JOIN lookup.lookyloo l4 ON foo.dim2 = l4.k -INNER JOIN lookup.lookyloo l5 ON foo.dim2 = l5.k -INNER JOIN lookup.lookyloo l6 ON foo.dim2 = l6.k -INNER JOIN lookup.lookyloo l7 ON foo.dim2 = l7.k -INNER JOIN lookup.lookyloo l8 ON foo.dim2 = l8.k -INNER JOIN lookup.lookyloo l9 ON foo.dim2 = l9.k -INNER JOIN lookup.lookyloo l10 ON foo.dim2 = l10.k -INNER JOIN lookup.lookyloo l11 ON foo.dim2 = l11.k -INNER JOIN lookup.lookyloo l12 ON foo.dim2 = l12.k -INNER JOIN lookup.lookyloo l13 ON foo.dim2 = l13.k -INNER JOIN lookup.lookyloo l14 ON foo.dim2 = l14.k -INNER JOIN lookup.lookyloo l15 ON foo.dim2 = l15.k -INNER JOIN lookup.lookyloo l16 ON foo.dim2 = l16.k -INNER JOIN lookup.lookyloo l17 ON foo.dim2 = l17.k -INNER JOIN lookup.lookyloo l18 ON foo.dim2 = l18.k -INNER JOIN lookup.lookyloo l19 ON foo.dim2 = l19.k -WHERE l.v = 'xa' -; -+------+ -| dim1 | -+------+ -| | -| 1 | -+------+ -(2 rows) - -!ok -LogicalProject(dim1=[$0]) - LogicalJoin(condition=[=($1, $21)], joinType=[inner]) - LogicalJoin(condition=[=($1, $20)], joinType=[inner]) - LogicalJoin(condition=[=($1, $19)], joinType=[inner]) - LogicalJoin(condition=[=($1, $18)], joinType=[inner]) - LogicalJoin(condition=[=($1, $17)], joinType=[inner]) - LogicalJoin(condition=[=($1, $16)], joinType=[inner]) - LogicalJoin(condition=[=($1, $15)], joinType=[inner]) - LogicalJoin(condition=[=($1, $14)], joinType=[inner]) - LogicalJoin(condition=[=($1, $13)], joinType=[inner]) - LogicalJoin(condition=[=($1, $12)], joinType=[inner]) - LogicalJoin(condition=[=($1, $11)], joinType=[inner]) - LogicalJoin(condition=[=($1, $10)], joinType=[inner]) - LogicalJoin(condition=[=($1, $9)], joinType=[inner]) - LogicalJoin(condition=[=($1, $8)], joinType=[inner]) - LogicalJoin(condition=[=($1, $7)], joinType=[inner]) - LogicalJoin(condition=[=($1, $6)], joinType=[inner]) - LogicalJoin(condition=[=($1, $5)], joinType=[inner]) - LogicalJoin(condition=[=($1, $4)], joinType=[inner]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], druid=[logical]) - DruidJoin(condition=[=($1, $21)], joinType=[inner]) - DruidJoin(condition=[=($1, $20)], joinType=[inner]) - DruidJoin(condition=[=($1, $19)], joinType=[inner]) - DruidJoin(condition=[=($1, $18)], joinType=[inner]) - DruidJoin(condition=[=($1, $17)], joinType=[inner]) - DruidJoin(condition=[=($1, $16)], joinType=[inner]) - DruidJoin(condition=[=($1, $15)], joinType=[inner]) - DruidJoin(condition=[=($1, $14)], joinType=[inner]) - DruidJoin(condition=[=($1, $13)], joinType=[inner]) - DruidJoin(condition=[=($1, $12)], joinType=[inner]) - DruidJoin(condition=[=($1, $11)], joinType=[inner]) - DruidJoin(condition=[=($1, $10)], joinType=[inner]) - DruidJoin(condition=[=($1, $9)], joinType=[inner]) - DruidJoin(condition=[=($1, $8)], joinType=[inner]) - DruidJoin(condition=[=($1, $7)], joinType=[inner]) - DruidJoin(condition=[=($1, $6)], joinType=[inner]) - DruidJoin(condition=[=($1, $5)], joinType=[inner]) - DruidJoin(condition=[=($1, $4)], joinType=[inner]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "__j0.", - "condition" : "(\"dim2\" == \"__j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "___j0.", - "condition" : "(\"dim2\" == \"___j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "____j0.", - "condition" : "(\"dim2\" == \"____j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_____j0.", - "condition" : "(\"dim2\" == \"_____j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "______j0.", - "condition" : "(\"dim2\" == \"______j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_______j0.", - "condition" : "(\"dim2\" == \"_______j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "________j0.", - "condition" : "(\"dim2\" == \"________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_________j0.", - "condition" : "(\"dim2\" == \"_________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "__________j0.", - "condition" : "(\"dim2\" == \"__________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "___________j0.", - "condition" : "(\"dim2\" == \"___________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "____________j0.", - "condition" : "(\"dim2\" == \"____________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_____________j0.", - "condition" : "(\"dim2\" == \"_____________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "______________j0.", - "condition" : "(\"dim2\" == \"______________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_______________j0.", - "condition" : "(\"dim2\" == \"_______________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "________________j0.", - "condition" : "(\"dim2\" == \"________________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_________________j0.", - "condition" : "(\"dim2\" == \"_________________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "__________________j0.", - "condition" : "(\"dim2\" == \"__________________j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@all_enabled.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@all_enabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@all_enabled.iq index 2bdbad9010a2..9a3f6639c976 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@all_enabled.iq @@ -1,4 +1,4 @@ -# testManyManyInnerJoinOnManyManyLookup@all_enabled@NullHandling=sql case-crc:0a05a3f9 +# testManyManyInnerJoinOnManyManyLookup@all_enabled case-crc:0a05a3f9 # quidem testcase reason: IMPROVED_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@all_enabled@NullHandling=default.iq deleted file mode 100644 index 47198190548d..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,400 +0,0 @@ -# testManyManyInnerJoinOnManyManyLookup@all_enabled@NullHandling=default case-crc:0a05a3f9 -# quidem testcase reason: IMPROVED_PLAN -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -INNER JOIN lookup.lookyloo l3 ON foo.dim2 = l3.k -INNER JOIN lookup.lookyloo l4 ON foo.dim2 = l4.k -INNER JOIN lookup.lookyloo l5 ON foo.dim2 = l5.k -INNER JOIN lookup.lookyloo l6 ON foo.dim2 = l6.k -INNER JOIN lookup.lookyloo l7 ON foo.dim2 = l7.k -INNER JOIN lookup.lookyloo l8 ON foo.dim2 = l8.k -INNER JOIN lookup.lookyloo l9 ON foo.dim2 = l9.k -INNER JOIN lookup.lookyloo l10 ON foo.dim2 = l10.k -INNER JOIN lookup.lookyloo l11 ON foo.dim2 = l11.k -INNER JOIN lookup.lookyloo l12 ON foo.dim2 = l12.k -INNER JOIN lookup.lookyloo l13 ON foo.dim2 = l13.k -INNER JOIN lookup.lookyloo l14 ON foo.dim2 = l14.k -INNER JOIN lookup.lookyloo l15 ON foo.dim2 = l15.k -INNER JOIN lookup.lookyloo l16 ON foo.dim2 = l16.k -INNER JOIN lookup.lookyloo l17 ON foo.dim2 = l17.k -INNER JOIN lookup.lookyloo l18 ON foo.dim2 = l18.k -INNER JOIN lookup.lookyloo l19 ON foo.dim2 = l19.k -WHERE l.v = 'xa' -; -+------+ -| dim1 | -+------+ -| | -| 1 | -+------+ -(2 rows) - -!ok -LogicalProject(dim1=[$0]) - LogicalJoin(condition=[=($1, $21)], joinType=[inner]) - LogicalJoin(condition=[=($1, $20)], joinType=[inner]) - LogicalJoin(condition=[=($1, $19)], joinType=[inner]) - LogicalJoin(condition=[=($1, $18)], joinType=[inner]) - LogicalJoin(condition=[=($1, $17)], joinType=[inner]) - LogicalJoin(condition=[=($1, $16)], joinType=[inner]) - LogicalJoin(condition=[=($1, $15)], joinType=[inner]) - LogicalJoin(condition=[=($1, $14)], joinType=[inner]) - LogicalJoin(condition=[=($1, $13)], joinType=[inner]) - LogicalJoin(condition=[=($1, $12)], joinType=[inner]) - LogicalJoin(condition=[=($1, $11)], joinType=[inner]) - LogicalJoin(condition=[=($1, $10)], joinType=[inner]) - LogicalJoin(condition=[=($1, $9)], joinType=[inner]) - LogicalJoin(condition=[=($1, $8)], joinType=[inner]) - LogicalJoin(condition=[=($1, $7)], joinType=[inner]) - LogicalJoin(condition=[=($1, $6)], joinType=[inner]) - LogicalJoin(condition=[=($1, $5)], joinType=[inner]) - LogicalJoin(condition=[=($1, $4)], joinType=[inner]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], druid=[logical]) - DruidJoin(condition=[=($1, $21)], joinType=[inner]) - DruidJoin(condition=[=($1, $20)], joinType=[inner]) - DruidJoin(condition=[=($1, $19)], joinType=[inner]) - DruidJoin(condition=[=($1, $18)], joinType=[inner]) - DruidJoin(condition=[=($1, $17)], joinType=[inner]) - DruidJoin(condition=[=($1, $16)], joinType=[inner]) - DruidJoin(condition=[=($1, $15)], joinType=[inner]) - DruidJoin(condition=[=($1, $14)], joinType=[inner]) - DruidJoin(condition=[=($1, $13)], joinType=[inner]) - DruidJoin(condition=[=($1, $12)], joinType=[inner]) - DruidJoin(condition=[=($1, $11)], joinType=[inner]) - DruidJoin(condition=[=($1, $10)], joinType=[inner]) - DruidJoin(condition=[=($1, $9)], joinType=[inner]) - DruidJoin(condition=[=($1, $8)], joinType=[inner]) - DruidJoin(condition=[=($1, $7)], joinType=[inner]) - DruidJoin(condition=[=($1, $6)], joinType=[inner]) - DruidJoin(condition=[=($1, $5)], joinType=[inner]) - DruidJoin(condition=[=($1, $4)], joinType=[inner]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "__j0.", - "condition" : "(\"dim2\" == \"__j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "___j0.", - "condition" : "(\"dim2\" == \"___j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "____j0.", - "condition" : "(\"dim2\" == \"____j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_____j0.", - "condition" : "(\"dim2\" == \"_____j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "______j0.", - "condition" : "(\"dim2\" == \"______j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_______j0.", - "condition" : "(\"dim2\" == \"_______j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "________j0.", - "condition" : "(\"dim2\" == \"________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_________j0.", - "condition" : "(\"dim2\" == \"_________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "__________j0.", - "condition" : "(\"dim2\" == \"__________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "___________j0.", - "condition" : "(\"dim2\" == \"___________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "____________j0.", - "condition" : "(\"dim2\" == \"____________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_____________j0.", - "condition" : "(\"dim2\" == \"_____________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "______________j0.", - "condition" : "(\"dim2\" == \"______________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_______________j0.", - "condition" : "(\"dim2\" == \"_______________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "________________j0.", - "condition" : "(\"dim2\" == \"________________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_________________j0.", - "condition" : "(\"dim2\" == \"_________________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "__________________j0.", - "condition" : "(\"dim2\" == \"__________________j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@default.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@default@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@default.iq index 418c0e1284e5..7aaaa1929e47 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@default.iq @@ -1,4 +1,4 @@ -# testManyManyInnerJoinOnManyManyLookup@default@NullHandling=sql case-crc:224906b6 +# testManyManyInnerJoinOnManyManyLookup@default case-crc:224906b6 # quidem testcase reason: IMPROVED_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@default@NullHandling=default.iq deleted file mode 100644 index 17cdfa0724e0..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@default@NullHandling=default.iq +++ /dev/null @@ -1,397 +0,0 @@ -# testManyManyInnerJoinOnManyManyLookup@default@NullHandling=default case-crc:224906b6 -# quidem testcase reason: IMPROVED_PLAN -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -INNER JOIN lookup.lookyloo l3 ON foo.dim2 = l3.k -INNER JOIN lookup.lookyloo l4 ON foo.dim2 = l4.k -INNER JOIN lookup.lookyloo l5 ON foo.dim2 = l5.k -INNER JOIN lookup.lookyloo l6 ON foo.dim2 = l6.k -INNER JOIN lookup.lookyloo l7 ON foo.dim2 = l7.k -INNER JOIN lookup.lookyloo l8 ON foo.dim2 = l8.k -INNER JOIN lookup.lookyloo l9 ON foo.dim2 = l9.k -INNER JOIN lookup.lookyloo l10 ON foo.dim2 = l10.k -INNER JOIN lookup.lookyloo l11 ON foo.dim2 = l11.k -INNER JOIN lookup.lookyloo l12 ON foo.dim2 = l12.k -INNER JOIN lookup.lookyloo l13 ON foo.dim2 = l13.k -INNER JOIN lookup.lookyloo l14 ON foo.dim2 = l14.k -INNER JOIN lookup.lookyloo l15 ON foo.dim2 = l15.k -INNER JOIN lookup.lookyloo l16 ON foo.dim2 = l16.k -INNER JOIN lookup.lookyloo l17 ON foo.dim2 = l17.k -INNER JOIN lookup.lookyloo l18 ON foo.dim2 = l18.k -INNER JOIN lookup.lookyloo l19 ON foo.dim2 = l19.k -WHERE l.v = 'xa' -; -+------+ -| dim1 | -+------+ -| | -| 1 | -+------+ -(2 rows) - -!ok -LogicalProject(dim1=[$0]) - LogicalJoin(condition=[=($1, $21)], joinType=[inner]) - LogicalJoin(condition=[=($1, $20)], joinType=[inner]) - LogicalJoin(condition=[=($1, $19)], joinType=[inner]) - LogicalJoin(condition=[=($1, $18)], joinType=[inner]) - LogicalJoin(condition=[=($1, $17)], joinType=[inner]) - LogicalJoin(condition=[=($1, $16)], joinType=[inner]) - LogicalJoin(condition=[=($1, $15)], joinType=[inner]) - LogicalJoin(condition=[=($1, $14)], joinType=[inner]) - LogicalJoin(condition=[=($1, $13)], joinType=[inner]) - LogicalJoin(condition=[=($1, $12)], joinType=[inner]) - LogicalJoin(condition=[=($1, $11)], joinType=[inner]) - LogicalJoin(condition=[=($1, $10)], joinType=[inner]) - LogicalJoin(condition=[=($1, $9)], joinType=[inner]) - LogicalJoin(condition=[=($1, $8)], joinType=[inner]) - LogicalJoin(condition=[=($1, $7)], joinType=[inner]) - LogicalJoin(condition=[=($1, $6)], joinType=[inner]) - LogicalJoin(condition=[=($1, $5)], joinType=[inner]) - LogicalJoin(condition=[=($1, $4)], joinType=[inner]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], druid=[logical]) - DruidJoin(condition=[=($1, $21)], joinType=[inner]) - DruidJoin(condition=[=($1, $20)], joinType=[inner]) - DruidJoin(condition=[=($1, $19)], joinType=[inner]) - DruidJoin(condition=[=($1, $18)], joinType=[inner]) - DruidJoin(condition=[=($1, $17)], joinType=[inner]) - DruidJoin(condition=[=($1, $16)], joinType=[inner]) - DruidJoin(condition=[=($1, $15)], joinType=[inner]) - DruidJoin(condition=[=($1, $14)], joinType=[inner]) - DruidJoin(condition=[=($1, $13)], joinType=[inner]) - DruidJoin(condition=[=($1, $12)], joinType=[inner]) - DruidJoin(condition=[=($1, $11)], joinType=[inner]) - DruidJoin(condition=[=($1, $10)], joinType=[inner]) - DruidJoin(condition=[=($1, $9)], joinType=[inner]) - DruidJoin(condition=[=($1, $8)], joinType=[inner]) - DruidJoin(condition=[=($1, $7)], joinType=[inner]) - DruidJoin(condition=[=($1, $6)], joinType=[inner]) - DruidJoin(condition=[=($1, $5)], joinType=[inner]) - DruidJoin(condition=[=($1, $4)], joinType=[inner]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "__j0.", - "condition" : "(\"dim2\" == \"__j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "___j0.", - "condition" : "(\"dim2\" == \"___j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "____j0.", - "condition" : "(\"dim2\" == \"____j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_____j0.", - "condition" : "(\"dim2\" == \"_____j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "______j0.", - "condition" : "(\"dim2\" == \"______j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_______j0.", - "condition" : "(\"dim2\" == \"_______j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "________j0.", - "condition" : "(\"dim2\" == \"________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_________j0.", - "condition" : "(\"dim2\" == \"_________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "__________j0.", - "condition" : "(\"dim2\" == \"__________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "___________j0.", - "condition" : "(\"dim2\" == \"___________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "____________j0.", - "condition" : "(\"dim2\" == \"____________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_____________j0.", - "condition" : "(\"dim2\" == \"_____________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "______________j0.", - "condition" : "(\"dim2\" == \"______________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_______________j0.", - "condition" : "(\"dim2\" == \"_______________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "________________j0.", - "condition" : "(\"dim2\" == \"________________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_________________j0.", - "condition" : "(\"dim2\" == \"_________________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "__________________j0.", - "condition" : "(\"dim2\" == \"__________________j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@filter-on-value-column_disabled.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@filter-on-value-column_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@filter-on-value-column_disabled.iq index 82771dab5b3c..428953ccfbb9 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@filter-on-value-column_disabled.iq @@ -1,4 +1,4 @@ -# testManyManyInnerJoinOnManyManyLookup@filter-on-value-column_disabled@NullHandling=sql case-crc:8cedc32c +# testManyManyInnerJoinOnManyManyLookup@filter-on-value-column_disabled case-crc:8cedc32c # quidem testcase reason: IMPROVED_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index 6733c2ac769b..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,400 +0,0 @@ -# testManyManyInnerJoinOnManyManyLookup@filter-on-value-column_disabled@NullHandling=default case-crc:8cedc32c -# quidem testcase reason: IMPROVED_PLAN -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -INNER JOIN lookup.lookyloo l3 ON foo.dim2 = l3.k -INNER JOIN lookup.lookyloo l4 ON foo.dim2 = l4.k -INNER JOIN lookup.lookyloo l5 ON foo.dim2 = l5.k -INNER JOIN lookup.lookyloo l6 ON foo.dim2 = l6.k -INNER JOIN lookup.lookyloo l7 ON foo.dim2 = l7.k -INNER JOIN lookup.lookyloo l8 ON foo.dim2 = l8.k -INNER JOIN lookup.lookyloo l9 ON foo.dim2 = l9.k -INNER JOIN lookup.lookyloo l10 ON foo.dim2 = l10.k -INNER JOIN lookup.lookyloo l11 ON foo.dim2 = l11.k -INNER JOIN lookup.lookyloo l12 ON foo.dim2 = l12.k -INNER JOIN lookup.lookyloo l13 ON foo.dim2 = l13.k -INNER JOIN lookup.lookyloo l14 ON foo.dim2 = l14.k -INNER JOIN lookup.lookyloo l15 ON foo.dim2 = l15.k -INNER JOIN lookup.lookyloo l16 ON foo.dim2 = l16.k -INNER JOIN lookup.lookyloo l17 ON foo.dim2 = l17.k -INNER JOIN lookup.lookyloo l18 ON foo.dim2 = l18.k -INNER JOIN lookup.lookyloo l19 ON foo.dim2 = l19.k -WHERE l.v = 'xa' -; -+------+ -| dim1 | -+------+ -| | -| 1 | -+------+ -(2 rows) - -!ok -LogicalProject(dim1=[$0]) - LogicalJoin(condition=[=($1, $21)], joinType=[inner]) - LogicalJoin(condition=[=($1, $20)], joinType=[inner]) - LogicalJoin(condition=[=($1, $19)], joinType=[inner]) - LogicalJoin(condition=[=($1, $18)], joinType=[inner]) - LogicalJoin(condition=[=($1, $17)], joinType=[inner]) - LogicalJoin(condition=[=($1, $16)], joinType=[inner]) - LogicalJoin(condition=[=($1, $15)], joinType=[inner]) - LogicalJoin(condition=[=($1, $14)], joinType=[inner]) - LogicalJoin(condition=[=($1, $13)], joinType=[inner]) - LogicalJoin(condition=[=($1, $12)], joinType=[inner]) - LogicalJoin(condition=[=($1, $11)], joinType=[inner]) - LogicalJoin(condition=[=($1, $10)], joinType=[inner]) - LogicalJoin(condition=[=($1, $9)], joinType=[inner]) - LogicalJoin(condition=[=($1, $8)], joinType=[inner]) - LogicalJoin(condition=[=($1, $7)], joinType=[inner]) - LogicalJoin(condition=[=($1, $6)], joinType=[inner]) - LogicalJoin(condition=[=($1, $5)], joinType=[inner]) - LogicalJoin(condition=[=($1, $4)], joinType=[inner]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], druid=[logical]) - DruidJoin(condition=[=($1, $21)], joinType=[inner]) - DruidJoin(condition=[=($1, $20)], joinType=[inner]) - DruidJoin(condition=[=($1, $19)], joinType=[inner]) - DruidJoin(condition=[=($1, $18)], joinType=[inner]) - DruidJoin(condition=[=($1, $17)], joinType=[inner]) - DruidJoin(condition=[=($1, $16)], joinType=[inner]) - DruidJoin(condition=[=($1, $15)], joinType=[inner]) - DruidJoin(condition=[=($1, $14)], joinType=[inner]) - DruidJoin(condition=[=($1, $13)], joinType=[inner]) - DruidJoin(condition=[=($1, $12)], joinType=[inner]) - DruidJoin(condition=[=($1, $11)], joinType=[inner]) - DruidJoin(condition=[=($1, $10)], joinType=[inner]) - DruidJoin(condition=[=($1, $9)], joinType=[inner]) - DruidJoin(condition=[=($1, $8)], joinType=[inner]) - DruidJoin(condition=[=($1, $7)], joinType=[inner]) - DruidJoin(condition=[=($1, $6)], joinType=[inner]) - DruidJoin(condition=[=($1, $5)], joinType=[inner]) - DruidJoin(condition=[=($1, $4)], joinType=[inner]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "__j0.", - "condition" : "(\"dim2\" == \"__j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "___j0.", - "condition" : "(\"dim2\" == \"___j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "____j0.", - "condition" : "(\"dim2\" == \"____j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_____j0.", - "condition" : "(\"dim2\" == \"_____j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "______j0.", - "condition" : "(\"dim2\" == \"______j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_______j0.", - "condition" : "(\"dim2\" == \"_______j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "________j0.", - "condition" : "(\"dim2\" == \"________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_________j0.", - "condition" : "(\"dim2\" == \"_________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "__________j0.", - "condition" : "(\"dim2\" == \"__________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "___________j0.", - "condition" : "(\"dim2\" == \"___________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "____________j0.", - "condition" : "(\"dim2\" == \"____________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_____________j0.", - "condition" : "(\"dim2\" == \"_____________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "______________j0.", - "condition" : "(\"dim2\" == \"______________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_______________j0.", - "condition" : "(\"dim2\" == \"_______________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "________________j0.", - "condition" : "(\"dim2\" == \"________________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_________________j0.", - "condition" : "(\"dim2\" == \"_________________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "__________________j0.", - "condition" : "(\"dim2\" == \"__________________j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@filter-rewrites-disabled.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@filter-rewrites-disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@filter-rewrites-disabled.iq index 61fcca711b1c..7eae71ea0fee 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@filter-rewrites-disabled.iq @@ -1,4 +1,4 @@ -# testManyManyInnerJoinOnManyManyLookup@filter-rewrites-disabled@NullHandling=sql case-crc:f53f1b71 +# testManyManyInnerJoinOnManyManyLookup@filter-rewrites-disabled case-crc:f53f1b71 # quidem testcase reason: IMPROVED_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index 7c6b9a51056b..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,400 +0,0 @@ -# testManyManyInnerJoinOnManyManyLookup@filter-rewrites-disabled@NullHandling=default case-crc:f53f1b71 -# quidem testcase reason: IMPROVED_PLAN -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -INNER JOIN lookup.lookyloo l3 ON foo.dim2 = l3.k -INNER JOIN lookup.lookyloo l4 ON foo.dim2 = l4.k -INNER JOIN lookup.lookyloo l5 ON foo.dim2 = l5.k -INNER JOIN lookup.lookyloo l6 ON foo.dim2 = l6.k -INNER JOIN lookup.lookyloo l7 ON foo.dim2 = l7.k -INNER JOIN lookup.lookyloo l8 ON foo.dim2 = l8.k -INNER JOIN lookup.lookyloo l9 ON foo.dim2 = l9.k -INNER JOIN lookup.lookyloo l10 ON foo.dim2 = l10.k -INNER JOIN lookup.lookyloo l11 ON foo.dim2 = l11.k -INNER JOIN lookup.lookyloo l12 ON foo.dim2 = l12.k -INNER JOIN lookup.lookyloo l13 ON foo.dim2 = l13.k -INNER JOIN lookup.lookyloo l14 ON foo.dim2 = l14.k -INNER JOIN lookup.lookyloo l15 ON foo.dim2 = l15.k -INNER JOIN lookup.lookyloo l16 ON foo.dim2 = l16.k -INNER JOIN lookup.lookyloo l17 ON foo.dim2 = l17.k -INNER JOIN lookup.lookyloo l18 ON foo.dim2 = l18.k -INNER JOIN lookup.lookyloo l19 ON foo.dim2 = l19.k -WHERE l.v = 'xa' -; -+------+ -| dim1 | -+------+ -| | -| 1 | -+------+ -(2 rows) - -!ok -LogicalProject(dim1=[$0]) - LogicalJoin(condition=[=($1, $21)], joinType=[inner]) - LogicalJoin(condition=[=($1, $20)], joinType=[inner]) - LogicalJoin(condition=[=($1, $19)], joinType=[inner]) - LogicalJoin(condition=[=($1, $18)], joinType=[inner]) - LogicalJoin(condition=[=($1, $17)], joinType=[inner]) - LogicalJoin(condition=[=($1, $16)], joinType=[inner]) - LogicalJoin(condition=[=($1, $15)], joinType=[inner]) - LogicalJoin(condition=[=($1, $14)], joinType=[inner]) - LogicalJoin(condition=[=($1, $13)], joinType=[inner]) - LogicalJoin(condition=[=($1, $12)], joinType=[inner]) - LogicalJoin(condition=[=($1, $11)], joinType=[inner]) - LogicalJoin(condition=[=($1, $10)], joinType=[inner]) - LogicalJoin(condition=[=($1, $9)], joinType=[inner]) - LogicalJoin(condition=[=($1, $8)], joinType=[inner]) - LogicalJoin(condition=[=($1, $7)], joinType=[inner]) - LogicalJoin(condition=[=($1, $6)], joinType=[inner]) - LogicalJoin(condition=[=($1, $5)], joinType=[inner]) - LogicalJoin(condition=[=($1, $4)], joinType=[inner]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], druid=[logical]) - DruidJoin(condition=[=($1, $21)], joinType=[inner]) - DruidJoin(condition=[=($1, $20)], joinType=[inner]) - DruidJoin(condition=[=($1, $19)], joinType=[inner]) - DruidJoin(condition=[=($1, $18)], joinType=[inner]) - DruidJoin(condition=[=($1, $17)], joinType=[inner]) - DruidJoin(condition=[=($1, $16)], joinType=[inner]) - DruidJoin(condition=[=($1, $15)], joinType=[inner]) - DruidJoin(condition=[=($1, $14)], joinType=[inner]) - DruidJoin(condition=[=($1, $13)], joinType=[inner]) - DruidJoin(condition=[=($1, $12)], joinType=[inner]) - DruidJoin(condition=[=($1, $11)], joinType=[inner]) - DruidJoin(condition=[=($1, $10)], joinType=[inner]) - DruidJoin(condition=[=($1, $9)], joinType=[inner]) - DruidJoin(condition=[=($1, $8)], joinType=[inner]) - DruidJoin(condition=[=($1, $7)], joinType=[inner]) - DruidJoin(condition=[=($1, $6)], joinType=[inner]) - DruidJoin(condition=[=($1, $5)], joinType=[inner]) - DruidJoin(condition=[=($1, $4)], joinType=[inner]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "__j0.", - "condition" : "(\"dim2\" == \"__j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "___j0.", - "condition" : "(\"dim2\" == \"___j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "____j0.", - "condition" : "(\"dim2\" == \"____j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_____j0.", - "condition" : "(\"dim2\" == \"_____j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "______j0.", - "condition" : "(\"dim2\" == \"______j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_______j0.", - "condition" : "(\"dim2\" == \"_______j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "________j0.", - "condition" : "(\"dim2\" == \"________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_________j0.", - "condition" : "(\"dim2\" == \"_________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "__________j0.", - "condition" : "(\"dim2\" == \"__________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "___________j0.", - "condition" : "(\"dim2\" == \"___________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "____________j0.", - "condition" : "(\"dim2\" == \"____________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_____________j0.", - "condition" : "(\"dim2\" == \"_____________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "______________j0.", - "condition" : "(\"dim2\" == \"______________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_______________j0.", - "condition" : "(\"dim2\" == \"_______________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "________________j0.", - "condition" : "(\"dim2\" == \"________________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_________________j0.", - "condition" : "(\"dim2\" == \"_________________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "__________________j0.", - "condition" : "(\"dim2\" == \"__________________j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@filter-rewrites.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@filter-rewrites@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@filter-rewrites.iq index 98b553956178..2a38b0b4862d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@filter-rewrites.iq @@ -1,4 +1,4 @@ -# testManyManyInnerJoinOnManyManyLookup@filter-rewrites@NullHandling=sql case-crc:15aa4614 +# testManyManyInnerJoinOnManyManyLookup@filter-rewrites case-crc:15aa4614 # quidem testcase reason: IMPROVED_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index 6aa0ab84ef43..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,400 +0,0 @@ -# testManyManyInnerJoinOnManyManyLookup@filter-rewrites@NullHandling=default case-crc:15aa4614 -# quidem testcase reason: IMPROVED_PLAN -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -INNER JOIN lookup.lookyloo l3 ON foo.dim2 = l3.k -INNER JOIN lookup.lookyloo l4 ON foo.dim2 = l4.k -INNER JOIN lookup.lookyloo l5 ON foo.dim2 = l5.k -INNER JOIN lookup.lookyloo l6 ON foo.dim2 = l6.k -INNER JOIN lookup.lookyloo l7 ON foo.dim2 = l7.k -INNER JOIN lookup.lookyloo l8 ON foo.dim2 = l8.k -INNER JOIN lookup.lookyloo l9 ON foo.dim2 = l9.k -INNER JOIN lookup.lookyloo l10 ON foo.dim2 = l10.k -INNER JOIN lookup.lookyloo l11 ON foo.dim2 = l11.k -INNER JOIN lookup.lookyloo l12 ON foo.dim2 = l12.k -INNER JOIN lookup.lookyloo l13 ON foo.dim2 = l13.k -INNER JOIN lookup.lookyloo l14 ON foo.dim2 = l14.k -INNER JOIN lookup.lookyloo l15 ON foo.dim2 = l15.k -INNER JOIN lookup.lookyloo l16 ON foo.dim2 = l16.k -INNER JOIN lookup.lookyloo l17 ON foo.dim2 = l17.k -INNER JOIN lookup.lookyloo l18 ON foo.dim2 = l18.k -INNER JOIN lookup.lookyloo l19 ON foo.dim2 = l19.k -WHERE l.v = 'xa' -; -+------+ -| dim1 | -+------+ -| | -| 1 | -+------+ -(2 rows) - -!ok -LogicalProject(dim1=[$0]) - LogicalJoin(condition=[=($1, $21)], joinType=[inner]) - LogicalJoin(condition=[=($1, $20)], joinType=[inner]) - LogicalJoin(condition=[=($1, $19)], joinType=[inner]) - LogicalJoin(condition=[=($1, $18)], joinType=[inner]) - LogicalJoin(condition=[=($1, $17)], joinType=[inner]) - LogicalJoin(condition=[=($1, $16)], joinType=[inner]) - LogicalJoin(condition=[=($1, $15)], joinType=[inner]) - LogicalJoin(condition=[=($1, $14)], joinType=[inner]) - LogicalJoin(condition=[=($1, $13)], joinType=[inner]) - LogicalJoin(condition=[=($1, $12)], joinType=[inner]) - LogicalJoin(condition=[=($1, $11)], joinType=[inner]) - LogicalJoin(condition=[=($1, $10)], joinType=[inner]) - LogicalJoin(condition=[=($1, $9)], joinType=[inner]) - LogicalJoin(condition=[=($1, $8)], joinType=[inner]) - LogicalJoin(condition=[=($1, $7)], joinType=[inner]) - LogicalJoin(condition=[=($1, $6)], joinType=[inner]) - LogicalJoin(condition=[=($1, $5)], joinType=[inner]) - LogicalJoin(condition=[=($1, $4)], joinType=[inner]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], druid=[logical]) - DruidJoin(condition=[=($1, $21)], joinType=[inner]) - DruidJoin(condition=[=($1, $20)], joinType=[inner]) - DruidJoin(condition=[=($1, $19)], joinType=[inner]) - DruidJoin(condition=[=($1, $18)], joinType=[inner]) - DruidJoin(condition=[=($1, $17)], joinType=[inner]) - DruidJoin(condition=[=($1, $16)], joinType=[inner]) - DruidJoin(condition=[=($1, $15)], joinType=[inner]) - DruidJoin(condition=[=($1, $14)], joinType=[inner]) - DruidJoin(condition=[=($1, $13)], joinType=[inner]) - DruidJoin(condition=[=($1, $12)], joinType=[inner]) - DruidJoin(condition=[=($1, $11)], joinType=[inner]) - DruidJoin(condition=[=($1, $10)], joinType=[inner]) - DruidJoin(condition=[=($1, $9)], joinType=[inner]) - DruidJoin(condition=[=($1, $8)], joinType=[inner]) - DruidJoin(condition=[=($1, $7)], joinType=[inner]) - DruidJoin(condition=[=($1, $6)], joinType=[inner]) - DruidJoin(condition=[=($1, $5)], joinType=[inner]) - DruidJoin(condition=[=($1, $4)], joinType=[inner]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "__j0.", - "condition" : "(\"dim2\" == \"__j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "___j0.", - "condition" : "(\"dim2\" == \"___j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "____j0.", - "condition" : "(\"dim2\" == \"____j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_____j0.", - "condition" : "(\"dim2\" == \"_____j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "______j0.", - "condition" : "(\"dim2\" == \"______j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_______j0.", - "condition" : "(\"dim2\" == \"_______j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "________j0.", - "condition" : "(\"dim2\" == \"________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_________j0.", - "condition" : "(\"dim2\" == \"_________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "__________j0.", - "condition" : "(\"dim2\" == \"__________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "___________j0.", - "condition" : "(\"dim2\" == \"___________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "____________j0.", - "condition" : "(\"dim2\" == \"____________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_____________j0.", - "condition" : "(\"dim2\" == \"_____________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "______________j0.", - "condition" : "(\"dim2\" == \"______________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_______________j0.", - "condition" : "(\"dim2\" == \"_______________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "________________j0.", - "condition" : "(\"dim2\" == \"________________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_________________j0.", - "condition" : "(\"dim2\" == \"_________________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "__________________j0.", - "condition" : "(\"dim2\" == \"__________________j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@join-to-filter.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@join-to-filter@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@join-to-filter.iq index b3356f563e9a..46ec8fa25ae5 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@join-to-filter.iq @@ -1,4 +1,4 @@ -# testManyManyInnerJoinOnManyManyLookup@join-to-filter@NullHandling=sql case-crc:3bba4901 +# testManyManyInnerJoinOnManyManyLookup@join-to-filter case-crc:3bba4901 # quidem testcase reason: IMPROVED_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@join-to-filter@NullHandling=default.iq deleted file mode 100644 index 4fbb4d55fdb7..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testManyManyInnerJoinOnManyManyLookup@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,400 +0,0 @@ -# testManyManyInnerJoinOnManyManyLookup@join-to-filter@NullHandling=default case-crc:3bba4901 -# quidem testcase reason: IMPROVED_PLAN -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1 -FROM foo -INNER JOIN lookup.lookyloo l ON foo.dim2 = l.k -INNER JOIN lookup.lookyloo l2 ON foo.dim2 = l2.k -INNER JOIN lookup.lookyloo l3 ON foo.dim2 = l3.k -INNER JOIN lookup.lookyloo l4 ON foo.dim2 = l4.k -INNER JOIN lookup.lookyloo l5 ON foo.dim2 = l5.k -INNER JOIN lookup.lookyloo l6 ON foo.dim2 = l6.k -INNER JOIN lookup.lookyloo l7 ON foo.dim2 = l7.k -INNER JOIN lookup.lookyloo l8 ON foo.dim2 = l8.k -INNER JOIN lookup.lookyloo l9 ON foo.dim2 = l9.k -INNER JOIN lookup.lookyloo l10 ON foo.dim2 = l10.k -INNER JOIN lookup.lookyloo l11 ON foo.dim2 = l11.k -INNER JOIN lookup.lookyloo l12 ON foo.dim2 = l12.k -INNER JOIN lookup.lookyloo l13 ON foo.dim2 = l13.k -INNER JOIN lookup.lookyloo l14 ON foo.dim2 = l14.k -INNER JOIN lookup.lookyloo l15 ON foo.dim2 = l15.k -INNER JOIN lookup.lookyloo l16 ON foo.dim2 = l16.k -INNER JOIN lookup.lookyloo l17 ON foo.dim2 = l17.k -INNER JOIN lookup.lookyloo l18 ON foo.dim2 = l18.k -INNER JOIN lookup.lookyloo l19 ON foo.dim2 = l19.k -WHERE l.v = 'xa' -; -+------+ -| dim1 | -+------+ -| | -| 1 | -+------+ -(2 rows) - -!ok -LogicalProject(dim1=[$0]) - LogicalJoin(condition=[=($1, $21)], joinType=[inner]) - LogicalJoin(condition=[=($1, $20)], joinType=[inner]) - LogicalJoin(condition=[=($1, $19)], joinType=[inner]) - LogicalJoin(condition=[=($1, $18)], joinType=[inner]) - LogicalJoin(condition=[=($1, $17)], joinType=[inner]) - LogicalJoin(condition=[=($1, $16)], joinType=[inner]) - LogicalJoin(condition=[=($1, $15)], joinType=[inner]) - LogicalJoin(condition=[=($1, $14)], joinType=[inner]) - LogicalJoin(condition=[=($1, $13)], joinType=[inner]) - LogicalJoin(condition=[=($1, $12)], joinType=[inner]) - LogicalJoin(condition=[=($1, $11)], joinType=[inner]) - LogicalJoin(condition=[=($1, $10)], joinType=[inner]) - LogicalJoin(condition=[=($1, $9)], joinType=[inner]) - LogicalJoin(condition=[=($1, $8)], joinType=[inner]) - LogicalJoin(condition=[=($1, $7)], joinType=[inner]) - LogicalJoin(condition=[=($1, $6)], joinType=[inner]) - LogicalJoin(condition=[=($1, $5)], joinType=[inner]) - LogicalJoin(condition=[=($1, $4)], joinType=[inner]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($1, 'xa')]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalProject(k=[$0]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], druid=[logical]) - DruidJoin(condition=[=($1, $21)], joinType=[inner]) - DruidJoin(condition=[=($1, $20)], joinType=[inner]) - DruidJoin(condition=[=($1, $19)], joinType=[inner]) - DruidJoin(condition=[=($1, $18)], joinType=[inner]) - DruidJoin(condition=[=($1, $17)], joinType=[inner]) - DruidJoin(condition=[=($1, $16)], joinType=[inner]) - DruidJoin(condition=[=($1, $15)], joinType=[inner]) - DruidJoin(condition=[=($1, $14)], joinType=[inner]) - DruidJoin(condition=[=($1, $13)], joinType=[inner]) - DruidJoin(condition=[=($1, $12)], joinType=[inner]) - DruidJoin(condition=[=($1, $11)], joinType=[inner]) - DruidJoin(condition=[=($1, $10)], joinType=[inner]) - DruidJoin(condition=[=($1, $9)], joinType=[inner]) - DruidJoin(condition=[=($1, $8)], joinType=[inner]) - DruidJoin(condition=[=($1, $7)], joinType=[inner]) - DruidJoin(condition=[=($1, $6)], joinType=[inner]) - DruidJoin(condition=[=($1, $5)], joinType=[inner]) - DruidJoin(condition=[=($1, $4)], joinType=[inner]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($1, 'xa')]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidProject(k=[$0], druid=[logical]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "v", - "value" : "xa" - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_j0.", - "condition" : "(\"dim2\" == \"_j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "__j0.", - "condition" : "(\"dim2\" == \"__j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "___j0.", - "condition" : "(\"dim2\" == \"___j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "____j0.", - "condition" : "(\"dim2\" == \"____j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_____j0.", - "condition" : "(\"dim2\" == \"_____j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "______j0.", - "condition" : "(\"dim2\" == \"______j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_______j0.", - "condition" : "(\"dim2\" == \"_______j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "________j0.", - "condition" : "(\"dim2\" == \"________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_________j0.", - "condition" : "(\"dim2\" == \"_________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "__________j0.", - "condition" : "(\"dim2\" == \"__________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "___________j0.", - "condition" : "(\"dim2\" == \"___________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "____________j0.", - "condition" : "(\"dim2\" == \"____________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_____________j0.", - "condition" : "(\"dim2\" == \"_____________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "______________j0.", - "condition" : "(\"dim2\" == \"______________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_______________j0.", - "condition" : "(\"dim2\" == \"_______________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "________________j0.", - "condition" : "(\"dim2\" == \"________________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "_________________j0.", - "condition" : "(\"dim2\" == \"_________________j0.k\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "__________________j0.", - "condition" : "(\"dim2\" == \"__________________j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_disabled.iq index f10f8b5da377..afae04387859 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_disabled.iq @@ -1,4 +1,4 @@ -# testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=sql case-crc:cac513c5 +# testNestedGroupByOnInlineDataSourceWithFilter@all_disabled case-crc:cac513c5 # quidem testcase reason: SCAN_QUERY_ON_FILTERED_DS_DOING_FILTERING !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=default.iq deleted file mode 100644 index 20ec2ea73667..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,159 +0,0 @@ -# testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=default case-crc:cac513c5 -# quidem testcase reason: SCAN_QUERY_ON_FILTERED_DS_DOING_FILTERING -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as( SELECT dim1, m2 from druid.foo where "__time" >= '2001-01-02'), def as( SELECT t1.dim1, SUM(t2.m2) as "metricSum" from abc as t1 inner join abc as t2 on t1.dim1 = t2.dim1 where t1.dim1='def' group by 1)SELECT count(*) from def; -+--------+ -| EXPR$0 | -+--------+ -| 1 | -+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) - LogicalAggregate(group=[{0}]) - LogicalProject(dim1=[CAST('def':VARCHAR):VARCHAR]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalFilter(condition=[=($0, 'def')]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1], m2=[$6]) - LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(dim1=[CAST('def':VARCHAR):VARCHAR], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidFilter(condition=[=($0, 'def')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], m2=[$6], druid=[logical]) - DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "filter", - "base" : { - "type" : "table", - "name" : "foo" - }, - "filter" : { - "type" : "bound", - "dimension" : "__time", - "lower" : "978393600000", - "ordering" : { - "type" : "numeric" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "def" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "m2" ], - "columnTypes" : [ "STRING", "DOUBLE" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'def'", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_enabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_enabled.iq index a908f72f7db9..c4f0057cd73b 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_enabled.iq @@ -1,4 +1,4 @@ -# testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=sql case-crc:5eacffa7 +# testNestedGroupByOnInlineDataSourceWithFilter@all_enabled case-crc:5eacffa7 # quidem testcase reason: SCAN_QUERY_ON_FILTERED_DS_DOING_FILTERING !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=default.iq deleted file mode 100644 index 0b39259a86c4..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,159 +0,0 @@ -# testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=default case-crc:5eacffa7 -# quidem testcase reason: SCAN_QUERY_ON_FILTERED_DS_DOING_FILTERING -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as( SELECT dim1, m2 from druid.foo where "__time" >= '2001-01-02'), def as( SELECT t1.dim1, SUM(t2.m2) as "metricSum" from abc as t1 inner join abc as t2 on t1.dim1 = t2.dim1 where t1.dim1='def' group by 1)SELECT count(*) from def; -+--------+ -| EXPR$0 | -+--------+ -| 1 | -+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) - LogicalAggregate(group=[{0}]) - LogicalProject(dim1=[CAST('def':VARCHAR):VARCHAR]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalFilter(condition=[=($0, 'def')]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1], m2=[$6]) - LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(dim1=[CAST('def':VARCHAR):VARCHAR], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidFilter(condition=[=($0, 'def')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], m2=[$6], druid=[logical]) - DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "filter", - "base" : { - "type" : "table", - "name" : "foo" - }, - "filter" : { - "type" : "bound", - "dimension" : "__time", - "lower" : "978393600000", - "ordering" : { - "type" : "numeric" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "def" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "m2" ], - "columnTypes" : [ "STRING", "DOUBLE" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'def'", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@default.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@default.iq index 90488aa3e3bf..5e3db79d0fd3 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@default.iq @@ -1,4 +1,4 @@ -# testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=sql case-crc:35936266 +# testNestedGroupByOnInlineDataSourceWithFilter@default case-crc:35936266 # quidem testcase reason: SCAN_QUERY_ON_FILTERED_DS_DOING_FILTERING !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=default.iq deleted file mode 100644 index d9d6187ebef8..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=default.iq +++ /dev/null @@ -1,156 +0,0 @@ -# testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=default case-crc:35936266 -# quidem testcase reason: SCAN_QUERY_ON_FILTERED_DS_DOING_FILTERING -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as( SELECT dim1, m2 from druid.foo where "__time" >= '2001-01-02'), def as( SELECT t1.dim1, SUM(t2.m2) as "metricSum" from abc as t1 inner join abc as t2 on t1.dim1 = t2.dim1 where t1.dim1='def' group by 1)SELECT count(*) from def; -+--------+ -| EXPR$0 | -+--------+ -| 1 | -+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) - LogicalAggregate(group=[{0}]) - LogicalProject(dim1=[CAST('def':VARCHAR):VARCHAR]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalFilter(condition=[=($0, 'def')]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1], m2=[$6]) - LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(dim1=[CAST('def':VARCHAR):VARCHAR], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidFilter(condition=[=($0, 'def')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], m2=[$6], druid=[logical]) - DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "filter", - "base" : { - "type" : "table", - "name" : "foo" - }, - "filter" : { - "type" : "bound", - "dimension" : "__time", - "lower" : "978393600000", - "ordering" : { - "type" : "numeric" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "def" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "m2" ], - "columnTypes" : [ "STRING", "DOUBLE" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'def'", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled.iq index d904ef913db7..c394e1d7ec71 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled.iq @@ -1,4 +1,4 @@ -# testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=sql case-crc:7c6cef9c +# testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled case-crc:7c6cef9c # quidem testcase reason: SCAN_QUERY_ON_FILTERED_DS_DOING_FILTERING !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index a5fb9afeabcb..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,159 +0,0 @@ -# testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=default case-crc:7c6cef9c -# quidem testcase reason: SCAN_QUERY_ON_FILTERED_DS_DOING_FILTERING -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as( SELECT dim1, m2 from druid.foo where "__time" >= '2001-01-02'), def as( SELECT t1.dim1, SUM(t2.m2) as "metricSum" from abc as t1 inner join abc as t2 on t1.dim1 = t2.dim1 where t1.dim1='def' group by 1)SELECT count(*) from def; -+--------+ -| EXPR$0 | -+--------+ -| 1 | -+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) - LogicalAggregate(group=[{0}]) - LogicalProject(dim1=[CAST('def':VARCHAR):VARCHAR]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalFilter(condition=[=($0, 'def')]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1], m2=[$6]) - LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(dim1=[CAST('def':VARCHAR):VARCHAR], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidFilter(condition=[=($0, 'def')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], m2=[$6], druid=[logical]) - DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "filter", - "base" : { - "type" : "table", - "name" : "foo" - }, - "filter" : { - "type" : "bound", - "dimension" : "__time", - "lower" : "978393600000", - "ordering" : { - "type" : "numeric" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "def" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "m2" ], - "columnTypes" : [ "STRING", "DOUBLE" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'def'", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled.iq index 4090856cccaa..f798872fb69b 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled.iq @@ -1,4 +1,4 @@ -# testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=sql case-crc:5d06346f +# testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled case-crc:5d06346f # quidem testcase reason: SCAN_QUERY_ON_FILTERED_DS_DOING_FILTERING !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index 121c2724a62a..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,159 +0,0 @@ -# testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=default case-crc:5d06346f -# quidem testcase reason: SCAN_QUERY_ON_FILTERED_DS_DOING_FILTERING -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as( SELECT dim1, m2 from druid.foo where "__time" >= '2001-01-02'), def as( SELECT t1.dim1, SUM(t2.m2) as "metricSum" from abc as t1 inner join abc as t2 on t1.dim1 = t2.dim1 where t1.dim1='def' group by 1)SELECT count(*) from def; -+--------+ -| EXPR$0 | -+--------+ -| 1 | -+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) - LogicalAggregate(group=[{0}]) - LogicalProject(dim1=[CAST('def':VARCHAR):VARCHAR]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalFilter(condition=[=($0, 'def')]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1], m2=[$6]) - LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(dim1=[CAST('def':VARCHAR):VARCHAR], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidFilter(condition=[=($0, 'def')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], m2=[$6], druid=[logical]) - DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "filter", - "base" : { - "type" : "table", - "name" : "foo" - }, - "filter" : { - "type" : "bound", - "dimension" : "__time", - "lower" : "978393600000", - "ordering" : { - "type" : "numeric" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "def" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "m2" ], - "columnTypes" : [ "STRING", "DOUBLE" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'def'", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites.iq index d9b008e0915f..1a9f0c437196 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites.iq @@ -1,4 +1,4 @@ -# testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=sql case-crc:1045660d +# testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites case-crc:1045660d # quidem testcase reason: SCAN_QUERY_ON_FILTERED_DS_DOING_FILTERING !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index dede5bf4ed0a..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,159 +0,0 @@ -# testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=default case-crc:1045660d -# quidem testcase reason: SCAN_QUERY_ON_FILTERED_DS_DOING_FILTERING -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as( SELECT dim1, m2 from druid.foo where "__time" >= '2001-01-02'), def as( SELECT t1.dim1, SUM(t2.m2) as "metricSum" from abc as t1 inner join abc as t2 on t1.dim1 = t2.dim1 where t1.dim1='def' group by 1)SELECT count(*) from def; -+--------+ -| EXPR$0 | -+--------+ -| 1 | -+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) - LogicalAggregate(group=[{0}]) - LogicalProject(dim1=[CAST('def':VARCHAR):VARCHAR]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalFilter(condition=[=($0, 'def')]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1], m2=[$6]) - LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(dim1=[CAST('def':VARCHAR):VARCHAR], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidFilter(condition=[=($0, 'def')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], m2=[$6], druid=[logical]) - DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "filter", - "base" : { - "type" : "table", - "name" : "foo" - }, - "filter" : { - "type" : "bound", - "dimension" : "__time", - "lower" : "978393600000", - "ordering" : { - "type" : "numeric" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "def" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "m2" ], - "columnTypes" : [ "STRING", "DOUBLE" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'def'", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter.iq index 8297fc814d97..c06428be9487 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter.iq @@ -1,4 +1,4 @@ -# testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=sql case-crc:6cf62e05 +# testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter case-crc:6cf62e05 # quidem testcase reason: SCAN_QUERY_ON_FILTERED_DS_DOING_FILTERING !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=default.iq deleted file mode 100644 index 220d7f4545f2..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,159 +0,0 @@ -# testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=default case-crc:6cf62e05 -# quidem testcase reason: SCAN_QUERY_ON_FILTERED_DS_DOING_FILTERING -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as( SELECT dim1, m2 from druid.foo where "__time" >= '2001-01-02'), def as( SELECT t1.dim1, SUM(t2.m2) as "metricSum" from abc as t1 inner join abc as t2 on t1.dim1 = t2.dim1 where t1.dim1='def' group by 1)SELECT count(*) from def; -+--------+ -| EXPR$0 | -+--------+ -| 1 | -+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) - LogicalAggregate(group=[{0}]) - LogicalProject(dim1=[CAST('def':VARCHAR):VARCHAR]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalFilter(condition=[=($0, 'def')]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1], m2=[$6]) - LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(dim1=[CAST('def':VARCHAR):VARCHAR], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidFilter(condition=[=($0, 'def')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], m2=[$6], druid=[logical]) - DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "filter", - "base" : { - "type" : "table", - "name" : "foo" - }, - "filter" : { - "type" : "bound", - "dimension" : "__time", - "lower" : "978393600000", - "ordering" : { - "type" : "numeric" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "def" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "m2" ], - "columnTypes" : [ "STRING", "DOUBLE" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'def'", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@all_disabled.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@all_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@all_disabled.iq index 2b46bd02a953..08050bf04077 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@all_disabled.iq @@ -1,4 +1,4 @@ -# testSelectOnLookupUsingRightJoinOperator@all_disabled@NullHandling=sql case-crc:d750dd9d +# testSelectOnLookupUsingRightJoinOperator@all_disabled case-crc:d750dd9d # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@all_disabled@NullHandling=default.iq deleted file mode 100644 index bc52d4060f87..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,102 +0,0 @@ -# testSelectOnLookupUsingRightJoinOperator@all_disabled@NullHandling=default case-crc:d750dd9d -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, lookyloo.* -FROM foo RIGHT JOIN lookup.lookyloo ON foo.dim1 = lookyloo.k -WHERE lookyloo.v <> 'xxx' OR lookyloo.v IS NULL; -+------+-----------+--------------+ -| dim1 | k | v | -+------+-----------+--------------+ -| | 6 | x6 | -| | a | xa | -| | nosuchkey | mysteryvalue | -| abc | abc | xabc | -+------+-----------+--------------+ -(4 rows) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[right]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[SEARCH($1, Sarg[(-∞..'xxx':VARCHAR), ('xxx':VARCHAR..+∞); NULL AS TRUE]:VARCHAR)]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[right]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[SEARCH($1, Sarg[(-∞..'xxx':VARCHAR), ('xxx':VARCHAR..+∞); NULL AS TRUE]:VARCHAR)]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "selector", - "dimension" : "v", - "value" : null - }, { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "v", - "value" : "xxx" - } - } ] - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.k\")", - "joinType" : "RIGHT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "j0.k", "j0.v" ], - "columnTypes" : [ "STRING", "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@all_enabled.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@all_enabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@all_enabled.iq index 730a4733d4a0..2a26d46b656a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@all_enabled.iq @@ -1,4 +1,4 @@ -# testSelectOnLookupUsingRightJoinOperator@all_enabled@NullHandling=sql case-crc:1832c815 +# testSelectOnLookupUsingRightJoinOperator@all_enabled case-crc:1832c815 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@all_enabled@NullHandling=default.iq deleted file mode 100644 index 6700f37c42e0..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,102 +0,0 @@ -# testSelectOnLookupUsingRightJoinOperator@all_enabled@NullHandling=default case-crc:1832c815 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, lookyloo.* -FROM foo RIGHT JOIN lookup.lookyloo ON foo.dim1 = lookyloo.k -WHERE lookyloo.v <> 'xxx' OR lookyloo.v IS NULL; -+------+-----------+--------------+ -| dim1 | k | v | -+------+-----------+--------------+ -| | 6 | x6 | -| | a | xa | -| | nosuchkey | mysteryvalue | -| abc | abc | xabc | -+------+-----------+--------------+ -(4 rows) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[right]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[SEARCH($1, Sarg[(-∞..'xxx':VARCHAR), ('xxx':VARCHAR..+∞); NULL AS TRUE]:VARCHAR)]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[right]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[SEARCH($1, Sarg[(-∞..'xxx':VARCHAR), ('xxx':VARCHAR..+∞); NULL AS TRUE]:VARCHAR)]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "selector", - "dimension" : "v", - "value" : null - }, { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "v", - "value" : "xxx" - } - } ] - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.k\")", - "joinType" : "RIGHT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "j0.k", "j0.v" ], - "columnTypes" : [ "STRING", "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@default.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@default@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@default.iq index 2848eecb0b15..b3c5ef4a2671 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@default.iq @@ -1,4 +1,4 @@ -# testSelectOnLookupUsingRightJoinOperator@default@NullHandling=sql case-crc:07a52971 +# testSelectOnLookupUsingRightJoinOperator@default case-crc:07a52971 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@default@NullHandling=default.iq deleted file mode 100644 index 4ef9028bf40a..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@default@NullHandling=default.iq +++ /dev/null @@ -1,99 +0,0 @@ -# testSelectOnLookupUsingRightJoinOperator@default@NullHandling=default case-crc:07a52971 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, lookyloo.* -FROM foo RIGHT JOIN lookup.lookyloo ON foo.dim1 = lookyloo.k -WHERE lookyloo.v <> 'xxx' OR lookyloo.v IS NULL; -+------+-----------+--------------+ -| dim1 | k | v | -+------+-----------+--------------+ -| | 6 | x6 | -| | a | xa | -| | nosuchkey | mysteryvalue | -| abc | abc | xabc | -+------+-----------+--------------+ -(4 rows) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[right]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[SEARCH($1, Sarg[(-∞..'xxx':VARCHAR), ('xxx':VARCHAR..+∞); NULL AS TRUE]:VARCHAR)]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[right]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[SEARCH($1, Sarg[(-∞..'xxx':VARCHAR), ('xxx':VARCHAR..+∞); NULL AS TRUE]:VARCHAR)]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "selector", - "dimension" : "v", - "value" : null - }, { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "v", - "value" : "xxx" - } - } ] - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.k\")", - "joinType" : "RIGHT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "j0.k", "j0.v" ], - "columnTypes" : [ "STRING", "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@filter-on-value-column_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@filter-on-value-column_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@filter-on-value-column_disabled.iq index 74641f7d7fb4..54eee80906ff 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@filter-on-value-column_disabled.iq @@ -1,4 +1,4 @@ -# testSelectOnLookupUsingRightJoinOperator@filter-on-value-column_disabled@NullHandling=sql case-crc:8df54c14 +# testSelectOnLookupUsingRightJoinOperator@filter-on-value-column_disabled case-crc:8df54c14 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index d91b26ffcc38..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,102 +0,0 @@ -# testSelectOnLookupUsingRightJoinOperator@filter-on-value-column_disabled@NullHandling=default case-crc:8df54c14 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, lookyloo.* -FROM foo RIGHT JOIN lookup.lookyloo ON foo.dim1 = lookyloo.k -WHERE lookyloo.v <> 'xxx' OR lookyloo.v IS NULL; -+------+-----------+--------------+ -| dim1 | k | v | -+------+-----------+--------------+ -| | 6 | x6 | -| | a | xa | -| | nosuchkey | mysteryvalue | -| abc | abc | xabc | -+------+-----------+--------------+ -(4 rows) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[right]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[SEARCH($1, Sarg[(-∞..'xxx':VARCHAR), ('xxx':VARCHAR..+∞); NULL AS TRUE]:VARCHAR)]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[right]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[SEARCH($1, Sarg[(-∞..'xxx':VARCHAR), ('xxx':VARCHAR..+∞); NULL AS TRUE]:VARCHAR)]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "selector", - "dimension" : "v", - "value" : null - }, { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "v", - "value" : "xxx" - } - } ] - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.k\")", - "joinType" : "RIGHT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "j0.k", "j0.v" ], - "columnTypes" : [ "STRING", "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@filter-rewrites-disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@filter-rewrites-disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@filter-rewrites-disabled.iq index ad50dcdbe47e..6179c0fc8df0 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@filter-rewrites-disabled.iq @@ -1,4 +1,4 @@ -# testSelectOnLookupUsingRightJoinOperator@filter-rewrites-disabled@NullHandling=sql case-crc:86bd6ea1 +# testSelectOnLookupUsingRightJoinOperator@filter-rewrites-disabled case-crc:86bd6ea1 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index 62b6fb52b4b0..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,102 +0,0 @@ -# testSelectOnLookupUsingRightJoinOperator@filter-rewrites-disabled@NullHandling=default case-crc:86bd6ea1 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, lookyloo.* -FROM foo RIGHT JOIN lookup.lookyloo ON foo.dim1 = lookyloo.k -WHERE lookyloo.v <> 'xxx' OR lookyloo.v IS NULL; -+------+-----------+--------------+ -| dim1 | k | v | -+------+-----------+--------------+ -| | 6 | x6 | -| | a | xa | -| | nosuchkey | mysteryvalue | -| abc | abc | xabc | -+------+-----------+--------------+ -(4 rows) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[right]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[SEARCH($1, Sarg[(-∞..'xxx':VARCHAR), ('xxx':VARCHAR..+∞); NULL AS TRUE]:VARCHAR)]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[right]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[SEARCH($1, Sarg[(-∞..'xxx':VARCHAR), ('xxx':VARCHAR..+∞); NULL AS TRUE]:VARCHAR)]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "selector", - "dimension" : "v", - "value" : null - }, { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "v", - "value" : "xxx" - } - } ] - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.k\")", - "joinType" : "RIGHT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "j0.k", "j0.v" ], - "columnTypes" : [ "STRING", "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@filter-rewrites.iq similarity index 96% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@filter-rewrites@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@filter-rewrites.iq index 87cc45afce59..1fb868c8f124 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@filter-rewrites.iq @@ -1,4 +1,4 @@ -# testSelectOnLookupUsingRightJoinOperator@filter-rewrites@NullHandling=sql case-crc:583e7c8f +# testSelectOnLookupUsingRightJoinOperator@filter-rewrites case-crc:583e7c8f # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index 533566399727..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,102 +0,0 @@ -# testSelectOnLookupUsingRightJoinOperator@filter-rewrites@NullHandling=default case-crc:583e7c8f -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, lookyloo.* -FROM foo RIGHT JOIN lookup.lookyloo ON foo.dim1 = lookyloo.k -WHERE lookyloo.v <> 'xxx' OR lookyloo.v IS NULL; -+------+-----------+--------------+ -| dim1 | k | v | -+------+-----------+--------------+ -| | 6 | x6 | -| | a | xa | -| | nosuchkey | mysteryvalue | -| abc | abc | xabc | -+------+-----------+--------------+ -(4 rows) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[right]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[SEARCH($1, Sarg[(-∞..'xxx':VARCHAR), ('xxx':VARCHAR..+∞); NULL AS TRUE]:VARCHAR)]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[right]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[SEARCH($1, Sarg[(-∞..'xxx':VARCHAR), ('xxx':VARCHAR..+∞); NULL AS TRUE]:VARCHAR)]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "selector", - "dimension" : "v", - "value" : null - }, { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "v", - "value" : "xxx" - } - } ] - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.k\")", - "joinType" : "RIGHT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "j0.k", "j0.v" ], - "columnTypes" : [ "STRING", "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@join-to-filter.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@join-to-filter@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@join-to-filter.iq index 2404814f1776..1a73cd6ff7ca 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@join-to-filter.iq @@ -1,4 +1,4 @@ -# testSelectOnLookupUsingRightJoinOperator@join-to-filter@NullHandling=sql case-crc:41ed4f03 +# testSelectOnLookupUsingRightJoinOperator@join-to-filter case-crc:41ed4f03 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@join-to-filter@NullHandling=default.iq deleted file mode 100644 index 5ebdb2e2ff9b..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSelectOnLookupUsingRightJoinOperator@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,102 +0,0 @@ -# testSelectOnLookupUsingRightJoinOperator@join-to-filter@NullHandling=default case-crc:41ed4f03 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, lookyloo.* -FROM foo RIGHT JOIN lookup.lookyloo ON foo.dim1 = lookyloo.k -WHERE lookyloo.v <> 'xxx' OR lookyloo.v IS NULL; -+------+-----------+--------------+ -| dim1 | k | v | -+------+-----------+--------------+ -| | 6 | x6 | -| | a | xa | -| | nosuchkey | mysteryvalue | -| abc | abc | xabc | -+------+-----------+--------------+ -(4 rows) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[right]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[SEARCH($1, Sarg[(-∞..'xxx':VARCHAR), ('xxx':VARCHAR..+∞); NULL AS TRUE]:VARCHAR)]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[right]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[SEARCH($1, Sarg[(-∞..'xxx':VARCHAR), ('xxx':VARCHAR..+∞); NULL AS TRUE]:VARCHAR)]) - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "selector", - "dimension" : "v", - "value" : null - }, { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "v", - "value" : "xxx" - } - } ] - }, - "columns" : [ "k", "v" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.k\")", - "joinType" : "RIGHT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1", "j0.k", "j0.v" ], - "columnTypes" : [ "STRING", "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled.iq index 6d0ffd3c3c96..e0f0e80204ba 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled.iq @@ -1,4 +1,4 @@ -# testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=sql case-crc:51e7cf34 +# testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled case-crc:51e7cf34 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=default.iq deleted file mode 100644 index 101a7b6c74d7..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,157 +0,0 @@ -# testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=default case-crc:51e7cf34 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM -foo -INNER JOIN (SELECT MAX(__time) t FROM foo) t0 on t0.t = foo.__time -LEFT JOIN (SELECT MIN(__time) t FROM foo) t1 on t1.t = foo.__time -WHERE dim1 IN ('abc', 'def') AND t1.t is null -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalFilter(condition=[IS NULL($3)]) - LogicalJoin(condition=[=($3, $0)], joinType=[left]) - LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidFilter(condition=[IS NULL($3)]) - DruidJoin(condition=[=($0, $3)], joinType=[left]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "minTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "(\"__time\" == \"_j0.a0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "selector", - "dimension" : "_j0.a0", - "value" : null - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled.iq index b733c4c086b9..916317f4ec23 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled.iq @@ -1,4 +1,4 @@ -# testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=sql case-crc:66cfe2c8 +# testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled case-crc:66cfe2c8 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=default.iq deleted file mode 100644 index f46ed02d1371..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,157 +0,0 @@ -# testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=default case-crc:66cfe2c8 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM -foo -INNER JOIN (SELECT MAX(__time) t FROM foo) t0 on t0.t = foo.__time -LEFT JOIN (SELECT MIN(__time) t FROM foo) t1 on t1.t = foo.__time -WHERE dim1 IN ('abc', 'def') AND t1.t is null -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalFilter(condition=[IS NULL($3)]) - LogicalJoin(condition=[=($3, $0)], joinType=[left]) - LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidFilter(condition=[IS NULL($3)]) - DruidJoin(condition=[=($0, $3)], joinType=[left]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "minTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "(\"__time\" == \"_j0.a0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "selector", - "dimension" : "_j0.a0", - "value" : null - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default.iq index f3ecb3bea56a..47ebcd79aac2 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default.iq @@ -1,4 +1,4 @@ -# testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=sql case-crc:9311cae7 +# testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default case-crc:9311cae7 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=default.iq deleted file mode 100644 index f24615642dfa..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=default.iq +++ /dev/null @@ -1,154 +0,0 @@ -# testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=default case-crc:9311cae7 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM -foo -INNER JOIN (SELECT MAX(__time) t FROM foo) t0 on t0.t = foo.__time -LEFT JOIN (SELECT MIN(__time) t FROM foo) t1 on t1.t = foo.__time -WHERE dim1 IN ('abc', 'def') AND t1.t is null -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalFilter(condition=[IS NULL($3)]) - LogicalJoin(condition=[=($3, $0)], joinType=[left]) - LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidFilter(condition=[IS NULL($3)]) - DruidJoin(condition=[=($0, $3)], joinType=[left]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "minTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "(\"__time\" == \"_j0.a0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "selector", - "dimension" : "_j0.a0", - "value" : null - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled.iq index 7701a02bfee1..3d04b069f8e9 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled.iq @@ -1,4 +1,4 @@ -# testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=sql case-crc:f2169f67 +# testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled case-crc:f2169f67 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index 5b19c4c25634..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,157 +0,0 @@ -# testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=default case-crc:f2169f67 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM -foo -INNER JOIN (SELECT MAX(__time) t FROM foo) t0 on t0.t = foo.__time -LEFT JOIN (SELECT MIN(__time) t FROM foo) t1 on t1.t = foo.__time -WHERE dim1 IN ('abc', 'def') AND t1.t is null -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalFilter(condition=[IS NULL($3)]) - LogicalJoin(condition=[=($3, $0)], joinType=[left]) - LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidFilter(condition=[IS NULL($3)]) - DruidJoin(condition=[=($0, $3)], joinType=[left]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "minTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "(\"__time\" == \"_j0.a0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "selector", - "dimension" : "_j0.a0", - "value" : null - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled.iq index 9760704dac36..b3cbf488c4bb 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled.iq @@ -1,4 +1,4 @@ -# testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=sql case-crc:38c4fa5e +# testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled case-crc:38c4fa5e # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index 37b054a823b8..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,157 +0,0 @@ -# testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=default case-crc:38c4fa5e -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM -foo -INNER JOIN (SELECT MAX(__time) t FROM foo) t0 on t0.t = foo.__time -LEFT JOIN (SELECT MIN(__time) t FROM foo) t1 on t1.t = foo.__time -WHERE dim1 IN ('abc', 'def') AND t1.t is null -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalFilter(condition=[IS NULL($3)]) - LogicalJoin(condition=[=($3, $0)], joinType=[left]) - LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidFilter(condition=[IS NULL($3)]) - DruidJoin(condition=[=($0, $3)], joinType=[left]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "minTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "(\"__time\" == \"_j0.a0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "selector", - "dimension" : "_j0.a0", - "value" : null - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites.iq index 5fbc891a4757..3f7622dfef38 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites.iq @@ -1,4 +1,4 @@ -# testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=sql case-crc:9ff2e870 +# testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites case-crc:9ff2e870 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index 56a68a1d1629..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,157 +0,0 @@ -# testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=default case-crc:9ff2e870 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM -foo -INNER JOIN (SELECT MAX(__time) t FROM foo) t0 on t0.t = foo.__time -LEFT JOIN (SELECT MIN(__time) t FROM foo) t1 on t1.t = foo.__time -WHERE dim1 IN ('abc', 'def') AND t1.t is null -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalFilter(condition=[IS NULL($3)]) - LogicalJoin(condition=[=($3, $0)], joinType=[left]) - LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidFilter(condition=[IS NULL($3)]) - DruidJoin(condition=[=($0, $3)], joinType=[left]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "minTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "(\"__time\" == \"_j0.a0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "selector", - "dimension" : "_j0.a0", - "value" : null - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter.iq index 937d559604c6..14ff0e551994 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter.iq @@ -1,4 +1,4 @@ -# testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=sql case-crc:0a72daeb +# testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter case-crc:0a72daeb # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=default.iq deleted file mode 100644 index 889203c5566d..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,157 +0,0 @@ -# testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=default case-crc:0a72daeb -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM -foo -INNER JOIN (SELECT MAX(__time) t FROM foo) t0 on t0.t = foo.__time -LEFT JOIN (SELECT MIN(__time) t FROM foo) t1 on t1.t = foo.__time -WHERE dim1 IN ('abc', 'def') AND t1.t is null -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalFilter(condition=[IS NULL($3)]) - LogicalJoin(condition=[=($3, $0)], joinType=[left]) - LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidFilter(condition=[IS NULL($3)]) - DruidJoin(condition=[=($0, $3)], joinType=[left]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "minTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "(\"__time\" == \"_j0.a0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "selector", - "dimension" : "_j0.a0", - "value" : null - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled.iq index dabbf8c9566f..0e4f90baabf8 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled.iq @@ -1,4 +1,4 @@ -# testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=sql case-crc:d7ede89b +# testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled case-crc:d7ede89b # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=default.iq deleted file mode 100644 index 3b4612fe1fa3..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,237 +0,0 @@ -# testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=default case-crc:d7ede89b -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM foo -WHERE dim1 IN ('abc', 'def') -AND __time IN (SELECT MAX(__time) FROM foo) -AND __time NOT IN (SELECT MIN(__time) FROM foo) -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalFilter(condition=[OR(=($3, 0), AND(IS NULL($6), >=($4, $3)))]) - LogicalJoin(condition=[=($0, $5)], joinType=[left]) - LogicalJoin(condition=[true], joinType=[inner]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) - LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(EXPR$0=[$0], i=[true]) - LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidFilter(condition=[OR(=($3, 0), AND(IS NULL($6), >=($4, $3)))]) - DruidJoin(condition=[=($0, $5)], joinType=[left]) - DruidJoin(condition=[true], joinType=[inner]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "minTime", - "granularity" : { - "type" : "all" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ ], - "aggregations" : [ { - "type" : "count", - "name" : "_a0" - }, { - "type" : "count", - "name" : "_a1" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "1", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeseries", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "aggregations" : [ { - "type" : "longMin", - "name" : "a0", - "fieldName" : "__time" - } ], - "postAggregations" : [ { - "type" : "expression", - "name" : "p0", - "expression" : "1", - "outputType" : "LONG" - } ] - } - }, - "rightPrefix" : "__j0.", - "condition" : "(\"__time\" == \"__j0.a0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "selector", - "dimension" : "_j0._a0", - "value" : "0" - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "__j0.p0", - "value" : null - }, { - "type" : "expression", - "expression" : "(\"_j0._a1\" >= \"_j0._a0\")" - } ] - } ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled.iq index 69fbdc2839ed..49b751b4c469 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled.iq @@ -1,4 +1,4 @@ -# testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=sql case-crc:588e02ac +# testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled case-crc:588e02ac # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=default.iq deleted file mode 100644 index 3b1114343cdf..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,237 +0,0 @@ -# testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=default case-crc:588e02ac -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM foo -WHERE dim1 IN ('abc', 'def') -AND __time IN (SELECT MAX(__time) FROM foo) -AND __time NOT IN (SELECT MIN(__time) FROM foo) -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalFilter(condition=[OR(=($3, 0), AND(IS NULL($6), >=($4, $3)))]) - LogicalJoin(condition=[=($0, $5)], joinType=[left]) - LogicalJoin(condition=[true], joinType=[inner]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) - LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(EXPR$0=[$0], i=[true]) - LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidFilter(condition=[OR(=($3, 0), AND(IS NULL($6), >=($4, $3)))]) - DruidJoin(condition=[=($0, $5)], joinType=[left]) - DruidJoin(condition=[true], joinType=[inner]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "minTime", - "granularity" : { - "type" : "all" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ ], - "aggregations" : [ { - "type" : "count", - "name" : "_a0" - }, { - "type" : "count", - "name" : "_a1" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "1", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeseries", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "aggregations" : [ { - "type" : "longMin", - "name" : "a0", - "fieldName" : "__time" - } ], - "postAggregations" : [ { - "type" : "expression", - "name" : "p0", - "expression" : "1", - "outputType" : "LONG" - } ] - } - }, - "rightPrefix" : "__j0.", - "condition" : "(\"__time\" == \"__j0.a0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "selector", - "dimension" : "_j0._a0", - "value" : "0" - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "__j0.p0", - "value" : null - }, { - "type" : "expression", - "expression" : "(\"_j0._a1\" >= \"_j0._a0\")" - } ] - } ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default.iq index 9e08a5e66bb9..af5221b85aa9 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default.iq @@ -1,4 +1,4 @@ -# testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=sql case-crc:380b2789 +# testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default case-crc:380b2789 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=default.iq deleted file mode 100644 index 72af14b10af5..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=default.iq +++ /dev/null @@ -1,234 +0,0 @@ -# testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=default case-crc:380b2789 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM foo -WHERE dim1 IN ('abc', 'def') -AND __time IN (SELECT MAX(__time) FROM foo) -AND __time NOT IN (SELECT MIN(__time) FROM foo) -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalFilter(condition=[OR(=($3, 0), AND(IS NULL($6), >=($4, $3)))]) - LogicalJoin(condition=[=($0, $5)], joinType=[left]) - LogicalJoin(condition=[true], joinType=[inner]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) - LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(EXPR$0=[$0], i=[true]) - LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidFilter(condition=[OR(=($3, 0), AND(IS NULL($6), >=($4, $3)))]) - DruidJoin(condition=[=($0, $5)], joinType=[left]) - DruidJoin(condition=[true], joinType=[inner]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "minTime", - "granularity" : { - "type" : "all" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ ], - "aggregations" : [ { - "type" : "count", - "name" : "_a0" - }, { - "type" : "count", - "name" : "_a1" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "1", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeseries", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "aggregations" : [ { - "type" : "longMin", - "name" : "a0", - "fieldName" : "__time" - } ], - "postAggregations" : [ { - "type" : "expression", - "name" : "p0", - "expression" : "1", - "outputType" : "LONG" - } ] - } - }, - "rightPrefix" : "__j0.", - "condition" : "(\"__time\" == \"__j0.a0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "selector", - "dimension" : "_j0._a0", - "value" : "0" - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "__j0.p0", - "value" : null - }, { - "type" : "expression", - "expression" : "(\"_j0._a1\" >= \"_j0._a0\")" - } ] - } ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled.iq index c3153057a2db..f0d840ab5313 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled.iq @@ -1,4 +1,4 @@ -# testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=sql case-crc:13ce8fe9 +# testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled case-crc:13ce8fe9 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index 55a081a200bf..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,237 +0,0 @@ -# testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=default case-crc:13ce8fe9 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM foo -WHERE dim1 IN ('abc', 'def') -AND __time IN (SELECT MAX(__time) FROM foo) -AND __time NOT IN (SELECT MIN(__time) FROM foo) -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalFilter(condition=[OR(=($3, 0), AND(IS NULL($6), >=($4, $3)))]) - LogicalJoin(condition=[=($0, $5)], joinType=[left]) - LogicalJoin(condition=[true], joinType=[inner]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) - LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(EXPR$0=[$0], i=[true]) - LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidFilter(condition=[OR(=($3, 0), AND(IS NULL($6), >=($4, $3)))]) - DruidJoin(condition=[=($0, $5)], joinType=[left]) - DruidJoin(condition=[true], joinType=[inner]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "minTime", - "granularity" : { - "type" : "all" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ ], - "aggregations" : [ { - "type" : "count", - "name" : "_a0" - }, { - "type" : "count", - "name" : "_a1" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "1", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeseries", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "aggregations" : [ { - "type" : "longMin", - "name" : "a0", - "fieldName" : "__time" - } ], - "postAggregations" : [ { - "type" : "expression", - "name" : "p0", - "expression" : "1", - "outputType" : "LONG" - } ] - } - }, - "rightPrefix" : "__j0.", - "condition" : "(\"__time\" == \"__j0.a0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "selector", - "dimension" : "_j0._a0", - "value" : "0" - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "__j0.p0", - "value" : null - }, { - "type" : "expression", - "expression" : "(\"_j0._a1\" >= \"_j0._a0\")" - } ] - } ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled.iq index 25c11967aa4b..1d5be01efe3c 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled.iq @@ -1,4 +1,4 @@ -# testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=sql case-crc:833d3669 +# testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled case-crc:833d3669 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index 1669befcb8b3..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,237 +0,0 @@ -# testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=default case-crc:833d3669 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM foo -WHERE dim1 IN ('abc', 'def') -AND __time IN (SELECT MAX(__time) FROM foo) -AND __time NOT IN (SELECT MIN(__time) FROM foo) -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalFilter(condition=[OR(=($3, 0), AND(IS NULL($6), >=($4, $3)))]) - LogicalJoin(condition=[=($0, $5)], joinType=[left]) - LogicalJoin(condition=[true], joinType=[inner]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) - LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(EXPR$0=[$0], i=[true]) - LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidFilter(condition=[OR(=($3, 0), AND(IS NULL($6), >=($4, $3)))]) - DruidJoin(condition=[=($0, $5)], joinType=[left]) - DruidJoin(condition=[true], joinType=[inner]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "minTime", - "granularity" : { - "type" : "all" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ ], - "aggregations" : [ { - "type" : "count", - "name" : "_a0" - }, { - "type" : "count", - "name" : "_a1" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "1", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeseries", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "aggregations" : [ { - "type" : "longMin", - "name" : "a0", - "fieldName" : "__time" - } ], - "postAggregations" : [ { - "type" : "expression", - "name" : "p0", - "expression" : "1", - "outputType" : "LONG" - } ] - } - }, - "rightPrefix" : "__j0.", - "condition" : "(\"__time\" == \"__j0.a0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "selector", - "dimension" : "_j0._a0", - "value" : "0" - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "__j0.p0", - "value" : null - }, { - "type" : "expression", - "expression" : "(\"_j0._a1\" >= \"_j0._a0\")" - } ] - } ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites.iq index 07f8519ba404..29eb962facca 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites.iq @@ -1,4 +1,4 @@ -# testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=sql case-crc:59c3074a +# testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites case-crc:59c3074a # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index c1d251bc1e9e..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,237 +0,0 @@ -# testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=default case-crc:59c3074a -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM foo -WHERE dim1 IN ('abc', 'def') -AND __time IN (SELECT MAX(__time) FROM foo) -AND __time NOT IN (SELECT MIN(__time) FROM foo) -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalFilter(condition=[OR(=($3, 0), AND(IS NULL($6), >=($4, $3)))]) - LogicalJoin(condition=[=($0, $5)], joinType=[left]) - LogicalJoin(condition=[true], joinType=[inner]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) - LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(EXPR$0=[$0], i=[true]) - LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidFilter(condition=[OR(=($3, 0), AND(IS NULL($6), >=($4, $3)))]) - DruidJoin(condition=[=($0, $5)], joinType=[left]) - DruidJoin(condition=[true], joinType=[inner]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "minTime", - "granularity" : { - "type" : "all" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ ], - "aggregations" : [ { - "type" : "count", - "name" : "_a0" - }, { - "type" : "count", - "name" : "_a1" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "1", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeseries", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "aggregations" : [ { - "type" : "longMin", - "name" : "a0", - "fieldName" : "__time" - } ], - "postAggregations" : [ { - "type" : "expression", - "name" : "p0", - "expression" : "1", - "outputType" : "LONG" - } ] - } - }, - "rightPrefix" : "__j0.", - "condition" : "(\"__time\" == \"__j0.a0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "selector", - "dimension" : "_j0._a0", - "value" : "0" - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "__j0.p0", - "value" : null - }, { - "type" : "expression", - "expression" : "(\"_j0._a1\" >= \"_j0._a0\")" - } ] - } ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter.iq index 2b1c95734afd..6cf5f66d3111 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter.iq @@ -1,4 +1,4 @@ -# testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=sql case-crc:fcf14bf8 +# testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter case-crc:fcf14bf8 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=default.iq deleted file mode 100644 index 79ee3f8a6db4..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,237 +0,0 @@ -# testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=default case-crc:fcf14bf8 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM foo -WHERE dim1 IN ('abc', 'def') -AND __time IN (SELECT MAX(__time) FROM foo) -AND __time NOT IN (SELECT MIN(__time) FROM foo) -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalFilter(condition=[OR(=($3, 0), AND(IS NULL($6), >=($4, $3)))]) - LogicalJoin(condition=[=($0, $5)], joinType=[left]) - LogicalJoin(condition=[true], joinType=[inner]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) - LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(EXPR$0=[$0], i=[true]) - LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidFilter(condition=[OR(=($3, 0), AND(IS NULL($6), >=($4, $3)))]) - DruidJoin(condition=[=($0, $5)], joinType=[left]) - DruidJoin(condition=[true], joinType=[inner]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "minTime", - "granularity" : { - "type" : "all" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ ], - "aggregations" : [ { - "type" : "count", - "name" : "_a0" - }, { - "type" : "count", - "name" : "_a1" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "1", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeseries", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "aggregations" : [ { - "type" : "longMin", - "name" : "a0", - "fieldName" : "__time" - } ], - "postAggregations" : [ { - "type" : "expression", - "name" : "p0", - "expression" : "1", - "outputType" : "LONG" - } ] - } - }, - "rightPrefix" : "__j0.", - "condition" : "(\"__time\" == \"__j0.a0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "selector", - "dimension" : "_j0._a0", - "value" : "0" - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "__j0.p0", - "value" : null - }, { - "type" : "expression", - "expression" : "(\"_j0._a1\" >= \"_j0._a0\")" - } ] - } ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractAggregateWithOrderBy.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractAggregateWithOrderBy.iq index 2ac2cbd28309..383aa62df8fc 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractAggregateWithOrderBy.iq @@ -1,4 +1,4 @@ -# testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=sql case-crc:a25a8d86 +# testSemiJoinWithOuterTimeExtractAggregateWithOrderBy case-crc:a25a8d86 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=default.iq deleted file mode 100644 index 396d37ca2e21..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=default.iq +++ /dev/null @@ -1,154 +0,0 @@ -# testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=default case-crc:a25a8d86 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT COUNT(DISTINCT dim1), EXTRACT(MONTH FROM __time) FROM druid.foo - WHERE dim2 IN ( - SELECT dim2 - FROM druid.foo - WHERE dim1 = 'def' - ) AND dim1 <> ''GROUP BY EXTRACT(MONTH FROM __time) -ORDER BY EXTRACT(MONTH FROM __time); -+--------+--------+ -| EXPR$0 | EXPR$1 | -+--------+--------+ -| 1 | 1 | -+--------+--------+ -(1 row) - -!ok -LogicalProject(EXPR$0=[$1], EXPR$1=[$0]) - LogicalSort(sort0=[$0], dir0=[ASC]) - LogicalAggregate(group=[{0}], EXPR$0=[COUNT(DISTINCT $1)]) - LogicalProject(EXPR$1=[EXTRACT(FLAG(MONTH), $0)], dim1=[$1]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[<>($1, '')]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{2}]) - LogicalFilter(condition=[=($1, 'def')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(EXPR$0=[$1], EXPR$1=[$0], druid=[logical]) - DruidAggregate(group=[{0}], EXPR$0=[COUNT(DISTINCT $1)], druid=[logical]) - DruidProject(EXPR$1=[EXTRACT(FLAG(MONTH), $0)], dim1=[$1], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[<>($1, '')]) - DruidProject(__time=[$0], dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{2}], druid=[logical]) - DruidFilter(condition=[=($1, 'def')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : null - } - }, - "columns" : [ "__time", "dim1", "dim2" ], - "columnTypes" : [ "LONG", "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "def" - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "timestamp_extract(\"__time\",'MONTH','UTC')", - "outputType" : "LONG" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "LONG" - } ], - "aggregations" : [ { - "type" : "cardinality", - "name" : "a0", - "fields" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "dim1", - "outputType" : "STRING" - } ], - "byRow" : false, - "round" : true - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan.iq index a76916e1296e..5c060737c4fd 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan.iq @@ -1,4 +1,4 @@ -# testSemiJoinWithOuterTimeExtractScan@NullHandling=sql case-crc:f91c4c1d +# testSemiJoinWithOuterTimeExtractScan case-crc:f91c4c1d # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan@NullHandling=default.iq deleted file mode 100644 index 675d6a757be9..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan@NullHandling=default.iq +++ /dev/null @@ -1,131 +0,0 @@ -# testSemiJoinWithOuterTimeExtractScan@NullHandling=default case-crc:f91c4c1d -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, EXTRACT(MONTH FROM __time) FROM druid.foo - WHERE dim2 IN ( - SELECT dim2 - FROM druid.foo - WHERE dim1 = 'def' - ) AND dim1 <> ''; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| def | 1 | -+------+--------+ -(1 row) - -!ok -LogicalProject(dim1=[$1], EXPR$1=[EXTRACT(FLAG(MONTH), $0)]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[<>($1, '')]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{2}]) - LogicalFilter(condition=[=($1, 'def')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[$1], EXPR$1=[EXTRACT(FLAG(MONTH), $0)], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[<>($1, '')]) - DruidProject(__time=[$0], dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{2}], druid=[logical]) - DruidFilter(condition=[=($1, 'def')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : null - } - }, - "columns" : [ "__time", "dim1", "dim2" ], - "columnTypes" : [ "LONG", "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "def" - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "timestamp_extract(\"__time\",'MONTH','UTC')", - "outputType" : "LONG" - } ], - "resultFormat" : "compactedList", - "columns" : [ "dim1", "v0" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_disabled.iq index 6912ce744091..aef136a17109 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_disabled.iq @@ -1,4 +1,4 @@ -# testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=sql case-crc:34b41cbf +# testTwoSemiJoinsSimultaneously@all_disabled case-crc:34b41cbf # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=default.iq deleted file mode 100644 index 31676bf61071..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,165 +0,0 @@ -# testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=default case-crc:34b41cbf -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM foo -WHERE dim1 IN ('abc', 'def')AND __time IN (SELECT MAX(__time) FROM foo WHERE cnt = 1) -AND __time IN (SELECT MAX(__time) FROM foo WHERE cnt <> 2) -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $3)], joinType=[inner]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($4, 1)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($4, 2)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $3)], joinType=[inner]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($4, 1)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($4, 2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "filter" : { - "type" : "selector", - "dimension" : "cnt", - "value" : "1" - }, - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "cnt", - "value" : "2" - } - }, - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "(\"__time\" == \"_j0.a0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_enabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_enabled.iq index 6ebb59c96d2e..4cd679f30ca2 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_enabled.iq @@ -1,4 +1,4 @@ -# testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=sql case-crc:25c89e4f +# testTwoSemiJoinsSimultaneously@all_enabled case-crc:25c89e4f # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=default.iq deleted file mode 100644 index e7a7c8a63d46..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,165 +0,0 @@ -# testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=default case-crc:25c89e4f -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM foo -WHERE dim1 IN ('abc', 'def')AND __time IN (SELECT MAX(__time) FROM foo WHERE cnt = 1) -AND __time IN (SELECT MAX(__time) FROM foo WHERE cnt <> 2) -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $3)], joinType=[inner]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($4, 1)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($4, 2)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $3)], joinType=[inner]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($4, 1)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($4, 2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "filter" : { - "type" : "selector", - "dimension" : "cnt", - "value" : "1" - }, - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "cnt", - "value" : "2" - } - }, - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "(\"__time\" == \"_j0.a0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@default.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@default@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@default.iq index bb2d3b4a5914..38da8b3917e4 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@default.iq @@ -1,4 +1,4 @@ -# testTwoSemiJoinsSimultaneously@default@NullHandling=sql case-crc:3372d2de +# testTwoSemiJoinsSimultaneously@default case-crc:3372d2de # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@default@NullHandling=default.iq deleted file mode 100644 index 9251aac16028..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@default@NullHandling=default.iq +++ /dev/null @@ -1,162 +0,0 @@ -# testTwoSemiJoinsSimultaneously@default@NullHandling=default case-crc:3372d2de -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM foo -WHERE dim1 IN ('abc', 'def')AND __time IN (SELECT MAX(__time) FROM foo WHERE cnt = 1) -AND __time IN (SELECT MAX(__time) FROM foo WHERE cnt <> 2) -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $3)], joinType=[inner]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($4, 1)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($4, 2)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $3)], joinType=[inner]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($4, 1)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($4, 2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "filter" : { - "type" : "selector", - "dimension" : "cnt", - "value" : "1" - }, - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "cnt", - "value" : "2" - } - }, - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "(\"__time\" == \"_j0.a0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled.iq index 081e03cf0481..29bd1672a4f1 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled.iq @@ -1,4 +1,4 @@ -# testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=sql case-crc:ede47e22 +# testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled case-crc:ede47e22 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index f92d14a0a082..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,165 +0,0 @@ -# testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=default case-crc:ede47e22 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM foo -WHERE dim1 IN ('abc', 'def')AND __time IN (SELECT MAX(__time) FROM foo WHERE cnt = 1) -AND __time IN (SELECT MAX(__time) FROM foo WHERE cnt <> 2) -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $3)], joinType=[inner]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($4, 1)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($4, 2)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $3)], joinType=[inner]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($4, 1)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($4, 2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "filter" : { - "type" : "selector", - "dimension" : "cnt", - "value" : "1" - }, - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "cnt", - "value" : "2" - } - }, - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "(\"__time\" == \"_j0.a0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites-disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites-disabled.iq index b8a128c8c83c..48dc83ca1ce0 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites-disabled.iq @@ -1,4 +1,4 @@ -# testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=sql case-crc:2db0dd99 +# testTwoSemiJoinsSimultaneously@filter-rewrites-disabled case-crc:2db0dd99 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index 1ac6b640dd69..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,165 +0,0 @@ -# testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=default case-crc:2db0dd99 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM foo -WHERE dim1 IN ('abc', 'def')AND __time IN (SELECT MAX(__time) FROM foo WHERE cnt = 1) -AND __time IN (SELECT MAX(__time) FROM foo WHERE cnt <> 2) -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $3)], joinType=[inner]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($4, 1)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($4, 2)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $3)], joinType=[inner]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($4, 1)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($4, 2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "filter" : { - "type" : "selector", - "dimension" : "cnt", - "value" : "1" - }, - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "cnt", - "value" : "2" - } - }, - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "(\"__time\" == \"_j0.a0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites.iq index aeb265a2e2fe..de6dd06a6fd2 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites.iq @@ -1,4 +1,4 @@ -# testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=sql case-crc:dfbbc9bc +# testTwoSemiJoinsSimultaneously@filter-rewrites case-crc:dfbbc9bc # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index 48e3f064fb58..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,165 +0,0 @@ -# testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=default case-crc:dfbbc9bc -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM foo -WHERE dim1 IN ('abc', 'def')AND __time IN (SELECT MAX(__time) FROM foo WHERE cnt = 1) -AND __time IN (SELECT MAX(__time) FROM foo WHERE cnt <> 2) -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $3)], joinType=[inner]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($4, 1)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($4, 2)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $3)], joinType=[inner]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($4, 1)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($4, 2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "filter" : { - "type" : "selector", - "dimension" : "cnt", - "value" : "1" - }, - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "cnt", - "value" : "2" - } - }, - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "(\"__time\" == \"_j0.a0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@join-to-filter.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@join-to-filter.iq index c457e64c1239..1a1f3b4b83a9 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@join-to-filter.iq @@ -1,4 +1,4 @@ -# testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=sql case-crc:a72f732c +# testTwoSemiJoinsSimultaneously@join-to-filter case-crc:a72f732c # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=default.iq deleted file mode 100644 index acbdbb3e40fe..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,165 +0,0 @@ -# testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=default case-crc:a72f732c -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM foo -WHERE dim1 IN ('abc', 'def')AND __time IN (SELECT MAX(__time) FROM foo WHERE cnt = 1) -AND __time IN (SELECT MAX(__time) FROM foo WHERE cnt <> 2) -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $3)], joinType=[inner]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($4, 1)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($4, 2)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $3)], joinType=[inner]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($4, 1)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($4, 2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "filter" : { - "type" : "selector", - "dimension" : "cnt", - "value" : "1" - }, - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "cnt", - "value" : "2" - } - }, - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "(\"__time\" == \"_j0.a0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_disabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_disabled.iq index 5bc8df831e2e..8316b7b765a5 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_disabled.iq @@ -1,4 +1,4 @@ -# testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=sql case-crc:5416b44a +# testUsingSubqueryAsPartOfAndFilter@all_disabled case-crc:5416b44a # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=default.iq deleted file mode 100644 index 8398bd47433a..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,152 +0,0 @@ -# testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=default case-crc:5416b44a -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, dim2, COUNT(*) FROM druid.foo -WHERE dim2 IN (SELECT dim1 FROM druid.foo WHERE dim1 <> '') -AND dim1 <> 'xxx' -group by dim1, dim2 ORDER BY dim2; -+------+------+--------+ -| dim1 | dim2 | EXPR$2 | -+------+------+--------+ -| def | abc | 1 | -+------+------+--------+ -(1 row) - -!ok -LogicalSort(sort0=[$1], dir0=[ASC]) - LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT()]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalFilter(condition=[<>($0, 'xxx')]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) - DruidAggregate(group=[{0, 1}], EXPR$2=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidFilter(condition=[<>($0, 'xxx')]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "xxx" - } - }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : null - } - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - }, { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d1", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "default", - "columns" : [ { - "dimension" : "d1", - "direction" : "ascending", - "dimensionOrder" : { - "type" : "lexicographic" - } - } ] - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_enabled.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_enabled.iq index 392a11cecfb4..aaff6690b6fa 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_enabled.iq @@ -1,4 +1,4 @@ -# testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=sql case-crc:a7bb9ccc +# testUsingSubqueryAsPartOfAndFilter@all_enabled case-crc:a7bb9ccc # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=default.iq deleted file mode 100644 index d00e48a310e9..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,152 +0,0 @@ -# testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=default case-crc:a7bb9ccc -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, dim2, COUNT(*) FROM druid.foo -WHERE dim2 IN (SELECT dim1 FROM druid.foo WHERE dim1 <> '') -AND dim1 <> 'xxx' -group by dim1, dim2 ORDER BY dim2; -+------+------+--------+ -| dim1 | dim2 | EXPR$2 | -+------+------+--------+ -| def | abc | 1 | -+------+------+--------+ -(1 row) - -!ok -LogicalSort(sort0=[$1], dir0=[ASC]) - LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT()]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalFilter(condition=[<>($0, 'xxx')]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) - DruidAggregate(group=[{0, 1}], EXPR$2=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidFilter(condition=[<>($0, 'xxx')]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "xxx" - } - }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : null - } - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - }, { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d1", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "default", - "columns" : [ { - "dimension" : "d1", - "direction" : "ascending", - "dimensionOrder" : { - "type" : "lexicographic" - } - } ] - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@default.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@default@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@default.iq index 7b0882069eb8..07b9d72b6566 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@default.iq @@ -1,4 +1,4 @@ -# testUsingSubqueryAsPartOfAndFilter@default@NullHandling=sql case-crc:18fc370a +# testUsingSubqueryAsPartOfAndFilter@default case-crc:18fc370a # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@default@NullHandling=default.iq deleted file mode 100644 index 2821adc1c6e0..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@default@NullHandling=default.iq +++ /dev/null @@ -1,149 +0,0 @@ -# testUsingSubqueryAsPartOfAndFilter@default@NullHandling=default case-crc:18fc370a -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, dim2, COUNT(*) FROM druid.foo -WHERE dim2 IN (SELECT dim1 FROM druid.foo WHERE dim1 <> '') -AND dim1 <> 'xxx' -group by dim1, dim2 ORDER BY dim2; -+------+------+--------+ -| dim1 | dim2 | EXPR$2 | -+------+------+--------+ -| def | abc | 1 | -+------+------+--------+ -(1 row) - -!ok -LogicalSort(sort0=[$1], dir0=[ASC]) - LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT()]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalFilter(condition=[<>($0, 'xxx')]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) - DruidAggregate(group=[{0, 1}], EXPR$2=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidFilter(condition=[<>($0, 'xxx')]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "xxx" - } - }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : null - } - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - }, { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d1", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "default", - "columns" : [ { - "dimension" : "d1", - "direction" : "ascending", - "dimensionOrder" : { - "type" : "lexicographic" - } - } ] - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled.iq index f6e3943305db..6e832f26c34c 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled.iq @@ -1,4 +1,4 @@ -# testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=sql case-crc:ce3a443c +# testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled case-crc:ce3a443c # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index 1987ab4c04b5..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,152 +0,0 @@ -# testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=default case-crc:ce3a443c -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, dim2, COUNT(*) FROM druid.foo -WHERE dim2 IN (SELECT dim1 FROM druid.foo WHERE dim1 <> '') -AND dim1 <> 'xxx' -group by dim1, dim2 ORDER BY dim2; -+------+------+--------+ -| dim1 | dim2 | EXPR$2 | -+------+------+--------+ -| def | abc | 1 | -+------+------+--------+ -(1 row) - -!ok -LogicalSort(sort0=[$1], dir0=[ASC]) - LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT()]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalFilter(condition=[<>($0, 'xxx')]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) - DruidAggregate(group=[{0, 1}], EXPR$2=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidFilter(condition=[<>($0, 'xxx')]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "xxx" - } - }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : null - } - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - }, { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d1", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "default", - "columns" : [ { - "dimension" : "d1", - "direction" : "ascending", - "dimensionOrder" : { - "type" : "lexicographic" - } - } ] - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled.iq index 208b080e226d..407f59d9fb75 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled.iq @@ -1,4 +1,4 @@ -# testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=sql case-crc:7acb032c +# testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled case-crc:7acb032c # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index 706bec28edf9..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,152 +0,0 @@ -# testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=default case-crc:7acb032c -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, dim2, COUNT(*) FROM druid.foo -WHERE dim2 IN (SELECT dim1 FROM druid.foo WHERE dim1 <> '') -AND dim1 <> 'xxx' -group by dim1, dim2 ORDER BY dim2; -+------+------+--------+ -| dim1 | dim2 | EXPR$2 | -+------+------+--------+ -| def | abc | 1 | -+------+------+--------+ -(1 row) - -!ok -LogicalSort(sort0=[$1], dir0=[ASC]) - LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT()]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalFilter(condition=[<>($0, 'xxx')]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) - DruidAggregate(group=[{0, 1}], EXPR$2=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidFilter(condition=[<>($0, 'xxx')]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "xxx" - } - }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : null - } - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - }, { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d1", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "default", - "columns" : [ { - "dimension" : "d1", - "direction" : "ascending", - "dimensionOrder" : { - "type" : "lexicographic" - } - } ] - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites.iq index 759d73986dd0..ff77ee32cdfb 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites.iq @@ -1,4 +1,4 @@ -# testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=sql case-crc:d83db91a +# testUsingSubqueryAsPartOfAndFilter@filter-rewrites case-crc:d83db91a # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index f5c84712ef52..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,152 +0,0 @@ -# testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=default case-crc:d83db91a -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, dim2, COUNT(*) FROM druid.foo -WHERE dim2 IN (SELECT dim1 FROM druid.foo WHERE dim1 <> '') -AND dim1 <> 'xxx' -group by dim1, dim2 ORDER BY dim2; -+------+------+--------+ -| dim1 | dim2 | EXPR$2 | -+------+------+--------+ -| def | abc | 1 | -+------+------+--------+ -(1 row) - -!ok -LogicalSort(sort0=[$1], dir0=[ASC]) - LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT()]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalFilter(condition=[<>($0, 'xxx')]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) - DruidAggregate(group=[{0, 1}], EXPR$2=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidFilter(condition=[<>($0, 'xxx')]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "xxx" - } - }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : null - } - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - }, { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d1", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "default", - "columns" : [ { - "dimension" : "d1", - "direction" : "ascending", - "dimensionOrder" : { - "type" : "lexicographic" - } - } ] - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@join-to-filter.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@join-to-filter.iq index cb4dd3a2e998..88b5c6f30ded 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@join-to-filter.iq @@ -1,4 +1,4 @@ -# testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=sql case-crc:d70bc6c4 +# testUsingSubqueryAsPartOfAndFilter@join-to-filter case-crc:d70bc6c4 # quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=default.iq deleted file mode 100644 index 7fca495c2b47..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,152 +0,0 @@ -# testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=default case-crc:d70bc6c4 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, dim2, COUNT(*) FROM druid.foo -WHERE dim2 IN (SELECT dim1 FROM druid.foo WHERE dim1 <> '') -AND dim1 <> 'xxx' -group by dim1, dim2 ORDER BY dim2; -+------+------+--------+ -| dim1 | dim2 | EXPR$2 | -+------+------+--------+ -| def | abc | 1 | -+------+------+--------+ -(1 row) - -!ok -LogicalSort(sort0=[$1], dir0=[ASC]) - LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT()]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalFilter(condition=[<>($0, 'xxx')]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) - DruidAggregate(group=[{0, 1}], EXPR$2=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidFilter(condition=[<>($0, 'xxx')]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "xxx" - } - }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : null - } - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - }, { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d1", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "default", - "columns" : [ { - "dimension" : "d1", - "direction" : "ascending", - "dimensionOrder" : { - "type" : "lexicographic" - } - } ] - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_disabled.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_disabled.iq index cb04db285061..742859de6273 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_disabled.iq @@ -1,4 +1,4 @@ -# testUsingSubqueryWithExtractionFns@all_disabled@NullHandling=sql case-crc:9a0f41b6 +# testUsingSubqueryWithExtractionFns@all_disabled case-crc:9a0f41b6 # quidem testcase reason: JOIN_FILTER_LOCATIONS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_disabled@NullHandling=default.iq deleted file mode 100644 index dcff8e213aee..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,139 +0,0 @@ -# testUsingSubqueryWithExtractionFns@all_disabled@NullHandling=default case-crc:9a0f41b6 -# quidem testcase reason: JOIN_FILTER_LOCATIONS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim2, COUNT(*) FROM druid.foo WHERE substring(dim2, 1, 1) IN (SELECT substring(dim1, 1, 1) FROM druid.foo WHERE dim1 <> '')group by dim2; -+------+--------+ -| dim2 | EXPR$1 | -+------+--------+ -| a | 2 | -| abc | 1 | -+------+--------+ -(2 rows) - -!ok -LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "substring(\"dim2\", 0, 1)", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "dim2", "v0" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : null - } - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "extraction", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING", - "extractionFn" : { - "type" : "substring", - "index" : 0, - "length" : 1 - } - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_enabled.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_enabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_enabled.iq index 105c345ee9c0..060c6cebfe61 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_enabled.iq @@ -1,4 +1,4 @@ -# testUsingSubqueryWithExtractionFns@all_enabled@NullHandling=sql case-crc:0562e77f +# testUsingSubqueryWithExtractionFns@all_enabled case-crc:0562e77f # quidem testcase reason: JOIN_FILTER_LOCATIONS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_enabled@NullHandling=default.iq deleted file mode 100644 index e45394da7f8f..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,139 +0,0 @@ -# testUsingSubqueryWithExtractionFns@all_enabled@NullHandling=default case-crc:0562e77f -# quidem testcase reason: JOIN_FILTER_LOCATIONS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim2, COUNT(*) FROM druid.foo WHERE substring(dim2, 1, 1) IN (SELECT substring(dim1, 1, 1) FROM druid.foo WHERE dim1 <> '')group by dim2; -+------+--------+ -| dim2 | EXPR$1 | -+------+--------+ -| a | 2 | -| abc | 1 | -+------+--------+ -(2 rows) - -!ok -LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "substring(\"dim2\", 0, 1)", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "dim2", "v0" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : null - } - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "extraction", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING", - "extractionFn" : { - "type" : "substring", - "index" : 0, - "length" : 1 - } - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@default.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@default@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@default.iq index 6dffa2cc78df..141df36c597c 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@default.iq @@ -1,4 +1,4 @@ -# testUsingSubqueryWithExtractionFns@default@NullHandling=sql case-crc:7fdb7eb2 +# testUsingSubqueryWithExtractionFns@default case-crc:7fdb7eb2 # quidem testcase reason: JOIN_FILTER_LOCATIONS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@default@NullHandling=default.iq deleted file mode 100644 index ad6509bd826e..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@default@NullHandling=default.iq +++ /dev/null @@ -1,136 +0,0 @@ -# testUsingSubqueryWithExtractionFns@default@NullHandling=default case-crc:7fdb7eb2 -# quidem testcase reason: JOIN_FILTER_LOCATIONS -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim2, COUNT(*) FROM druid.foo WHERE substring(dim2, 1, 1) IN (SELECT substring(dim1, 1, 1) FROM druid.foo WHERE dim1 <> '')group by dim2; -+------+--------+ -| dim2 | EXPR$1 | -+------+--------+ -| a | 2 | -| abc | 1 | -+------+--------+ -(2 rows) - -!ok -LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "substring(\"dim2\", 0, 1)", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "dim2", "v0" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : null - } - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "extraction", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING", - "extractionFn" : { - "type" : "substring", - "index" : 0, - "length" : 1 - } - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled.iq index 1bd6bffa1f2d..5fbb15e9710a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled.iq @@ -1,4 +1,4 @@ -# testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled@NullHandling=sql case-crc:8312764a +# testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled case-crc:8312764a # quidem testcase reason: JOIN_FILTER_LOCATIONS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index 346a65b95040..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,139 +0,0 @@ -# testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled@NullHandling=default case-crc:8312764a -# quidem testcase reason: JOIN_FILTER_LOCATIONS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim2, COUNT(*) FROM druid.foo WHERE substring(dim2, 1, 1) IN (SELECT substring(dim1, 1, 1) FROM druid.foo WHERE dim1 <> '')group by dim2; -+------+--------+ -| dim2 | EXPR$1 | -+------+--------+ -| a | 2 | -| abc | 1 | -+------+--------+ -(2 rows) - -!ok -LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "substring(\"dim2\", 0, 1)", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "dim2", "v0" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : null - } - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "extraction", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING", - "extractionFn" : { - "type" : "substring", - "index" : 0, - "length" : 1 - } - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites-disabled.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites-disabled@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites-disabled.iq index b27b5b8cb573..ea1ef086fa65 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites-disabled.iq @@ -1,4 +1,4 @@ -# testUsingSubqueryWithExtractionFns@filter-rewrites-disabled@NullHandling=sql case-crc:75a02bd6 +# testUsingSubqueryWithExtractionFns@filter-rewrites-disabled case-crc:75a02bd6 # quidem testcase reason: JOIN_FILTER_LOCATIONS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index 9b72fc597c0a..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,139 +0,0 @@ -# testUsingSubqueryWithExtractionFns@filter-rewrites-disabled@NullHandling=default case-crc:75a02bd6 -# quidem testcase reason: JOIN_FILTER_LOCATIONS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim2, COUNT(*) FROM druid.foo WHERE substring(dim2, 1, 1) IN (SELECT substring(dim1, 1, 1) FROM druid.foo WHERE dim1 <> '')group by dim2; -+------+--------+ -| dim2 | EXPR$1 | -+------+--------+ -| a | 2 | -| abc | 1 | -+------+--------+ -(2 rows) - -!ok -LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "substring(\"dim2\", 0, 1)", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "dim2", "v0" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : null - } - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "extraction", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING", - "extractionFn" : { - "type" : "substring", - "index" : 0, - "length" : 1 - } - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites.iq index c03d202cdaee..072f68d2bf8f 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites.iq @@ -1,4 +1,4 @@ -# testUsingSubqueryWithExtractionFns@filter-rewrites@NullHandling=sql case-crc:59cbfae8 +# testUsingSubqueryWithExtractionFns@filter-rewrites case-crc:59cbfae8 # quidem testcase reason: JOIN_FILTER_LOCATIONS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index c2c40dc99523..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,139 +0,0 @@ -# testUsingSubqueryWithExtractionFns@filter-rewrites@NullHandling=default case-crc:59cbfae8 -# quidem testcase reason: JOIN_FILTER_LOCATIONS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim2, COUNT(*) FROM druid.foo WHERE substring(dim2, 1, 1) IN (SELECT substring(dim1, 1, 1) FROM druid.foo WHERE dim1 <> '')group by dim2; -+------+--------+ -| dim2 | EXPR$1 | -+------+--------+ -| a | 2 | -| abc | 1 | -+------+--------+ -(2 rows) - -!ok -LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "substring(\"dim2\", 0, 1)", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "dim2", "v0" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : null - } - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "extraction", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING", - "extractionFn" : { - "type" : "substring", - "index" : 0, - "length" : 1 - } - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@join-to-filter.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@join-to-filter@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@join-to-filter.iq index 40229ea1ec11..a51c482ab8c3 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@join-to-filter.iq @@ -1,4 +1,4 @@ -# testUsingSubqueryWithExtractionFns@join-to-filter@NullHandling=sql case-crc:7dafda1a +# testUsingSubqueryWithExtractionFns@join-to-filter case-crc:7dafda1a # quidem testcase reason: JOIN_FILTER_LOCATIONS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@join-to-filter@NullHandling=default.iq deleted file mode 100644 index b08872faf7d7..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,139 +0,0 @@ -# testUsingSubqueryWithExtractionFns@join-to-filter@NullHandling=default case-crc:7dafda1a -# quidem testcase reason: JOIN_FILTER_LOCATIONS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim2, COUNT(*) FROM druid.foo WHERE substring(dim2, 1, 1) IN (SELECT substring(dim1, 1, 1) FROM druid.foo WHERE dim1 <> '')group by dim2; -+------+--------+ -| dim2 | EXPR$1 | -+------+--------+ -| a | 2 | -| abc | 1 | -+------+--------+ -(2 rows) - -!ok -LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "substring(\"dim2\", 0, 1)", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "dim2", "v0" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : null - } - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "extraction", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING", - "extractionFn" : { - "type" : "substring", - "index" : 0, - "length" : 1 - } - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators.iq similarity index 96% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators.iq index 636b96669464..e00656d37a46 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators.iq @@ -1,4 +1,4 @@ -# testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=sql case-crc:f03f8870 +# testExactCountDistinctWithGroupingAndOtherAggregators case-crc:f03f8870 # quidem testcase reason: AGG_COL_EXCHANGE !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=default.iq deleted file mode 100644 index 70979223a8e8..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=default.iq +++ /dev/null @@ -1,108 +0,0 @@ -# testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=default case-crc:f03f8870 -# quidem testcase reason: AGG_COL_EXCHANGE -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set useApproximateCountDistinct false -!set outputformat mysql -!use druidtest:/// -SELECT dim2, SUM(cnt), COUNT(distinct dim1) FROM druid.foo GROUP BY dim2; -+------+--------+--------+ -| dim2 | EXPR$1 | EXPR$2 | -+------+--------+--------+ -| | 3 | 3 | -| a | 2 | 1 | -| abc | 1 | 1 | -+------+--------+--------+ -(3 rows) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[SUM($2)], EXPR$2=[COUNT($0)]) - LogicalAggregate(group=[{1, 2}], EXPR$1=[SUM($4)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[SUM($2)], EXPR$2=[COUNT($0)], druid=[logical]) - DruidAggregate(group=[{1, 2}], EXPR$1=[SUM($4)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - }, { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d1", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "longSum", - "name" : "a0", - "fieldName" : "cnt" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "d1", - "outputName" : "_d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "longSum", - "name" : "_a0", - "fieldName" : "a0" - }, { - "type" : "filtered", - "aggregator" : { - "type" : "count", - "name" : "_a1" - }, - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "d0", - "value" : null - } - }, - "name" : "_a1" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction.iq similarity index 96% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction.iq index 1f49a1cb53ee..54168ecab95d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction.iq @@ -1,4 +1,4 @@ -# testGroupByLimitPushdownExtraction@NullHandling=sql case-crc:006ffd2b +# testGroupByLimitPushdownExtraction case-crc:006ffd2b # quidem testcase reason: IMPROVED_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=default.iq deleted file mode 100644 index ee8ff3e4ed42..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=default.iq +++ /dev/null @@ -1,84 +0,0 @@ -# testGroupByLimitPushdownExtraction@NullHandling=default case-crc:006ffd2b -# quidem testcase reason: IMPROVED_PLAN -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim4, substring(dim5, 1, 1), count(*) FROM druid.numfoo WHERE dim4 = 'a' GROUP BY 1,2 LIMIT 2; -+------+--------+--------+ -| dim4 | EXPR$1 | EXPR$2 | -+------+--------+--------+ -| a | a | 2 | -| a | b | 1 | -+------+--------+--------+ -(2 rows) - -!ok -LogicalProject(dim4=[CAST('a':VARCHAR):VARCHAR], EXPR$1=[$0], EXPR$2=[$1]) - LogicalSort(fetch=[2]) - LogicalAggregate(group=[{0}], EXPR$2=[COUNT()]) - LogicalProject(EXPR$1=[SUBSTRING($5, 1, 1)]) - LogicalFilter(condition=[=($4, 'a')]) - LogicalTableScan(table=[[druid, numfoo]]) - -!logicalPlan -DruidProject(dim4=[CAST('a':VARCHAR):VARCHAR], EXPR$1=[$0], EXPR$2=[$1], druid=[logical]) - DruidSort(fetch=[2], druid=[logical]) - DruidAggregate(group=[{0}], EXPR$2=[COUNT()], druid=[logical]) - DruidProject(EXPR$1=[SUBSTRING($5, 1, 1)], druid=[logical]) - DruidFilter(condition=[=($4, 'a')]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "topN", - "dataSource" : { - "type" : "table", - "name" : "numfoo" - }, - "dimension" : { - "type" : "extraction", - "dimension" : "dim5", - "outputName" : "d0", - "outputType" : "STRING", - "extractionFn" : { - "type" : "substring", - "index" : 0, - "length" : 1 - } - }, - "metric" : { - "type" : "dimension", - "ordering" : { - "type" : "lexicographic" - } - }, - "threshold" : 2, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "selector", - "dimension" : "dim4", - "value" : "a" - }, - "granularity" : { - "type" : "all" - }, - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "postAggregations" : [ { - "type" : "expression", - "name" : "s0", - "expression" : "'a'", - "outputType" : "STRING" - } ] -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByTimeFloorAndDimOnGroupByTimeFloorAndDim@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByTimeFloorAndDimOnGroupByTimeFloorAndDim.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByTimeFloorAndDimOnGroupByTimeFloorAndDim@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByTimeFloorAndDimOnGroupByTimeFloorAndDim.iq index 5105e214557d..d3e26335e788 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByTimeFloorAndDimOnGroupByTimeFloorAndDim@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByTimeFloorAndDimOnGroupByTimeFloorAndDim.iq @@ -1,4 +1,4 @@ -# testGroupByTimeFloorAndDimOnGroupByTimeFloorAndDim@NullHandling=sql case-crc:d9fe7bd2 +# testGroupByTimeFloorAndDimOnGroupByTimeFloorAndDim case-crc:d9fe7bd2 # quidem testcase reason: IMPROVED_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByTimeFloorAndDimOnGroupByTimeFloorAndDim@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByTimeFloorAndDimOnGroupByTimeFloorAndDim@NullHandling=default.iq deleted file mode 100644 index eb4bdee0c2fc..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByTimeFloorAndDimOnGroupByTimeFloorAndDim@NullHandling=default.iq +++ /dev/null @@ -1,147 +0,0 @@ -# testGroupByTimeFloorAndDimOnGroupByTimeFloorAndDim@NullHandling=default case-crc:d9fe7bd2 -# quidem testcase reason: IMPROVED_PLAN -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim2, time_floor(gran, 'P1M') gran, sum(s) -FROM (SELECT time_floor(__time, 'P1D') AS gran, dim2, sum(m1) as s FROM druid.foo GROUP BY 1, 2 HAVING sum(m1) > 1) AS x -GROUP BY 1, 2 -ORDER BY dim2, gran desc; -+------+-------------------------+--------+ -| dim2 | gran | EXPR$2 | -+------+-------------------------+--------+ -| | 2001-01-01 00:00:00.000 | 6.0 | -| | 2000-01-01 00:00:00.000 | 5.0 | -| a | 2001-01-01 00:00:00.000 | 4.0 | -| abc | 2001-01-01 00:00:00.000 | 5.0 | -+------+-------------------------+--------+ -(4 rows) - -!ok -LogicalSort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[DESC]) - LogicalAggregate(group=[{0, 1}], EXPR$2=[SUM($2)]) - LogicalProject(dim2=[$1], gran=[TIME_FLOOR($0, 'P1M')], s=[$2]) - LogicalFilter(condition=[>($2, 1)]) - LogicalAggregate(group=[{0, 1}], s=[SUM($2)]) - LogicalProject(gran=[TIME_FLOOR($0, 'P1D')], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidSort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[DESC], druid=[logical]) - DruidAggregate(group=[{0, 1}], EXPR$2=[SUM($2)], druid=[logical]) - DruidProject(dim2=[$1], gran=[TIME_FLOOR($0, 'P1M')], s=[$2], druid=[logical]) - DruidFilter(condition=[>($2, 1)]) - DruidAggregate(group=[{0, 1}], s=[SUM($2)], druid=[logical]) - DruidProject(gran=[TIME_FLOOR($0, 'P1D')], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "timestamp_floor(\"__time\",'P1D',null,'UTC')", - "outputType" : "LONG" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "LONG" - }, { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d1", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "doubleSum", - "name" : "a0", - "fieldName" : "m1" - } ], - "having" : { - "type" : "filter", - "filter" : { - "type" : "bound", - "dimension" : "a0", - "lower" : "1", - "lowerStrict" : true, - "ordering" : { - "type" : "numeric" - } - }, - "finalize" : true - }, - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "timestamp_floor(\"d0\",'P1M',null,'UTC')", - "outputType" : "LONG" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "d1", - "outputName" : "_d0", - "outputType" : "STRING" - }, { - "type" : "default", - "dimension" : "v0", - "outputName" : "_d1", - "outputType" : "LONG" - } ], - "aggregations" : [ { - "type" : "doubleSum", - "name" : "_a0", - "fieldName" : "a0" - } ], - "limitSpec" : { - "type" : "default", - "columns" : [ { - "dimension" : "_d0", - "direction" : "ascending", - "dimensionOrder" : { - "type" : "lexicographic" - } - }, { - "dimension" : "_d1", - "direction" : "descending", - "dimensionOrder" : { - "type" : "numeric" - } - } ] - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin.iq index 315013109433..da50aed8e468 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin.iq @@ -1,4 +1,4 @@ -# testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=sql case-crc:65809f91 +# testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin case-crc:65809f91 # quidem testcase reason: AGG_COL_EXCHANGE !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=default.iq deleted file mode 100644 index 2fe7189d611e..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=default.iq +++ /dev/null @@ -1,231 +0,0 @@ -# testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=default case-crc:65809f91 -# quidem testcase reason: AGG_COL_EXCHANGE -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set useApproximateCountDistinct false -!set outputformat mysql -!use druidtest:/// -SELECT dim2, COUNT(*), COUNT(distinct dim1), COUNT(distinct cnt) FROM druid.foo GROUP BY dim2; -+------+--------+--------+--------+ -| dim2 | EXPR$1 | EXPR$2 | EXPR$3 | -+------+--------+--------+--------+ -| | 3 | 3 | 1 | -| a | 2 | 1 | 1 | -| abc | 1 | 1 | 1 | -+------+--------+--------+--------+ -(3 rows) - -!ok -LogicalProject(dim2=[$0], EXPR$1=[$1], EXPR$2=[$3], EXPR$3=[$5]) - LogicalJoin(condition=[IS NOT DISTINCT FROM($0, $4)], joinType=[inner]) - LogicalJoin(condition=[IS NOT DISTINCT FROM($0, $2)], joinType=[inner]) - LogicalAggregate(group=[{2}], EXPR$1=[COUNT()]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}], EXPR$2=[COUNT($0)]) - LogicalAggregate(group=[{1, 2}]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}], EXPR$3=[COUNT($1)]) - LogicalAggregate(group=[{2, 4}]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim2=[$0], EXPR$1=[$1], EXPR$2=[$3], EXPR$3=[$5], druid=[logical]) - DruidJoin(condition=[IS NOT DISTINCT FROM($0, $4)], joinType=[inner]) - DruidJoin(condition=[IS NOT DISTINCT FROM($0, $2)], joinType=[inner]) - DruidAggregate(group=[{2}], EXPR$1=[COUNT()], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], EXPR$2=[COUNT($0)], druid=[logical]) - DruidAggregate(group=[{1, 2}], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], EXPR$3=[COUNT($1)], druid=[logical]) - DruidAggregate(group=[{2, 4}], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - }, { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d1", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "d1", - "outputName" : "_d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "filtered", - "aggregator" : { - "type" : "count", - "name" : "a0" - }, - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "d0", - "value" : null - } - }, - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "notdistinctfrom(\"d0\",\"j0._d0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d0", - "outputType" : "STRING" - }, { - "type" : "default", - "dimension" : "cnt", - "outputName" : "d1", - "outputType" : "LONG" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "d0", - "outputName" : "_d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "notdistinctfrom(\"d0\",\"_j0._d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "d0", "a0", "j0.a0", "_j0.a0" ], - "columnTypes" : [ "STRING", "LONG", "LONG", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals.iq index b464b19c371a..a2f6deeb97dc 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals.iq @@ -1,4 +1,4 @@ -# testSubqueryTypeMismatchWithLiterals@NullHandling=sql case-crc:e7079756 +# testSubqueryTypeMismatchWithLiterals case-crc:e7079756 # quidem testcase reason: AGGREGATE_REMOVE_NOT_FIRED !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=default.iq deleted file mode 100644 index e84db59af531..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=default.iq +++ /dev/null @@ -1,110 +0,0 @@ -# testSubqueryTypeMismatchWithLiterals@NullHandling=default case-crc:e7079756 -# quidem testcase reason: AGGREGATE_REMOVE_NOT_FIRED -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT - dim1, - SUM(CASE WHEN sum_l1 = 0 THEN 1 ELSE 0 END) AS outer_l1 -from ( - select - dim1, - SUM(l1) as sum_l1 - from numfoo - group by dim1 -) -group by 1; -+------+----------+ -| dim1 | outer_l1 | -+------+----------+ -| | 0 | -| 1 | 1 | -| 10.1 | 0 | -| 2 | 1 | -| abc | 1 | -| def | 1 | -+------+----------+ -(6 rows) - -!ok -LogicalAggregate(group=[{0}], outer_l1=[COUNT() FILTER $1]) - LogicalProject(dim1=[$0], $f2=[=($1, 0)]) - LogicalAggregate(group=[{1}], sum_l1=[SUM($11)]) - LogicalTableScan(table=[[druid, numfoo]]) - -!logicalPlan -DruidAggregate(group=[{0}], outer_l1=[COUNT() FILTER $1], druid=[logical]) - DruidProject(dim1=[$0], $f2=[=($1, 0)], druid=[logical]) - DruidAggregate(group=[{1}], sum_l1=[SUM($11)], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "numfoo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "_d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "longSum", - "name" : "a0", - "fieldName" : "l1" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "_d0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "filtered", - "aggregator" : { - "type" : "count", - "name" : "_a0" - }, - "filter" : { - "type" : "selector", - "dimension" : "a0", - "value" : "0" - }, - "name" : "_a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery.iq similarity index 97% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery.iq index 7906b3d4c0fd..108ba0648a52 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery.iq @@ -1,4 +1,4 @@ -# testTimeFilterOnSubquery@NullHandling=sql case-crc:73448efc +# testTimeFilterOnSubquery case-crc:73448efc # quidem testcase reason: EQUIV_PLAN_EXTRA_COLUMNS !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=default.iq deleted file mode 100644 index c864ecb8df14..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=default.iq +++ /dev/null @@ -1,92 +0,0 @@ -# testTimeFilterOnSubquery@NullHandling=default case-crc:73448efc -# quidem testcase reason: EQUIV_PLAN_EXTRA_COLUMNS -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT __time, m1 FROM (SELECT * FROM "foo" LIMIT 100) -WHERE TIME_IN_INTERVAL(__time, '2000/P1D') OR TIME_IN_INTERVAL(__time, '2001/P1D'); -+-------------------------+-----+ -| __time | m1 | -+-------------------------+-----+ -| 2000-01-01 00:00:00.000 | 1.0 | -| 2001-01-01 00:00:00.000 | 4.0 | -+-------------------------+-----+ -(2 rows) - -!ok -LogicalProject(__time=[$0], m1=[$5]) - LogicalFilter(condition=[SEARCH($0, Sarg[[2000-01-01 00:00:00:TIMESTAMP(3)..2000-01-02 00:00:00:TIMESTAMP(3)), [2001-01-01 00:00:00:TIMESTAMP(3)..2001-01-02 00:00:00:TIMESTAMP(3))]:TIMESTAMP(3))]) - LogicalSort(fetch=[100]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(__time=[$0], m1=[$5], druid=[logical]) - DruidFilter(condition=[SEARCH($0, Sarg[[2000-01-01 00:00:00:TIMESTAMP(3)..2000-01-02 00:00:00:TIMESTAMP(3)), [2001-01-01 00:00:00:TIMESTAMP(3)..2001-01-02 00:00:00:TIMESTAMP(3))]:TIMESTAMP(3))]) - DruidSort(fetch=[100], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "limit" : 100, - "columns" : [ "__time", "dim1", "dim2", "dim3", "cnt", "m1", "m2", "unique_dim1" ], - "columnTypes" : [ "LONG", "STRING", "STRING", "STRING", "LONG", "FLOAT", "DOUBLE", "COMPLEX" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "bound", - "dimension" : "__time", - "lower" : "946684800000", - "upper" : "946771200000", - "upperStrict" : true, - "ordering" : { - "type" : "numeric" - } - }, { - "type" : "bound", - "dimension" : "__time", - "lower" : "978307200000", - "upper" : "978393600000", - "upperStrict" : true, - "ordering" : { - "type" : "numeric" - } - } ] - }, - "columns" : [ "__time", "m1" ], - "columnTypes" : [ "LONG", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort.iq similarity index 98% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort.iq index 3eb700c018fd..e5598d562450 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort.iq @@ -1,4 +1,4 @@ -# testWindowingWithScanAndSort@NullHandling=sql case-crc:45108080 +# testWindowingWithScanAndSort case-crc:45108080 # quidem testcase reason: SLIGHTLY_WORSE_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=default.iq deleted file mode 100644 index a893185365e6..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=default.iq +++ /dev/null @@ -1,190 +0,0 @@ -# testWindowingWithScanAndSort@NullHandling=default case-crc:45108080 -# quidem testcase reason: SLIGHTLY_WORSE_PLAN -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with t AS ( -SELECT - RANK() OVER (PARTITION BY m2 ORDER BY m2 ASC) - AS ranking, - COUNT(m1) as trend_score -FROM foo -GROUP BY m2,m1 LIMIT 10 -) -select ranking, trend_score from t ORDER BY trend_score; -+---------+-------------+ -| ranking | trend_score | -+---------+-------------+ -| 1 | 1 | -| 1 | 1 | -| 1 | 1 | -| 1 | 1 | -| 1 | 1 | -| 1 | 1 | -+---------+-------------+ -(6 rows) - -!ok -LogicalProject(ranking=[$2], trend_score=[$1]) - LogicalSort(sort0=[$1], dir0=[ASC]) - LogicalSort(fetch=[10]) - LogicalWindow(window#0=[window(partition {0} order by [0] aggs [RANK()])]) - LogicalProject(m2=[$1], trend_score=[$2]) - LogicalAggregate(group=[{5, 6}], trend_score=[COUNT()]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(ranking=[$2], trend_score=[$1], druid=[logical]) - DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) - DruidSort(fetch=[10], druid=[logical]) - DruidWindow(window#0=[window(partition {0} order by [0] aggs [RANK()])]) - DruidProject(m2=[$1], trend_score=[$2], druid=[logical]) - DruidAggregate(group=[{5, 6}], trend_score=[COUNT()], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "windowOperator", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "windowOperator", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "m1", - "outputName" : "d0", - "outputType" : "FLOAT" - }, { - "type" : "default", - "dimension" : "m2", - "outputName" : "d1", - "outputType" : "DOUBLE" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "LegacySegmentSpec", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "outputSignature" : [ { - "name" : "d1", - "type" : "DOUBLE" - }, { - "name" : "a0", - "type" : "LONG" - }, { - "name" : "w0", - "type" : "LONG" - } ], - "operatorDefinition" : [ { - "type" : "naiveSort", - "columns" : [ { - "column" : "d1", - "direction" : "ASC" - } ] - }, { - "type" : "naivePartition", - "partitionColumns" : [ "d1" ] - }, { - "type" : "window", - "processor" : { - "type" : "rank", - "group" : [ "d1" ], - "outputColumn" : "w0", - "asPercent" : false - } - } ], - "leafOperators" : [ ], - "granularity" : { - "type" : "all" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "limit" : 10, - "columns" : [ "d1", "a0", "w0" ], - "columnTypes" : [ "DOUBLE", "LONG", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "intervals" : { - "type" : "LegacySegmentSpec", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "outputSignature" : [ { - "name" : "w0", - "type" : "LONG" - }, { - "name" : "a0", - "type" : "LONG" - } ], - "operatorDefinition" : [ { - "type" : "naiveSort", - "columns" : [ { - "column" : "a0", - "direction" : "ASC" - } ] - }, { - "type" : "scan", - "timeRange" : null, - "filter" : null, - "offsetLimit" : null, - "projectedColumns" : [ "w0", "a0" ], - "virtualColumns" : null, - "ordering" : null - } ], - "leafOperators" : [ { - "type" : "scan", - "timeRange" : null, - "filter" : null, - "offsetLimit" : { - "offset" : 0, - "limit" : 9223372036854775807 - }, - "projectedColumns" : [ "w0", "a0" ], - "virtualColumns" : null, - "ordering" : null - } ], - "granularity" : { - "type" : "all" - } -} -!nativePlan