code
stringlengths
23
201k
docstring
stringlengths
17
96.2k
func_name
stringlengths
0
235
language
stringclasses
1 value
repo
stringlengths
8
72
path
stringlengths
11
317
url
stringlengths
57
377
license
stringclasses
7 values
public static File getMetaModelSourceFileFor(Class<?> clazz, boolean prefix) { if ( clazz.isMemberClass() ) { return getMetaModelSourceFileFor( clazz.getEnclosingClass(), prefix ); } String metaModelClassName = getMetaModelClassName(clazz, prefix); // generate the file name String fileName = metaModelClass...
Returns the static metamodel class for the specified entity. @param entityClass the entity for which to retrieve the metamodel class. Cannot be {@code null}. @return the static metamodel class for the specified entity.
getMetaModelSourceFileFor
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
Apache-2.0
public static File getMetaModelSourceFileFor(String className) { String metaModelClassName = getMetaModelClassName(className ); // generate the file name String fileName = metaModelClassName.replace( PACKAGE_SEPARATOR, PATH_SEPARATOR ); fileName = fileName.concat( ".java" ); return new File( getOutBaseDir( Te...
Returns the static metamodel class for the specified entity. @param entityClass the entity for which to retrieve the metamodel class. Cannot be {@code null}. @return the static metamodel class for the specified entity.
getMetaModelSourceFileFor
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
Apache-2.0
private static String getMetaModelClassName(Class<?> clazz, boolean prefix) { final String packageName = clazz.getPackageName(); return prefix ? packageName + '.' + META_MODEL_CLASS_POSTFIX + clazz.getName().substring( packageName.length() + 1 ) .replaceAll( "\\$", "\\$_" ) : packageName + clazz.getName().s...
Returns the static metamodel class for the specified entity. @param entityClass the entity for which to retrieve the metamodel class. Cannot be {@code null}. @return the static metamodel class for the specified entity.
getMetaModelClassName
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
Apache-2.0
private static String getMetaModelClassName(String className) { final int index = className.lastIndexOf( '.' ); final String packageName = className.substring( 0, index + 1 ); return packageName + className.substring( packageName.length() ).replaceAll( "\\$", "_\\$" ) + META_MODEL_CLASS_POSTFIX; }
Returns the static metamodel class for the specified entity. @param entityClass the entity for which to retrieve the metamodel class. Cannot be {@code null}. @return the static metamodel class for the specified entity.
getMetaModelClassName
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
Apache-2.0
public static String getMetaModelSourceAsString(Class<?> clazz) { return getMetaModelSourceAsString( clazz, false ); }
Returns the static metamodel class for the specified entity. @param entityClass the entity for which to retrieve the metamodel class. Cannot be {@code null}. @return the static metamodel class for the specified entity.
getMetaModelSourceAsString
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
Apache-2.0
public static String getMetaModelSourceAsString(Class<?> clazz, boolean prefix) { return getSourceFileContent( getMetaModelSourceFileFor( clazz, prefix ) ); }
Returns the static metamodel class for the specified entity. @param entityClass the entity for which to retrieve the metamodel class. Cannot be {@code null}. @return the static metamodel class for the specified entity.
getMetaModelSourceAsString
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
Apache-2.0
public static String getMetaModelSourceAsString(String className) { return getSourceFileContent( getMetaModelSourceFileFor( className ) ); }
Returns the static metamodel class for the specified entity. @param entityClass the entity for which to retrieve the metamodel class. Cannot be {@code null}. @return the static metamodel class for the specified entity.
getMetaModelSourceAsString
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
Apache-2.0
private static String getSourceFileContent(File sourceFile) { StringBuilder contents = new StringBuilder(); try { BufferedReader input = new BufferedReader( new FileReader( sourceFile ) ); try { String line; /* * readLine is a bit quirky : * it returns the content of a line MINUS the newlin...
Returns the static metamodel class for the specified entity. @param entityClass the entity for which to retrieve the metamodel class. Cannot be {@code null}. @return the static metamodel class for the specified entity.
getSourceFileContent
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
Apache-2.0
public static void dumpMetaModelSourceFor(Class<?> clazz) { log.info( "Dumping meta model source for " + clazz.getName() + ":" ); log.info( getMetaModelSourceAsString( clazz ) ); }
Returns the static metamodel class for the specified entity. @param entityClass the entity for which to retrieve the metamodel class. Cannot be {@code null}. @return the static metamodel class for the specified entity.
dumpMetaModelSourceFor
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
Apache-2.0
public static Constructor<?>[] getConstructorsFromMetamodelFor(Class<?> entityClass) { Class<?> metaModelClass = getMetamodelClassFor( entityClass ); return metaModelClass.getConstructors(); }
Returns the static metamodel class for the specified entity. @param entityClass the entity for which to retrieve the metamodel class. Cannot be {@code null}. @return the static metamodel class for the specified entity.
getConstructorsFromMetamodelFor
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
Apache-2.0
public static Field getFieldFromMetamodelFor(Class<?> entityClass, String fieldName) { return getFieldFromMetamodelFor(entityClass.getName(), fieldName); }
Returns the static metamodel class for the specified entity. @param entityClass the entity for which to retrieve the metamodel class. Cannot be {@code null}. @return the static metamodel class for the specified entity.
getFieldFromMetamodelFor
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
Apache-2.0
public static Field getFieldFromMetamodelFor(String className, String fieldName) { Class<?> metaModelClass = getMetamodelClassFor( className ); try { return metaModelClass.getDeclaredField( fieldName ); } catch (NoSuchFieldException e) { return null; } }
Returns the static metamodel class for the specified entity. @param entityClass the entity for which to retrieve the metamodel class. Cannot be {@code null}. @return the static metamodel class for the specified entity.
getFieldFromMetamodelFor
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
Apache-2.0
public static Method getMethodFromMetamodelFor(Class<?> entityClass, String methodName, Class<?>... params) { return getMethodFromMetamodelFor(entityClass.getName(), methodName, params); }
Returns the static metamodel class for the specified entity. @param entityClass the entity for which to retrieve the metamodel class. Cannot be {@code null}. @return the static metamodel class for the specified entity.
getMethodFromMetamodelFor
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
Apache-2.0
public static Method getMethodFromMetamodelFor(String className, String methodName, Class<?>... params) { Class<?> metaModelClass = getMetamodelClassFor( className ); try { return metaModelClass.getDeclaredMethod( methodName, params ); } catch (NoSuchMethodException e) { return null; } }
Returns the static metamodel class for the specified entity. @param entityClass the entity for which to retrieve the metamodel class. Cannot be {@code null}. @return the static metamodel class for the specified entity.
getMethodFromMetamodelFor
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
Apache-2.0
public static String fcnToPath(String fcn) { return fcn.replace( PACKAGE_SEPARATOR, RESOURCE_SEPARATOR ); }
Returns the static metamodel class for the specified entity. @param entityClass the entity for which to retrieve the metamodel class. Cannot be {@code null}. @return the static metamodel class for the specified entity.
fcnToPath
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
Apache-2.0
private static boolean hasNonDefaultConstructorInMetamodelFor(Class<?> clazz) { return Arrays.stream( getConstructorsFromMetamodelFor( clazz ) ) .anyMatch( constructor -> constructor.getParameterCount() > 0 ); }
Returns the static metamodel class for the specified entity. @param entityClass the entity for which to retrieve the metamodel class. Cannot be {@code null}. @return the static metamodel class for the specified entity.
hasNonDefaultConstructorInMetamodelFor
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
Apache-2.0
private static boolean hasFieldInMetamodelFor(Class<?> clazz, String fieldName) { return getFieldFromMetamodelFor( clazz, fieldName ) != null; }
Returns the static metamodel class for the specified entity. @param entityClass the entity for which to retrieve the metamodel class. Cannot be {@code null}. @return the static metamodel class for the specified entity.
hasFieldInMetamodelFor
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
Apache-2.0
private static boolean hasFieldInMetamodelFor(String className, String fieldName) { return getFieldFromMetamodelFor( className, fieldName ) != null; }
Returns the static metamodel class for the specified entity. @param entityClass the entity for which to retrieve the metamodel class. Cannot be {@code null}. @return the static metamodel class for the specified entity.
hasFieldInMetamodelFor
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
Apache-2.0
private static boolean hasMethodInMetamodelFor(Class<?> clazz, String fieldName, Class<?>... params) { return getMethodFromMetamodelFor( clazz, fieldName, params ) != null; }
Returns the static metamodel class for the specified entity. @param entityClass the entity for which to retrieve the metamodel class. Cannot be {@code null}. @return the static metamodel class for the specified entity.
hasMethodInMetamodelFor
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
Apache-2.0
private static boolean hasMethodInMetamodelFor(String className, String fieldName, Class<?>... params) { return getMethodFromMetamodelFor( className, fieldName, params ) != null; }
Returns the static metamodel class for the specified entity. @param entityClass the entity for which to retrieve the metamodel class. Cannot be {@code null}. @return the static metamodel class for the specified entity.
hasMethodInMetamodelFor
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
Apache-2.0
private static String buildErrorString(String baseError, Class<?> clazz) { StringBuilder builder = new StringBuilder(); builder.append( baseError ); builder.append( ".\n\n" ); builder.append( "Source code for " ); builder.append( clazz.getName() ); builder.append( "_.java:" ); builder.append( "\n" ); bu...
Returns the static metamodel class for the specified entity. @param entityClass the entity for which to retrieve the metamodel class. Cannot be {@code null}. @return the static metamodel class for the specified entity.
buildErrorString
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
Apache-2.0
private static String buildErrorString(String baseError, String className) { StringBuilder builder = new StringBuilder(); builder.append( baseError ); builder.append( ".\n\n" ); builder.append( "Source code for " ); builder.append( className ); builder.append( "_.java:" ); builder.append( "\n" ); builde...
Returns the static metamodel class for the specified entity. @param entityClass the entity for which to retrieve the metamodel class. Cannot be {@code null}. @return the static metamodel class for the specified entity.
buildErrorString
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
Apache-2.0
private static Type getComponentType(Type actualType) { if ( actualType instanceof Class ) { Class<?> clazz = (Class<?>) actualType; if ( clazz.isArray() ) { return clazz.getComponentType(); } else { fail( "Unexpected component type" ); } } if ( actualType instanceof GenericArrayType ) { ...
Returns the static metamodel class for the specified entity. @param entityClass the entity for which to retrieve the metamodel class. Cannot be {@code null}. @return the static metamodel class for the specified entity.
getComponentType
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
Apache-2.0
@Override public boolean accept(File pathName) { if ( pathName.isDirectory() ) { return true; } else { return pathName.getAbsolutePath().endsWith( "_.java" ) || pathName.getAbsolutePath().endsWith( "_.class" ); } }
Returns the static metamodel class for the specified entity. @param entityClass the entity for which to retrieve the metamodel class. Cannot be {@code null}. @return the static metamodel class for the specified entity.
accept
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
Apache-2.0
private static void deleteFilesRecursive(File file) { if ( file.isDirectory() ) { for ( File c : file.listFiles() ) { deleteFilesRecursive( c ); } } if ( !file.delete() ) { fail( "Unable to delete file: " + file ); } }
Returns the static metamodel class for the specified entity. @param entityClass the entity for which to retrieve the metamodel class. Cannot be {@code null}. @return the static metamodel class for the specified entity.
deleteFilesRecursive
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
Apache-2.0
public static File getTargetDir(Class<?> currentTestClass) { ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); String currentTestClassName = currentTestClass.getName(); int hopsToCompileDirectory = currentTestClassName.split( "\\." ).length; int hopsToTargetDirectory = hopsToCompi...
Returns the target directory of the build. @return the target directory of the build
getTargetDir
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
Apache-2.0
private static void assertCollectionAttributeTypeInMetaModelFor( Class<?> clazz, String fieldName, Class<?> collectionType, Class<?> expectedType, String errorString) { Field field = getFieldFromMetamodelFor( clazz, fieldName ); assertNotNull( "Cannot find field '" + fieldName + "' in " + clazz.getNa...
Returns the target directory of the build. @return the target directory of the build
assertCollectionAttributeTypeInMetaModelFor
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/util/TestUtil.java
Apache-2.0
@Override public SqlNode visit(SqlCall call) { if (call.getOperator().getKind() == SqlKind.UNION) { // Since a union is represented as a binary operator in calcite, unions would have chaining unions in the AST. // For example: given A UNION B UNION C, the SqlNode AST would look something like: /...
Fuzzy union occur when there is a mismatch in the schemas of the branches of a union. This can occur in a Dali view that is composed of the union of two tables. When a view is initially deployed, the schemas must be exactly the same. However, one of the tables could evolve to introduce a new field in a struct, which le...
visit
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/FuzzyUnionSqlRewriter.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/FuzzyUnionSqlRewriter.java
BSD-2-Clause
private SqlNode createGenericProject(String columnName, RelDataType expectedType) { SqlNode[] genericProjectOperands = new SqlNode[3]; genericProjectOperands[0] = new SqlIdentifier(ImmutableList.of(tableName, columnName), SqlParserPos.ZERO); genericProjectOperands[1] = SqlLiteral.createCharString(columnName...
Create a SqlNode that calls GenericProject for the given column @param columnName The name of the column that is to be fixed @param expectedType The expected data type
createGenericProject
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/FuzzyUnionSqlRewriter.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/FuzzyUnionSqlRewriter.java
BSD-2-Clause
private SqlNodeList createProjectedFieldsNodeList(RelDataType fromNodeDataType, RelDataType expectedDataType) { final SqlNodeList projectedFields = new SqlNodeList(SqlParserPos.ZERO); for (final RelDataTypeField expectedField : expectedDataType.getFieldList()) { final RelDataTypeField inputField = fromNo...
Create the SqlNodeList for the operands for a GenericProject. @param fromNodeDataType RelDataType that might need to be projected as expectedDataType @param expectedDataType The expected data type @return a SqlNodeList that contains all the fields in expectedDataType where: - fields that do not involve structs ...
createProjectedFieldsNodeList
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/FuzzyUnionSqlRewriter.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/FuzzyUnionSqlRewriter.java
BSD-2-Clause
private SqlNode addFuzzyUnionToUnionBranch(SqlNode unionBranch, RelDataType expectedDataType) { // Get the base tables' (rather than intermediate base views') RelDataType of unionBranch, so that it can pass the type // validation of calcite because calcite uses base tables' RelDataType to do the type validation...
Create a SqlNode that has a same schema as expectedDataType @param unionBranch SqlNode node that is a branch in a union, which might need to be projected as expectedDataType @param expectedDataType The expected data type for the UNION branch @return SqlNode that has its schema fixed to the schema of the table
addFuzzyUnionToUnionBranch
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/FuzzyUnionSqlRewriter.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/FuzzyUnionSqlRewriter.java
BSD-2-Clause
private SqlCall addFuzzyUnionToUnionCall(SqlCall unionCall, RelDataType expectedDataType) { for (int i = 0; i < unionCall.operandCount(); ++i) { SqlNode operand = unionCall.operand(i); // In this case, we do not need to apply fuzzy union semantics to the union itself. // The fuzzy union semantics ...
Look at the union operator in the call and add a fuzzy union projection over branches that have mismatched schemas. @param unionCall Union operator SqlCall @return a union operator SqlCall with fuzzy union semantics
addFuzzyUnionToUnionCall
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/FuzzyUnionSqlRewriter.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/FuzzyUnionSqlRewriter.java
BSD-2-Clause
private RelDataType getUnionDataType(final SqlCall unionCall) { final List<SqlNode> leafNodes = getUnionLeafNodes(unionCall); final List<RelDataType> leafNodeDataTypes = new ArrayList<>(); for (final SqlNode node : leafNodes) { RelDataType fromNodeDataType = toRelConverter.getSqlValidator().getValidat...
Return data type given by the common subset of columns in the branches of the UNION call.
getUnionDataType
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/FuzzyUnionSqlRewriter.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/FuzzyUnionSqlRewriter.java
BSD-2-Clause
private RelDataType getUnionDataType(final List<RelDataType> dataTypes) { // Use the first dataType as the model/base type. // Assume that all dataTypes in the list once shared a common type // and only evolved in a backwards compatible fashion. final RelDataType baseDataType = dataTypes.get(0); if...
Return data type given by the common subset of columns in the given dataTypes.
getUnionDataType
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/FuzzyUnionSqlRewriter.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/FuzzyUnionSqlRewriter.java
BSD-2-Clause
private List<SqlNode> getUnionLeafNodes(SqlCall unionCall) { final List<SqlNode> leafNodes = new ArrayList<>(); for (int i = 0; i < unionCall.operandCount(); ++i) { final SqlNode operand = unionCall.operand(i); if (isUnionOperator(operand)) { leafNodes.addAll(getUnionLeafNodes((SqlCall) oper...
Return a list of SqlNode branches in the UNION call ordered based on the query string. Example: 'A UNION B UNION C' => [SqlNode_A, SqlNode_B, SqlNode_C]
getUnionLeafNodes
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/FuzzyUnionSqlRewriter.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/FuzzyUnionSqlRewriter.java
BSD-2-Clause
private boolean isUnionOperator(SqlNode node) { return (node instanceof SqlCall) && ((SqlCall) node).getOperator().getKind() == SqlKind.UNION; }
Determine if the SqlNode is a UNION call @param node a given SqlNode to evaluate @return true if the SqlNode is a UNION call; false otherwise
isUnionOperator
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/FuzzyUnionSqlRewriter.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/FuzzyUnionSqlRewriter.java
BSD-2-Clause
private boolean equivalentDataTypes(RelDataType t1, RelDataType t2) { if (t1.isStruct()) { if (t1.getFieldCount() != t2.getFieldCount()) { return false; } for (int i = 0; i < t1.getFieldCount(); ++i) { final RelDataTypeField f1 = t1.getFieldList().get(i); final RelDataType...
Return true if the RelDataTypes t1 and t2 are equivalent. NOTE: We don't actually check the types of columns. We just want to check that the data types have the same structure and ordering of columns.
equivalentDataTypes
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/FuzzyUnionSqlRewriter.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/FuzzyUnionSqlRewriter.java
BSD-2-Clause
@Override public Table getTable(String name) { org.apache.hadoop.hive.metastore.api.Table table = msc.getTable(dbName, name); if (table == null) { return null; } org.apache.hadoop.hive.metastore.TableType tableType = Enum.valueOf(org.apache.hadoop.hive.metastore.TableType.class, table.ge...
Adaptor from Hive catalog providing database and table names to Calcite {@link Schema}
getTable
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveDbSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveDbSchema.java
BSD-2-Clause
@Override public Set<String> getTableNames() { return ImmutableSet.copyOf(msc.getAllTables(dbName)); }
Adaptor from Hive catalog providing database and table names to Calcite {@link Schema}
getTableNames
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveDbSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveDbSchema.java
BSD-2-Clause
@Override public RelProtoDataType getType(String s) { return null; }
Adaptor from Hive catalog providing database and table names to Calcite {@link Schema}
getType
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveDbSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveDbSchema.java
BSD-2-Clause
@Override public Set<String> getTypeNames() { return null; }
Adaptor from Hive catalog providing database and table names to Calcite {@link Schema}
getTypeNames
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveDbSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveDbSchema.java
BSD-2-Clause
@Override public Collection<Function> getFunctions(String name) { return ImmutableList.of(); }
Adaptor from Hive catalog providing database and table names to Calcite {@link Schema}
getFunctions
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveDbSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveDbSchema.java
BSD-2-Clause
@Override public Set<String> getFunctionNames() { return ImmutableSet.of(); }
Adaptor from Hive catalog providing database and table names to Calcite {@link Schema}
getFunctionNames
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveDbSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveDbSchema.java
BSD-2-Clause
@Override public Schema getSubSchema(String name) { return null; }
A Hive DB does not have subschema @param name Subschema name @return Calcite schema
getSubSchema
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveDbSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveDbSchema.java
BSD-2-Clause
@Override public Set<String> getSubSchemaNames() { return ImmutableSet.of(); }
A Hive DB does not have subschema @param name Subschema name @return Calcite schema
getSubSchemaNames
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveDbSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveDbSchema.java
BSD-2-Clause
@Override public Expression getExpression(SchemaPlus parentSchema, String name) { return null; }
A Hive DB does not have subschema @param name Subschema name @return Calcite schema
getExpression
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveDbSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveDbSchema.java
BSD-2-Clause
@Override public boolean isMutable() { return true; }
A Hive DB does not have subschema @param name Subschema name @return Calcite schema
isMutable
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveDbSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveDbSchema.java
BSD-2-Clause
@Override public Schema snapshot(SchemaVersion schemaVersion) { return this; }
A Hive DB does not have subschema @param name Subschema name @return Calcite schema
snapshot
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveDbSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveDbSchema.java
BSD-2-Clause
public static RelBuilderFactory proto(final Context context) { return (cluster, schema) -> new HiveRelBuilder(context, cluster, schema); }
Creates a {@link RelBuilderFactory}, a partially-created RelBuilder. Just add a {@link RelOptCluster} and a {@link RelOptSchema} Note that this function creates a HiveRelBuilder instead of a RelBuilder as in its parent.
proto
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveRelBuilder.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveRelBuilder.java
BSD-2-Clause
@Override public Table getTable(String name) { return null; }
This always returns null as root hive schema does not have tables. @param name Table name @return get calcite table representation
getTable
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveSchema.java
BSD-2-Clause
@Override public Set<String> getTableNames() { return ImmutableSet.of(); }
This always returns null as root hive schema does not have tables. @param name Table name @return get calcite table representation
getTableNames
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveSchema.java
BSD-2-Clause
@Override public RelProtoDataType getType(String s) { return null; }
This always returns null as root hive schema does not have tables. @param name Table name @return get calcite table representation
getType
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveSchema.java
BSD-2-Clause
@Override public Set<String> getTypeNames() { return null; }
This always returns null as root hive schema does not have tables. @param name Table name @return get calcite table representation
getTypeNames
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveSchema.java
BSD-2-Clause
@Override public Collection<Function> getFunctions(String name) { return ImmutableList.of(); }
This always returns null as root hive schema does not have tables. @param name Table name @return get calcite table representation
getFunctions
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveSchema.java
BSD-2-Clause
@Override public Set<String> getFunctionNames() { return ImmutableSet.of(); }
This always returns null as root hive schema does not have tables. @param name Table name @return get calcite table representation
getFunctionNames
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveSchema.java
BSD-2-Clause
@Override public Schema getSubSchema(String name) { Database database = msc.getDatabase(name); return (database == null) ? null : new HiveDbSchema(msc, database.getName()); }
This always returns null as root hive schema does not have tables. @param name Table name @return get calcite table representation
getSubSchema
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveSchema.java
BSD-2-Clause
@Override public Set<String> getSubSchemaNames() { List<String> dbNames = msc.getAllDatabases(); return ImmutableSet.copyOf(dbNames); }
This always returns null as root hive schema does not have tables. @param name Table name @return get calcite table representation
getSubSchemaNames
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveSchema.java
BSD-2-Clause
@Override public Expression getExpression(SchemaPlus parentSchema, String name) { return null; }
This always returns null as root hive schema does not have tables. @param name Table name @return get calcite table representation
getExpression
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveSchema.java
BSD-2-Clause
@Override public boolean isMutable() { return true; }
This always returns null as root hive schema does not have tables. @param name Table name @return get calcite table representation
isMutable
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveSchema.java
BSD-2-Clause
@Override public Schema snapshot(SchemaVersion schemaVersion) { return this; }
This always returns null as root hive schema does not have tables. @param name Table name @return get calcite table representation
snapshot
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveSchema.java
BSD-2-Clause
public Map<String, String> getDaliFunctionParams() { checkDaliTable(); final String functionsValue = hiveTable.getParameters().get(TBLPROPERTIES_FUNCTIONS_KEY); Map<String, String> params = new HashMap<>(); if (functionsValue != null) { params = functionsKeyValueSplitter.split(functionsValue); ...
Get dali function params from table TBLPROPERTIES clause parameters. The 'functions' parameter in TBLPROPERTIES clause is a whitespace-separated list of function base name used in the view, followed by colon(:), followed by the corresponding full class names. Example: 'functions' = 'func_1:com.linkedin.Func1 func_2:co...
getDaliFunctionParams
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java
BSD-2-Clause
public List<String> getDaliUdfDependencies() { checkDaliTable(); final String propertyValue = hiveTable.getParameters().get(TBLPROPERTIES_DEPENDENCIES_KEY); if (propertyValue != null) { return tblpropertiesSplitter.splitToList(propertyValue).stream() .map(s -> s.toLowerCase().startsWith("ivy...
Get Dali UDF dependencies from the "dependencies" Hive table property. The 'dependencies' parameter in TBLPROPERTIES clause is a whitespace-separated list of the ivy coordinates of the artifacts a UDF requires. Example: 'dependencies' = 'ivy://com.linkedin.foo:foo1:0.0.1 ivy://com.linkedin.foo:foo2:0.0.1' @return retu...
getDaliUdfDependencies
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java
BSD-2-Clause
public boolean isDaliTable() { return hiveTable.getOwner().equalsIgnoreCase("daliview"); }
Get Dali UDF dependencies from the "dependencies" Hive table property. The 'dependencies' parameter in TBLPROPERTIES clause is a whitespace-separated list of the ivy coordinates of the artifacts a UDF requires. Example: 'dependencies' = 'ivy://com.linkedin.foo:foo1:0.0.1 ivy://com.linkedin.foo:foo2:0.0.1' @return retu...
isDaliTable
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java
BSD-2-Clause
private void checkDaliTable() { // FIXME: this fails unit test right now // Preconditions.checkState(isDaliTable()); }
Get Dali UDF dependencies from the "dependencies" Hive table property. The 'dependencies' parameter in TBLPROPERTIES clause is a whitespace-separated list of the ivy coordinates of the artifacts a UDF requires. Example: 'dependencies' = 'ivy://com.linkedin.foo:foo1:0.0.1 ivy://com.linkedin.foo:foo2:0.0.1' @return retu...
checkDaliTable
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java
BSD-2-Clause
@Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { final List<FieldSchema> cols = getColumns(); final List<RelDataType> fieldTypes = new ArrayList<>(cols.size()); final List<String> fieldNames = new ArrayList<>(cols.size()); final Iterable<FieldSchema> allCols = Iterables.concat...
Get Dali UDF dependencies from the "dependencies" Hive table property. The 'dependencies' parameter in TBLPROPERTIES clause is a whitespace-separated list of the ivy coordinates of the artifacts a UDF requires. Example: 'dependencies' = 'ivy://com.linkedin.foo:foo1:0.0.1 ivy://com.linkedin.foo:foo2:0.0.1' @return retu...
getRowType
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java
BSD-2-Clause
private List<FieldSchema> getColumns() { StorageDescriptor sd = hiveTable.getSd(); String serDeLib = getSerializationLib(); if (serDeLib == null || serDeLib.isEmpty()) { // views don't have serde library return sd.getCols(); } else { try { return MetaStoreUtils.getFieldsFromDes...
Get Dali UDF dependencies from the "dependencies" Hive table property. The 'dependencies' parameter in TBLPROPERTIES clause is a whitespace-separated list of the ivy coordinates of the artifacts a UDF requires. Example: 'dependencies' = 'ivy://com.linkedin.foo:foo1:0.0.1 ivy://com.linkedin.foo:foo2:0.0.1' @return retu...
getColumns
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java
BSD-2-Clause
private String getSerializationLib() { return hiveTable.getSd().getSerdeInfo().getSerializationLib(); }
Get Dali UDF dependencies from the "dependencies" Hive table property. The 'dependencies' parameter in TBLPROPERTIES clause is a whitespace-separated list of the ivy coordinates of the artifacts a UDF requires. Example: 'dependencies' = 'ivy://com.linkedin.foo:foo1:0.0.1 ivy://com.linkedin.foo:foo2:0.0.1' @return retu...
getSerializationLib
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java
BSD-2-Clause
private Deserializer getDeserializer() { if (deserializer == null) { deserializer = getDeserializerFromMetaStore(); } return deserializer; }
Get Dali UDF dependencies from the "dependencies" Hive table property. The 'dependencies' parameter in TBLPROPERTIES clause is a whitespace-separated list of the ivy coordinates of the artifacts a UDF requires. Example: 'dependencies' = 'ivy://com.linkedin.foo:foo1:0.0.1 ivy://com.linkedin.foo:foo2:0.0.1' @return retu...
getDeserializer
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java
BSD-2-Clause
private Deserializer getDeserializerFromMetaStore() { try { return MetaStoreUtils.getDeserializer(new Configuration(false), hiveTable, false); } catch (Throwable e) { // Catch Throwable here because it may throw Exception or Error throw new RuntimeException(e); } }
Get Dali UDF dependencies from the "dependencies" Hive table property. The 'dependencies' parameter in TBLPROPERTIES clause is a whitespace-separated list of the ivy coordinates of the artifacts a UDF requires. Example: 'dependencies' = 'ivy://com.linkedin.foo:foo1:0.0.1 ivy://com.linkedin.foo:foo2:0.0.1' @return retu...
getDeserializerFromMetaStore
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java
BSD-2-Clause
@Override public Statistic getStatistic() { return Statistics.UNKNOWN; }
Get Dali UDF dependencies from the "dependencies" Hive table property. The 'dependencies' parameter in TBLPROPERTIES clause is a whitespace-separated list of the ivy coordinates of the artifacts a UDF requires. Example: 'dependencies' = 'ivy://com.linkedin.foo:foo1:0.0.1 ivy://com.linkedin.foo:foo2:0.0.1' @return retu...
getStatistic
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java
BSD-2-Clause
@Override public Schema.TableType getJdbcTableType() { TableType tableType = Enum.valueOf(TableType.class, hiveTable.getTableType()); switch (tableType) { case VIRTUAL_VIEW: return Schema.TableType.VIEW; case MANAGED_TABLE: return Schema.TableType.TABLE; case INDEX_TABLE: ...
Get Dali UDF dependencies from the "dependencies" Hive table property. The 'dependencies' parameter in TBLPROPERTIES clause is a whitespace-separated list of the ivy coordinates of the artifacts a UDF requires. Example: 'dependencies' = 'ivy://com.linkedin.foo:foo1:0.0.1 ivy://com.linkedin.foo:foo2:0.0.1' @return retu...
getJdbcTableType
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java
BSD-2-Clause
@Override public boolean isRolledUp(String s) { return false; }
Get Dali UDF dependencies from the "dependencies" Hive table property. The 'dependencies' parameter in TBLPROPERTIES clause is a whitespace-separated list of the ivy coordinates of the artifacts a UDF requires. Example: 'dependencies' = 'ivy://com.linkedin.foo:foo1:0.0.1 ivy://com.linkedin.foo:foo2:0.0.1' @return retu...
isRolledUp
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java
BSD-2-Clause
@Override public boolean rolledUpColumnValidInsideAgg(String s, SqlCall sqlCall, SqlNode sqlNode, CalciteConnectionConfig calciteConnectionConfig) { return true; }
Get Dali UDF dependencies from the "dependencies" Hive table property. The 'dependencies' parameter in TBLPROPERTIES clause is a whitespace-separated list of the ivy coordinates of the artifacts a UDF requires. Example: 'dependencies' = 'ivy://com.linkedin.foo:foo1:0.0.1 ivy://com.linkedin.foo:foo2:0.0.1' @return retu...
rolledUpColumnValidInsideAgg
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java
BSD-2-Clause
@Override public Enumerable<Object[]> scan(DataContext dataContext) { throw new RuntimeException("Calcite runtime is not supported"); }
Get Dali UDF dependencies from the "dependencies" Hive table property. The 'dependencies' parameter in TBLPROPERTIES clause is a whitespace-separated list of the ivy coordinates of the artifacts a UDF requires. Example: 'dependencies' = 'ivy://com.linkedin.foo:foo1:0.0.1 ivy://com.linkedin.foo:foo2:0.0.1' @return retu...
scan
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java
BSD-2-Clause
@Override public RelNode copy(RelTraitSet traitSet, RelNode input) { assert traitSet.containsIfApplicable(Convention.NONE); HiveUncollect result = new HiveUncollect(getCluster(), traitSet, input, withOrdinality); // copy the rowType as well result.rowType = this.rowType; return result; }
RelNode to represent Hive's Uncollect semantics. Hive semantics differ from Calcite Uncollect in handling operand types array(struct). For array(struct), Calcite flattens internal struct to multiple columns whereas Hive returns single column of struct type
copy
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveUncollect.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveUncollect.java
BSD-2-Clause
public RelNode copy(RelDataType rowType) { assert traitSet.containsIfApplicable(Convention.NONE); HiveUncollect result = new HiveUncollect(getCluster(), traitSet, input, withOrdinality); // set the rowType of the new HiveUncollect object result.rowType = rowType; return result; }
Create a copy of this HiveUncollect object with the specified rowType. @param rowType rowType of the newly created HiveUncollect object @return a new HiveUncollect object
copy
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveUncollect.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveUncollect.java
BSD-2-Clause
@Override protected RelDataType deriveRowType() { if (rowType != null) { return rowType; } RelDataType inputType = input.getRowType(); assert inputType.isStruct() : inputType + " is not a struct"; final List<RelDataTypeField> fields = inputType.getFieldList(); final RelDataTypeFactory.Bu...
Create a copy of this HiveUncollect object with the specified rowType. @param rowType rowType of the newly created HiveUncollect object @return a new HiveUncollect object
deriveRowType
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveUncollect.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveUncollect.java
BSD-2-Clause
@Override public RelNode toRel(RelOptTable.ToRelContext relContext, RelOptTable relOptTable) { try { RelRoot root = relContext.expandView(relOptTable.getRowType(), hiveTable.getViewExpandedText(), schemaPath, ImmutableList.of(hiveTable.getTableName())); return root.rel; } catch (Exceptio...
Constructor to create bridge from hive table to calcite table @param hiveTable Hive table @param schemaPath Calcite schema path
toRel
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/HiveViewTable.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/HiveViewTable.java
BSD-2-Clause
@Override public Table getTable(String tableName) { if (localMetastore.containsKey(dbName) && localMetastore.get(dbName).containsKey(tableName)) { return new LocalMetastoreHiveTable(tableName, localMetastore.get(dbName).get(tableName)); } return null; }
This class is a replacement for {@link HiveDbSchema} to work with localMetastore in coral-spark-plan module Adaptor from Hive catalog providing database and table names to Calcite {@link Schema}
getTable
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveDbSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveDbSchema.java
BSD-2-Clause
@Override public Set<String> getTableNames() { return ImmutableSet.copyOf(localMetastore.get(dbName).keySet()); }
This class is a replacement for {@link HiveDbSchema} to work with localMetastore in coral-spark-plan module Adaptor from Hive catalog providing database and table names to Calcite {@link Schema}
getTableNames
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveDbSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveDbSchema.java
BSD-2-Clause
@Override public RelProtoDataType getType(String s) { return null; }
This class is a replacement for {@link HiveDbSchema} to work with localMetastore in coral-spark-plan module Adaptor from Hive catalog providing database and table names to Calcite {@link Schema}
getType
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveDbSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveDbSchema.java
BSD-2-Clause
@Override public Set<String> getTypeNames() { return null; }
This class is a replacement for {@link HiveDbSchema} to work with localMetastore in coral-spark-plan module Adaptor from Hive catalog providing database and table names to Calcite {@link Schema}
getTypeNames
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveDbSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveDbSchema.java
BSD-2-Clause
@Override public Collection<Function> getFunctions(String name) { return ImmutableList.of(); }
This class is a replacement for {@link HiveDbSchema} to work with localMetastore in coral-spark-plan module Adaptor from Hive catalog providing database and table names to Calcite {@link Schema}
getFunctions
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveDbSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveDbSchema.java
BSD-2-Clause
@Override public Set<String> getFunctionNames() { return ImmutableSet.of(); }
This class is a replacement for {@link HiveDbSchema} to work with localMetastore in coral-spark-plan module Adaptor from Hive catalog providing database and table names to Calcite {@link Schema}
getFunctionNames
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveDbSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveDbSchema.java
BSD-2-Clause
@Override public Schema getSubSchema(String name) { return null; }
A Hive DB does not have subschema @param name name of the schema @return Calcite schema
getSubSchema
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveDbSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveDbSchema.java
BSD-2-Clause
@Override public Set<String> getSubSchemaNames() { return ImmutableSet.of(); }
A Hive DB does not have subschema @param name name of the schema @return Calcite schema
getSubSchemaNames
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveDbSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveDbSchema.java
BSD-2-Clause
@Override public Expression getExpression(SchemaPlus parentSchema, String name) { return null; }
A Hive DB does not have subschema @param name name of the schema @return Calcite schema
getExpression
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveDbSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveDbSchema.java
BSD-2-Clause
@Override public boolean isMutable() { return true; }
A Hive DB does not have subschema @param name name of the schema @return Calcite schema
isMutable
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveDbSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveDbSchema.java
BSD-2-Clause
@Override public Schema snapshot(SchemaVersion schemaVersion) { return this; }
A Hive DB does not have subschema @param name name of the schema @return Calcite schema
snapshot
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveDbSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveDbSchema.java
BSD-2-Clause
@Override public Table getTable(String name) { return null; }
This always returns null as root hive schema does not have tables. @param name name of the table @return get calcite table representation
getTable
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveSchema.java
BSD-2-Clause
@Override public Set<String> getTableNames() { return ImmutableSet.of(); }
This always returns null as root hive schema does not have tables. @param name name of the table @return get calcite table representation
getTableNames
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveSchema.java
BSD-2-Clause
@Override public RelProtoDataType getType(String s) { return null; }
This always returns null as root hive schema does not have tables. @param name name of the table @return get calcite table representation
getType
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveSchema.java
BSD-2-Clause
@Override public Set<String> getTypeNames() { return null; }
This always returns null as root hive schema does not have tables. @param name name of the table @return get calcite table representation
getTypeNames
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveSchema.java
BSD-2-Clause
@Override public Collection<Function> getFunctions(String name) { return ImmutableList.of(); }
This always returns null as root hive schema does not have tables. @param name name of the table @return get calcite table representation
getFunctions
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveSchema.java
BSD-2-Clause
@Override public Set<String> getFunctionNames() { return ImmutableSet.of(); }
This always returns null as root hive schema does not have tables. @param name name of the table @return get calcite table representation
getFunctionNames
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveSchema.java
BSD-2-Clause
@Override public Schema getSubSchema(String name) { if (localMetastore.containsKey(name)) { return new LocalMetastoreHiveDbSchema(localMetastore, name); } return null; }
This always returns null as root hive schema does not have tables. @param name name of the table @return get calcite table representation
getSubSchema
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveSchema.java
BSD-2-Clause
@Override public Set<String> getSubSchemaNames() { return ImmutableSet.copyOf(localMetastore.keySet()); }
This always returns null as root hive schema does not have tables. @param name name of the table @return get calcite table representation
getSubSchemaNames
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveSchema.java
BSD-2-Clause
@Override public Expression getExpression(SchemaPlus parentSchema, String name) { return null; }
This always returns null as root hive schema does not have tables. @param name name of the table @return get calcite table representation
getExpression
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveSchema.java
BSD-2-Clause
@Override public boolean isMutable() { return true; }
This always returns null as root hive schema does not have tables. @param name name of the table @return get calcite table representation
isMutable
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveSchema.java
BSD-2-Clause
@Override public Schema snapshot(SchemaVersion schemaVersion) { return this; }
This always returns null as root hive schema does not have tables. @param name name of the table @return get calcite table representation
snapshot
java
linkedin/coral
coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveSchema.java
https://github.com/linkedin/coral/blob/master/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveSchema.java
BSD-2-Clause