Search in sources :

Example 1 with AND

use of com.facebook.presto.spi.relation.SpecialFormExpression.Form.AND in project presto by prestodb.

the class OrcSelectivePageSourceFactory method toFilterFunctions.

/**
 * Split filter expression into groups of conjuncts that depend on the same set of inputs,
 * then compile each group into FilterFunction.
 */
private static List<FilterFunction> toFilterFunctions(RowExpression filter, Optional<BucketAdapter> bucketAdapter, ConnectorSession session, DeterminismEvaluator determinismEvaluator, PredicateCompiler predicateCompiler) {
    ImmutableList.Builder<FilterFunction> filterFunctions = ImmutableList.builder();
    bucketAdapter.map(predicate -> new FilterFunction(session.getSqlFunctionProperties(), true, predicate)).ifPresent(filterFunctions::add);
    if (TRUE_CONSTANT.equals(filter)) {
        return filterFunctions.build();
    }
    DynamicFilterExtractResult extractDynamicFilterResult = extractDynamicFilters(filter);
    // dynamic filter will be added through subfield pushdown
    filter = and(extractDynamicFilterResult.getStaticConjuncts());
    if (!isAdaptiveFilterReorderingEnabled(session)) {
        filterFunctions.add(new FilterFunction(session.getSqlFunctionProperties(), determinismEvaluator.isDeterministic(filter), predicateCompiler.compilePredicate(session.getSqlFunctionProperties(), session.getSessionFunctions(), filter).get()));
        return filterFunctions.build();
    }
    List<RowExpression> conjuncts = extractConjuncts(filter);
    if (conjuncts.size() == 1) {
        filterFunctions.add(new FilterFunction(session.getSqlFunctionProperties(), determinismEvaluator.isDeterministic(filter), predicateCompiler.compilePredicate(session.getSqlFunctionProperties(), session.getSessionFunctions(), filter).get()));
        return filterFunctions.build();
    }
    // Use LinkedHashMap to preserve user-specified order of conjuncts. This will be the initial order in which filters are applied.
    Map<Set<Integer>, List<RowExpression>> inputsToConjuncts = new LinkedHashMap<>();
    for (RowExpression conjunct : conjuncts) {
        inputsToConjuncts.computeIfAbsent(extractInputs(conjunct), k -> new ArrayList<>()).add(conjunct);
    }
    inputsToConjuncts.values().stream().map(expressions -> binaryExpression(AND, expressions)).map(predicate -> new FilterFunction(session.getSqlFunctionProperties(), determinismEvaluator.isDeterministic(predicate), predicateCompiler.compilePredicate(session.getSqlFunctionProperties(), session.getSessionFunctions(), predicate).get())).forEach(filterFunctions::add);
    return filterFunctions.build();
}
Also used : LogicalRowExpressions.extractConjuncts(com.facebook.presto.expressions.LogicalRowExpressions.extractConjuncts) Page(com.facebook.presto.common.Page) HiveCoercer(com.facebook.presto.hive.HiveCoercer) DateTimeZone(org.joda.time.DateTimeZone) Arrays(java.util.Arrays) Maps.uniqueIndex(com.google.common.collect.Maps.uniqueIndex) FixedPageSource(com.facebook.presto.spi.FixedPageSource) AGGREGATED(com.facebook.presto.hive.HiveColumnHandle.ColumnType.AGGREGATED) Configuration(org.apache.hadoop.conf.Configuration) Map(java.util.Map) Predicate(com.facebook.presto.common.relation.Predicate) HiveSessionProperties.isOrcBloomFiltersEnabled(com.facebook.presto.hive.HiveSessionProperties.isOrcBloomFiltersEnabled) OrcDataSource(com.facebook.presto.orc.OrcDataSource) FileFormatDataSourceStats(com.facebook.presto.hive.FileFormatDataSourceStats) FSDataInputStream(org.apache.hadoop.fs.FSDataInputStream) SqlFunctionProperties(com.facebook.presto.common.function.SqlFunctionProperties) HiveSessionProperties.isOrcZstdJniDecompressionEnabled(com.facebook.presto.hive.HiveSessionProperties.isOrcZstdJniDecompressionEnabled) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) Set(java.util.Set) HiveFileContext(com.facebook.presto.hive.HiveFileContext) ConnectorSession(com.facebook.presto.spi.ConnectorSession) ORC(com.facebook.presto.orc.OrcEncoding.ORC) ImmutableMap.toImmutableMap(com.google.common.collect.ImmutableMap.toImmutableMap) DefaultRowExpressionTraversalVisitor(com.facebook.presto.expressions.DefaultRowExpressionTraversalVisitor) REGULAR(com.facebook.presto.hive.HiveColumnHandle.ColumnType.REGULAR) DwrfKeyProvider(com.facebook.presto.orc.DwrfKeyProvider) OrcReaderOptions(com.facebook.presto.orc.OrcReaderOptions) BucketAdaptation(com.facebook.presto.hive.BucketAdaptation) ArrayList(java.util.ArrayList) LinkedHashMap(java.util.LinkedHashMap) DwrfEncryptionProvider(com.facebook.presto.orc.DwrfEncryptionProvider) OrcDataSourceId(com.facebook.presto.orc.OrcDataSourceId) HIVE_INVALID_BUCKET_FILES(com.facebook.presto.hive.HiveErrorCode.HIVE_INVALID_BUCKET_FILES) OrcSelectiveRecordReader(com.facebook.presto.orc.OrcSelectiveRecordReader) SubfieldExtractor(com.facebook.presto.hive.SubfieldExtractor) LogicalRowExpressions.and(com.facebook.presto.expressions.LogicalRowExpressions.and) IOException(java.io.IOException) HiveBucketing.getHiveBucket(com.facebook.presto.hive.HiveBucketing.getHiveBucket) OrcReader(com.facebook.presto.orc.OrcReader) DynamicFilters.extractDynamicFilters(com.facebook.presto.expressions.DynamicFilters.extractDynamicFilters) HdfsEnvironment(com.facebook.presto.hive.HdfsEnvironment) TupleDomainOrcPredicate(com.facebook.presto.orc.TupleDomainOrcPredicate) VariableReferenceExpression(com.facebook.presto.spi.relation.VariableReferenceExpression) HiveSessionProperties.getOrcTinyStripeThreshold(com.facebook.presto.hive.HiveSessionProperties.getOrcTinyStripeThreshold) StandardFunctionResolution(com.facebook.presto.spi.function.StandardFunctionResolution) OrcSerde(org.apache.hadoop.hive.ql.io.orc.OrcSerde) Preconditions.checkArgument(com.google.common.base.Preconditions.checkArgument) HiveSessionProperties.getOrcLazyReadSmallRanges(com.facebook.presto.hive.HiveSessionProperties.getOrcLazyReadSmallRanges) AND(com.facebook.presto.spi.relation.SpecialFormExpression.Form.AND) Path(org.apache.hadoop.fs.Path) EncryptionInformation(com.facebook.presto.hive.EncryptionInformation) CallExpression(com.facebook.presto.spi.relation.CallExpression) SpecialFormExpression(com.facebook.presto.spi.relation.SpecialFormExpression) BiMap(com.google.common.collect.BiMap) HiveClientConfig(com.facebook.presto.hive.HiveClientConfig) StripeMetadataSourceFactory(com.facebook.presto.orc.StripeMetadataSourceFactory) ImmutableSet(com.google.common.collect.ImmutableSet) ImmutableMap(com.google.common.collect.ImmutableMap) Collection(java.util.Collection) INITIAL_BATCH_SIZE(com.facebook.presto.orc.OrcReader.INITIAL_BATCH_SIZE) OrcPredicate(com.facebook.presto.orc.OrcPredicate) FileNotFoundException(java.io.FileNotFoundException) TRUE_CONSTANT(com.facebook.presto.expressions.LogicalRowExpressions.TRUE_CONSTANT) HiveSessionProperties.isAdaptiveFilterReorderingEnabled(com.facebook.presto.hive.HiveSessionProperties.isAdaptiveFilterReorderingEnabled) String.format(java.lang.String.format) DataSize(io.airlift.units.DataSize) List(java.util.List) RowExpressionService(com.facebook.presto.spi.relation.RowExpressionService) HiveOrcAggregatedMemoryContext(com.facebook.presto.hive.HiveOrcAggregatedMemoryContext) HiveSelectivePageSourceFactory(com.facebook.presto.hive.HiveSelectivePageSourceFactory) Optional(java.util.Optional) LogicalRowExpressions.binaryExpression(com.facebook.presto.expressions.LogicalRowExpressions.binaryExpression) HiveColumnHandle(com.facebook.presto.hive.HiveColumnHandle) PredicateCompiler(com.facebook.presto.spi.relation.PredicateCompiler) InputReferenceExpression(com.facebook.presto.spi.relation.InputReferenceExpression) IntStream(java.util.stream.IntStream) DynamicFilterExtractResult(com.facebook.presto.expressions.DynamicFilters.DynamicFilterExtractResult) DeterminismEvaluator(com.facebook.presto.spi.relation.DeterminismEvaluator) HiveSessionProperties.getOrcMaxMergeDistance(com.facebook.presto.hive.HiveSessionProperties.getOrcMaxMergeDistance) Strings.nullToEmpty(com.google.common.base.Strings.nullToEmpty) HiveType(com.facebook.presto.hive.HiveType) HashMap(java.util.HashMap) PrestoException(com.facebook.presto.spi.PrestoException) Function(java.util.function.Function) HIVE_CANNOT_OPEN_SPLIT(com.facebook.presto.hive.HiveErrorCode.HIVE_CANNOT_OPEN_SPLIT) HIVE_MISSING_DATA(com.facebook.presto.hive.HiveErrorCode.HIVE_MISSING_DATA) HiveSessionProperties.getOrcMaxReadBlockSize(com.facebook.presto.hive.HiveSessionProperties.getOrcMaxReadBlockSize) ImmutableBiMap(com.google.common.collect.ImmutableBiMap) Inject(javax.inject.Inject) HashSet(java.util.HashSet) Subfield(com.facebook.presto.common.Subfield) ImmutableList(com.google.common.collect.ImmutableList) Verify.verify(com.google.common.base.Verify.verify) UncheckedExecutionException(com.google.common.util.concurrent.UncheckedExecutionException) FilterFunction(com.facebook.presto.common.predicate.FilterFunction) TypeManager(com.facebook.presto.common.type.TypeManager) HiveSessionProperties.getOrcMaxBufferSize(com.facebook.presto.hive.HiveSessionProperties.getOrcMaxBufferSize) Objects.requireNonNull(java.util.Objects.requireNonNull) OrcFileTailSource(com.facebook.presto.orc.cache.OrcFileTailSource) Type(com.facebook.presto.common.type.Type) RowExpression(com.facebook.presto.spi.relation.RowExpression) Storage(com.facebook.presto.hive.metastore.Storage) OrcAggregatedMemoryContext(com.facebook.presto.orc.OrcAggregatedMemoryContext) OrcEncoding(com.facebook.presto.orc.OrcEncoding) HiveSessionProperties.getOrcStreamBufferSize(com.facebook.presto.hive.HiveSessionProperties.getOrcStreamBufferSize) NO_ENCRYPTION(com.facebook.presto.orc.DwrfEncryptionProvider.NO_ENCRYPTION) Maps(com.google.common.collect.Maps) TupleDomain(com.facebook.presto.common.predicate.TupleDomain) TupleDomainFilter(com.facebook.presto.common.predicate.TupleDomainFilter) TypeInfo(org.apache.hadoop.hive.serde2.typeinfo.TypeInfo) Consumer(java.util.function.Consumer) HiveUtil.typedPartitionKey(com.facebook.presto.hive.HiveUtil.typedPartitionKey) ConnectorPageSource(com.facebook.presto.spi.ConnectorPageSource) HiveUtil.getPhysicalHiveColumnHandles(com.facebook.presto.hive.HiveUtil.getPhysicalHiveColumnHandles) ImmutableBiMap.toImmutableBiMap(com.google.common.collect.ImmutableBiMap.toImmutableBiMap) RowExpressionNodeInliner.replaceExpression(com.facebook.presto.expressions.RowExpressionNodeInliner.replaceExpression) FilterFunction(com.facebook.presto.common.predicate.FilterFunction) Set(java.util.Set) ImmutableSet(com.google.common.collect.ImmutableSet) HashSet(java.util.HashSet) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) ImmutableList(com.google.common.collect.ImmutableList) ArrayList(java.util.ArrayList) RowExpression(com.facebook.presto.spi.relation.RowExpression) LinkedHashMap(java.util.LinkedHashMap) DynamicFilterExtractResult(com.facebook.presto.expressions.DynamicFilters.DynamicFilterExtractResult) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) ArrayList(java.util.ArrayList) List(java.util.List) ImmutableList(com.google.common.collect.ImmutableList)

