public CompareFunctionsProcessor(String functionName) { this.success = false; this.functionName = functionName; this.isEqualityFn = COMPARE_FUNCTIONS_TRANSPOSE_MAP.containsKey(functionName) && COMPARE_FUNCTIONS_TRANSPOSE_MAP.get(functionName).equals(functionName); this.isRowKeyPrefixComparison = false; this.sortOrderAscending = true; }
public static LogicalExpression create(String functionName, List<LogicalExpression> expressions) throws ExpressionValidationException { // logger.debug("Requesting generation of new function with name {}.", // functionName); if (!FUNCTION_MAP.containsKey(functionName)) { throw new ExpressionValidationException(String.format("Unknown function with name '%s'", functionName)); } try { return FUNCTION_MAP.get(functionName).newInstance(expressions); } catch (Exception e) { throw new ExpressionValidationException("Failure while attempting to build type of " + functionName, e); } }
@Override public boolean containsKey(@Nullable Object key) { return map.containsKey(key); }
/** * Returns {@code true} if the provided row key is among the row keys * provided when the table was constructed. */ @Override public boolean containsRow(@Nullable Object rowKey) { return rowKeyToIndex.containsKey(rowKey); }
@Override public boolean containsKey(@Nullable Object key) { return keyIndex.containsKey(key); }
/** * Returns {@code true} if the provided column key is among the column keys * provided when the table was constructed. */ @Override public boolean containsColumn(@Nullable Object columnKey) { return columnKeyToIndex.containsKey(columnKey); }
/** * Does the domain name match one of the "wildcard" patterns (e.g. {@code "*.ar"})? */ private static boolean matchesWildcardPublicSuffix(String domain) { final String[] pieces = domain.split(DOT_REGEX, 2); return pieces.length == 2 && PublicSuffixPatterns.UNDER.containsKey(pieces[1]); }
@Override public boolean contains(@Nullable Object object) { return map.containsKey(object); }
/** * Given a Drill's TypeProtos.MinorType, return a Calcite's corresponding SqlTypeName */ public static SqlTypeName getCalciteTypeFromDrillType(final TypeProtos.MinorType type) { if(!DRILL_TO_CALCITE_TYPE_MAPPING.containsKey(type)) { return SqlTypeName.ANY; } return DRILL_TO_CALCITE_TYPE_MAPPING.get(type); }
/** * Given a Calcite's SqlTypeName, return a Drill's corresponding TypeProtos.MinorType */ public static TypeProtos.MinorType getDrillTypeFromCalciteType(final SqlTypeName sqlTypeName) { if(!CALCITE_TO_DRILL_MAPPING.containsKey(sqlTypeName)) { return TypeProtos.MinorType.LATE; } return CALCITE_TO_DRILL_MAPPING.get(sqlTypeName); }
public CompareFunctionsProcessor(String functionName) { this.success = false; this.functionName = functionName; this.isEqualityFn = COMPARE_FUNCTIONS_TRANSPOSE_MAP.containsKey(functionName) && COMPARE_FUNCTIONS_TRANSPOSE_MAP.get(functionName).equals(functionName); this.isRowKeyPrefixComparison = false; this.sortOrderAscending = true; }
/** * Give the name and DrillFuncHolder list, return the inference mechanism. */ public static SqlReturnTypeInference getDrillSqlReturnTypeInference( final String name, final List<DrillFuncHolder> functions) { final String nameCap = name.toUpperCase(); if(funcNameToInference.containsKey(nameCap)) { return funcNameToInference.get(nameCap); } else { return new DrillDefaultSqlReturnTypeInference(functions); } }
public static LogicalExpression create(String functionName, List<LogicalExpression> expressions) throws ExpressionValidationException { // logger.debug("Requesting generation of new function with name {}.", // functionName); if (!FUNCTION_MAP.containsKey(functionName)) { throw new ExpressionValidationException(String.format("Unknown function with name '%s'", functionName)); } try { return FUNCTION_MAP.get(functionName).newInstance(expressions); } catch (Exception e) { throw new ExpressionValidationException("Failure while attempting to build type of " + functionName, e); } }
/** * Returns the index of the leftmost part of the public suffix, or -1 if not found. Note that the * value defined as the "public suffix" may not be a public suffix according to * {@link #isPublicSuffix()} if the domain ends with an excluded domain pattern such as * {@code "nhs.uk"}. */ private int findPublicSuffix() { final int partsSize = parts.size(); for (int i = 0; i < partsSize; i++) { String ancestorName = DOT_JOINER.join(parts.subList(i, partsSize)); if (PublicSuffixPatterns.EXACT.containsKey(ancestorName)) { return i; } // Excluded domains (e.g. !nhs.uk) use the next highest // domain as the effective public suffix (e.g. uk). if (PublicSuffixPatterns.EXCLUDED.containsKey(ancestorName)) { return i + 1; } if (matchesWildcardPublicSuffix(ancestorName)) { return i; } } return NO_PUBLIC_SUFFIX_FOUND; }
} else { final Pair<Integer, Integer> argNumberRange; if(registeredFuncNameToArgRange.containsKey(name)) { argNumberRange = registeredFuncNameToArgRange.get(name); } else {