public class InternalSchemaUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static Map<String,String> |
collectRenameCols(InternalSchema oldSchema,
InternalSchema newSchema)
Try to find all renamed cols between oldSchema and newSchema.
|
static Map<Integer,Pair<Type,Type>> |
collectTypeChangedCols(InternalSchema schema,
InternalSchema oldSchema)
Collect all type changed cols to build a colPosition -> (newColType, oldColType) map.
|
static String |
createFullName(String name,
Deque<String> fieldNames) |
static InternalSchema |
pruneInternalSchema(InternalSchema schema,
List<String> names)
Create project internalSchema, based on the project names which produced by query engine.
|
static InternalSchema |
pruneInternalSchemaByID(InternalSchema schema,
List<Integer> fieldIds,
List<Integer> topParentFieldIds)
Create project internalSchema.
|
static String |
reBuildFilterName(String name,
InternalSchema fileSchema,
InternalSchema querySchema)
A helper function to help correct the colName of pushed filters.
|
static InternalSchema |
searchSchema(long versionId,
List<InternalSchema> internalSchemas)
Search target internalSchema by version number.
|
static InternalSchema |
searchSchema(long versionId,
TreeMap<Long,InternalSchema> treeMap)
Search target internalSchema by version number.
|
public static InternalSchema pruneInternalSchema(InternalSchema schema, List<String> names)
schema - a internal schema.names - project names produced by query engine.public static InternalSchema pruneInternalSchemaByID(InternalSchema schema, List<Integer> fieldIds, List<Integer> topParentFieldIds)
schema - a internal schema.fieldIds - project col field_ids.public static String reBuildFilterName(String name, InternalSchema fileSchema, InternalSchema querySchema)
name - origin col name from pushed filters.fileSchema - the real schema of avro/parquet file.querySchema - the query schema which query engine produced.public static Map<Integer,Pair<Type,Type>> collectTypeChangedCols(InternalSchema schema, InternalSchema oldSchema)
schema - a type changed internalSchemaoldSchema - an old internalSchema.public static InternalSchema searchSchema(long versionId, List<InternalSchema> internalSchemas)
versionId - the internalSchema version to be search.internalSchemas - internalSchemas to be searched.public static InternalSchema searchSchema(long versionId, TreeMap<Long,InternalSchema> treeMap)
versionId - the internalSchema version to be search.treeMap - internalSchemas collections to be searched.public static Map<String,String> collectRenameCols(InternalSchema oldSchema, InternalSchema newSchema)
oldSchema - oldSchemanewSchema - newSchema which modified from oldSchemaCopyright © 2024 The Apache Software Foundation. All rights reserved.