Example 2 with AND

use of com.facebook.presto.spi.relation.SpecialFormExpression.Form.AND in project presto by prestodb.

the class TestLogicalRowExpressions method testBigExpressions.

@Test
public void testBigExpressions() {
    // Do not expand big list (a0 && b0) || (a1 && b1) || ....
    RowExpression bigExpression = or(IntStream.range(0, 1000).boxed().map(i -> and(name("a" + i), name("b" + i))).toArray(RowExpression[]::new));
    assertEquals(logicalRowExpressions.convertToConjunctiveNormalForm(bigExpression), bigExpression);
    // extract common predicates on (a && b0) || (a && b1) || ....
    RowExpression bigExpressionWithCommonPredicate = or(IntStream.range(0, 10001).boxed().map(i -> and(name("a"), name("b" + i))).toArray(RowExpression[]::new));
    assertEquals(logicalRowExpressions.convertToConjunctiveNormalForm(bigExpressionWithCommonPredicate), or(IntStream.range(0, 10001).boxed().map(i -> and(name("a"), name("b" + i))).toArray(RowExpression[]::new)));
    // a || (a && b0) || (a && b1) || ... can be simplified to a but if conjunctive is very large, we will skip reduction.
    assertEquals(logicalRowExpressions.convertToConjunctiveNormalForm(or(a, bigExpressionWithCommonPredicate)), or(Stream.concat(Stream.of(name("a")), IntStream.range(0, 10001).boxed().map(i -> and(name("a"), name("b" + i)))).toArray(RowExpression[]::new)));
    assertEquals(logicalRowExpressions.convertToDisjunctiveNormalForm(or(a, bigExpressionWithCommonPredicate)), or(Stream.concat(Stream.of(name("a")), IntStream.range(0, 10001).boxed().map(i -> and(name("a"), name("b" + i)))).toArray(RowExpression[]::new)));
}
Also used : FunctionAndTypeManager(com.facebook.presto.metadata.FunctionAndTypeManager) IntStream(java.util.stream.IntStream) IS_NULL(com.facebook.presto.spi.relation.SpecialFormExpression.Form.IS_NULL) Arrays(java.util.Arrays) NOT_EQUAL(com.facebook.presto.common.function.OperatorType.NOT_EQUAL) VARCHAR(com.facebook.presto.common.type.VarcharType.VARCHAR) Assert.assertEquals(org.testng.Assert.assertEquals) VariableReferenceExpression(com.facebook.presto.spi.relation.VariableReferenceExpression) Test(org.testng.annotations.Test) FunctionAndTypeManager.createTestFunctionAndTypeManager(com.facebook.presto.metadata.FunctionAndTypeManager.createTestFunctionAndTypeManager) TypeSignatureProvider.fromTypes(com.facebook.presto.sql.analyzer.TypeSignatureProvider.fromTypes) Expressions.call(com.facebook.presto.sql.relational.Expressions.call) Expressions.constant(com.facebook.presto.sql.relational.Expressions.constant) LESS_THAN_OR_EQUAL(com.facebook.presto.common.function.OperatorType.LESS_THAN_OR_EQUAL) ImmutableList(com.google.common.collect.ImmutableList) LogicalRowExpressions(com.facebook.presto.expressions.LogicalRowExpressions) EQUAL(com.facebook.presto.common.function.OperatorType.EQUAL) FALSE_CONSTANT(com.facebook.presto.expressions.LogicalRowExpressions.FALSE_CONSTANT) AND(com.facebook.presto.spi.relation.SpecialFormExpression.Form.AND) LESS_THAN(com.facebook.presto.common.function.OperatorType.LESS_THAN) BOOLEAN(com.facebook.presto.common.type.BooleanType.BOOLEAN) CallExpression(com.facebook.presto.spi.relation.CallExpression) OR(com.facebook.presto.spi.relation.SpecialFormExpression.Form.OR) SpecialFormExpression(com.facebook.presto.spi.relation.SpecialFormExpression) RowExpression(com.facebook.presto.spi.relation.RowExpression) DOUBLE(com.facebook.presto.common.type.DoubleType.DOUBLE) BeforeClass(org.testng.annotations.BeforeClass) OperatorType(com.facebook.presto.common.function.OperatorType) TRUE_CONSTANT(com.facebook.presto.expressions.LogicalRowExpressions.TRUE_CONSTANT) GREATER_THAN_OR_EQUAL(com.facebook.presto.common.function.OperatorType.GREATER_THAN_OR_EQUAL) GREATER_THAN(com.facebook.presto.common.function.OperatorType.GREATER_THAN) List(java.util.List) LogicalRowExpressions.extractPredicates(com.facebook.presto.expressions.LogicalRowExpressions.extractPredicates) Stream(java.util.stream.Stream) INTEGER(com.facebook.presto.common.type.IntegerType.INTEGER) Optional(java.util.Optional) RowExpression(com.facebook.presto.spi.relation.RowExpression) Test(org.testng.annotations.Test)

