Package org.apache.iceberg.spark
Class Spark3Util
- java.lang.Object
-
- org.apache.iceberg.spark.Spark3Util
-
public class Spark3Util extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Spark3Util.DescribeSchemaVisitor
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static UpdateProperties
applyPropertyChanges(UpdateProperties pendingUpdate, java.util.List<org.apache.spark.sql.connector.catalog.TableChange> changes)
Applies a list of Spark table changes to anUpdateProperties
operation.static UpdateSchema
applySchemaChanges(UpdateSchema pendingUpdate, java.util.List<org.apache.spark.sql.connector.catalog.TableChange> changes)
Applies a list of Spark table changes to anUpdateSchema
operation.static int
batchSize(java.util.Map<java.lang.String,java.lang.String> properties, org.apache.spark.sql.util.CaseInsensitiveStringMap readOptions)
static java.lang.String
describe(Expression expr)
static java.lang.String
describe(Schema schema)
static java.lang.String
describe(Type type)
static boolean
isLocalityEnabled(FileIO io, java.lang.String location, org.apache.spark.sql.util.CaseInsensitiveStringMap readOptions)
static boolean
isVectorizationEnabled(java.util.Map<java.lang.String,java.lang.String> properties, org.apache.spark.sql.util.CaseInsensitiveStringMap readOptions)
static java.lang.Integer
propertyAsInt(org.apache.spark.sql.util.CaseInsensitiveStringMap options, java.lang.String property, java.lang.Integer defaultValue)
static java.lang.Long
propertyAsLong(org.apache.spark.sql.util.CaseInsensitiveStringMap options, java.lang.String property, java.lang.Long defaultValue)
static java.util.Map<java.lang.String,java.lang.String>
rebuildCreateProperties(java.util.Map<java.lang.String,java.lang.String> createProperties)
static PartitionSpec
toPartitionSpec(Schema schema, org.apache.spark.sql.connector.expressions.Transform[] partitioning)
Converts Spark transforms into aPartitionSpec
.static org.apache.spark.sql.connector.expressions.Transform[]
toTransforms(PartitionSpec spec)
Converts a PartitionSpec to Spark transforms.
-
-
-
Method Detail
-
rebuildCreateProperties
public static java.util.Map<java.lang.String,java.lang.String> rebuildCreateProperties(java.util.Map<java.lang.String,java.lang.String> createProperties)
-
applyPropertyChanges
public static UpdateProperties applyPropertyChanges(UpdateProperties pendingUpdate, java.util.List<org.apache.spark.sql.connector.catalog.TableChange> changes)
Applies a list of Spark table changes to anUpdateProperties
operation.- Parameters:
pendingUpdate
- an uncommitted UpdateProperties operation to configurechanges
- a list of Spark table changes- Returns:
- the UpdateProperties operation configured with the changes
-
applySchemaChanges
public static UpdateSchema applySchemaChanges(UpdateSchema pendingUpdate, java.util.List<org.apache.spark.sql.connector.catalog.TableChange> changes)
Applies a list of Spark table changes to anUpdateSchema
operation.- Parameters:
pendingUpdate
- an uncommitted UpdateSchema operation to configurechanges
- a list of Spark table changes- Returns:
- the UpdateSchema operation configured with the changes
-
toTransforms
public static org.apache.spark.sql.connector.expressions.Transform[] toTransforms(PartitionSpec spec)
Converts a PartitionSpec to Spark transforms.- Parameters:
spec
- a PartitionSpec- Returns:
- an array of Transforms
-
toPartitionSpec
public static PartitionSpec toPartitionSpec(Schema schema, org.apache.spark.sql.connector.expressions.Transform[] partitioning)
Converts Spark transforms into aPartitionSpec
.- Parameters:
schema
- the table schemapartitioning
- Spark Transforms- Returns:
- a PartitionSpec
-
describe
public static java.lang.String describe(Expression expr)
-
describe
public static java.lang.String describe(Schema schema)
-
describe
public static java.lang.String describe(Type type)
-
isLocalityEnabled
public static boolean isLocalityEnabled(FileIO io, java.lang.String location, org.apache.spark.sql.util.CaseInsensitiveStringMap readOptions)
-
isVectorizationEnabled
public static boolean isVectorizationEnabled(java.util.Map<java.lang.String,java.lang.String> properties, org.apache.spark.sql.util.CaseInsensitiveStringMap readOptions)
-
batchSize
public static int batchSize(java.util.Map<java.lang.String,java.lang.String> properties, org.apache.spark.sql.util.CaseInsensitiveStringMap readOptions)
-
propertyAsLong
public static java.lang.Long propertyAsLong(org.apache.spark.sql.util.CaseInsensitiveStringMap options, java.lang.String property, java.lang.Long defaultValue)
-
propertyAsInt
public static java.lang.Integer propertyAsInt(org.apache.spark.sql.util.CaseInsensitiveStringMap options, java.lang.String property, java.lang.Integer defaultValue)
-
-