Example 3 with AND

use of com.facebook.presto.spi.relation.SpecialFormExpression.Form.AND in project presto by prestodb.

the class TestCursorProcessorCompiler method testRewriteRowExpressionWithCSE.

@Test
public void testRewriteRowExpressionWithCSE() {
    CursorProcessorCompiler cseCursorCompiler = new CursorProcessorCompiler(METADATA, true, emptyMap());
    ClassDefinition cursorProcessorClassDefinition = new ClassDefinition(a(PUBLIC, FINAL), makeClassName(CursorProcessor.class.getSimpleName()), type(Object.class), type(CursorProcessor.class));
    RowExpression filter = new SpecialFormExpression(AND, BIGINT, ADD_X_Y_GREATER_THAN_2);
    List<RowExpression> projections = ImmutableList.of(ADD_X_Y_Z);
    List<RowExpression> rowExpressions = ImmutableList.<RowExpression>builder().addAll(projections).add(filter).build();
    Map<Integer, Map<RowExpression, VariableReferenceExpression>> commonSubExpressionsByLevel = collectCSEByLevel(rowExpressions);
    Map<VariableReferenceExpression, CommonSubExpressionRewriter.CommonSubExpressionFields> cseFields = declareCommonSubExpressionFields(cursorProcessorClassDefinition, commonSubExpressionsByLevel);
    Map<RowExpression, VariableReferenceExpression> commonSubExpressions = commonSubExpressionsByLevel.values().stream().flatMap(m -> m.entrySet().stream()).collect(toImmutableMap(Map.Entry::getKey, Map.Entry::getValue));
    // X+Y as CSE
    assertEquals(1, cseFields.size());
    VariableReferenceExpression cseVariable = cseFields.keySet().iterator().next();
    RowExpression rewrittenFilter = cseCursorCompiler.rewriteRowExpressionsWithCSE(ImmutableList.of(filter), commonSubExpressions).get(0);
    List<RowExpression> rewrittenProjections = cseCursorCompiler.rewriteRowExpressionsWithCSE(projections, commonSubExpressions);
    // X+Y+Z contains CSE X+Y
    assertTrue(((CallExpression) rewrittenProjections.get(0)).getArguments().contains(cseVariable));
    // X+Y > 2 consists CSE X+Y
    assertTrue(((CallExpression) ((SpecialFormExpression) rewrittenFilter).getArguments().get(0)).getArguments().contains(cseVariable));
}
Also used : FunctionAndTypeManager(com.facebook.presto.metadata.FunctionAndTypeManager) Page(com.facebook.presto.common.Page) VariableReferenceExpression(com.facebook.presto.spi.relation.VariableReferenceExpression) Test(org.testng.annotations.Test) Expressions.constant(com.facebook.presto.sql.relational.Expressions.constant) PageBuilder(com.facebook.presto.common.PageBuilder) Expressions.field(com.facebook.presto.sql.relational.Expressions.field) ADD(com.facebook.presto.common.function.OperatorType.ADD) Access.a(com.facebook.presto.bytecode.Access.a) CursorProcessor(com.facebook.presto.operator.project.CursorProcessor) ParameterizedType.type(com.facebook.presto.bytecode.ParameterizedType.type) IF(com.facebook.presto.spi.relation.SpecialFormExpression.Form.IF) CommonSubExpressionRewriter.collectCSEByLevel(com.facebook.presto.sql.gen.CommonSubExpressionRewriter.collectCSEByLevel) SESSION(com.facebook.presto.testing.TestingConnectorSession.SESSION) Map(java.util.Map) AND(com.facebook.presto.spi.relation.SpecialFormExpression.Form.AND) LESS_THAN(com.facebook.presto.common.function.OperatorType.LESS_THAN) CompilerUtils.makeClassName(com.facebook.presto.util.CompilerUtils.makeClassName) CallExpression(com.facebook.presto.spi.relation.CallExpression) SpecialFormExpression(com.facebook.presto.spi.relation.SpecialFormExpression) BlockBuilder(com.facebook.presto.common.block.BlockBuilder) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) ClassDefinition(com.facebook.presto.bytecode.ClassDefinition) List(java.util.List) ImmutableMap.toImmutableMap(com.google.common.collect.ImmutableMap.toImmutableMap) FINAL(com.facebook.presto.bytecode.Access.FINAL) Optional(java.util.Optional) IntStream(java.util.stream.IntStream) DriverYieldSignal(com.facebook.presto.operator.DriverYieldSignal) Assert.assertEquals(org.testng.Assert.assertEquals) PageRecordSet(com.facebook.presto.operator.index.PageRecordSet) Supplier(java.util.function.Supplier) TypeSignatureProvider.fromTypes(com.facebook.presto.sql.analyzer.TypeSignatureProvider.fromTypes) Expressions.call(com.facebook.presto.sql.relational.Expressions.call) ImmutableList(com.google.common.collect.ImmutableList) BOOLEAN(com.facebook.presto.common.type.BooleanType.BOOLEAN) CommonSubExpressionFields.declareCommonSubExpressionFields(com.facebook.presto.sql.gen.CommonSubExpressionRewriter.CommonSubExpressionFields.declareCommonSubExpressionFields) Type(com.facebook.presto.common.type.Type) RowExpression(com.facebook.presto.spi.relation.RowExpression) PUBLIC(com.facebook.presto.bytecode.Access.PUBLIC) BIGINT(com.facebook.presto.common.type.BigintType.BIGINT) Collections.emptyMap(java.util.Collections.emptyMap) RecordSet(com.facebook.presto.spi.RecordSet) GREATER_THAN(com.facebook.presto.common.function.OperatorType.GREATER_THAN) Collectors.toList(java.util.stream.Collectors.toList) MetadataManager.createTestMetadataManager(com.facebook.presto.metadata.MetadataManager.createTestMetadataManager) Assert.assertTrue(org.testng.Assert.assertTrue) Block(com.facebook.presto.common.block.Block) Metadata(com.facebook.presto.metadata.Metadata) CursorProcessor(com.facebook.presto.operator.project.CursorProcessor) RowExpression(com.facebook.presto.spi.relation.RowExpression) ClassDefinition(com.facebook.presto.bytecode.ClassDefinition) CommonSubExpressionFields.declareCommonSubExpressionFields(com.facebook.presto.sql.gen.CommonSubExpressionRewriter.CommonSubExpressionFields.declareCommonSubExpressionFields) VariableReferenceExpression(com.facebook.presto.spi.relation.VariableReferenceExpression) SpecialFormExpression(com.facebook.presto.spi.relation.SpecialFormExpression) Map(java.util.Map) ImmutableMap.toImmutableMap(com.google.common.collect.ImmutableMap.toImmutableMap) Collections.emptyMap(java.util.Collections.emptyMap) CallExpression(com.facebook.presto.spi.relation.CallExpression) Test(org.testng.annotations.Test)

Aggregations

Page (com.facebook.presto.common.Page)2 GREATER_THAN (com.facebook.presto.common.function.OperatorType.GREATER_THAN)2 LESS_THAN (com.facebook.presto.common.function.OperatorType.LESS_THAN)2 BOOLEAN (com.facebook.presto.common.type.BooleanType.BOOLEAN)2 Type (com.facebook.presto.common.type.Type)2 FunctionAndTypeManager (com.facebook.presto.metadata.FunctionAndTypeManager)2 CallExpression (com.facebook.presto.spi.relation.CallExpression)2 RowExpression (com.facebook.presto.spi.relation.RowExpression)2 SpecialFormExpression (com.facebook.presto.spi.relation.SpecialFormExpression)2 AND (com.facebook.presto.spi.relation.SpecialFormExpression.Form.AND)2 VariableReferenceExpression (com.facebook.presto.spi.relation.VariableReferenceExpression)2 TypeSignatureProvider.fromTypes (com.facebook.presto.sql.analyzer.TypeSignatureProvider.fromTypes)2 Expressions.call (com.facebook.presto.sql.relational.Expressions.call)2 Expressions.constant (com.facebook.presto.sql.relational.Expressions.constant)2 ImmutableList (com.google.common.collect.ImmutableList)2 List (java.util.List)2 Optional (java.util.Optional)2 IntStream (java.util.stream.IntStream)2 Assert.assertEquals (org.testng.Assert.assertEquals)2 Test (org.testng.annotations.Test)2