public final class DDL extends Object
public static io.cdap.cdap.api.data.schema.Schema parse(String json) throws IOException
Schema object.json - string representation of schema.Schema representing JSON string.IOException - thrown when there is issue parsing the data.public static io.cdap.cdap.api.data.schema.Schema parsesql(String sql) throws IOException
Schema representation of the SQL.sql - to be converted to Schema.Schema.IOException - throw when there is issue parsing the sql.public static io.cdap.cdap.api.data.schema.Schema parse(io.cdap.cdap.api.data.schema.Schema schema)
Schema.
This method is added if a user makes a mistake of parsing the schema again.schema - to be returned.public static io.cdap.cdap.api.data.format.StructuredRecord parse(io.cdap.cdap.api.data.format.StructuredRecord record)
StructuredRecord returns the same StructuredRecord.public static com.google.gson.JsonElement toJson(io.cdap.cdap.api.data.format.StructuredRecord record) throws IOException
StructuredRecord to JSON string.record - to be converted to JSONIOException - thrown if there are any issues with parsing.public static boolean hasField(io.cdap.cdap.api.data.format.StructuredRecord record, String name)
StructuredRecord and the name of the field, it checks, if the
field exists in the StructuredRecord.record - in which the field needs to be checked.name - of the field to be checked.public static io.cdap.cdap.api.data.schema.Schema drop(io.cdap.cdap.api.data.schema.Schema schema, String path)
Schema.public static io.cdap.cdap.api.data.schema.Schema drop(io.cdap.cdap.api.data.schema.Schema schema, String path, String... paths)
public static io.cdap.cdap.api.data.schema.Schema select(io.cdap.cdap.api.data.schema.Schema schema, String path)
public static io.cdap.cdap.api.data.format.StructuredRecord drop(io.cdap.cdap.api.data.format.StructuredRecord record, String path)
public static io.cdap.cdap.api.data.format.StructuredRecord drop(io.cdap.cdap.api.data.format.StructuredRecord record, String path, String... paths)
public static <T> T select(io.cdap.cdap.api.data.format.StructuredRecord record, String path)
StructuredRecord.T - type of object returned.record - to be operated onpath - to applied to the StructuredRecordStructuredRecordCopyright © 2024 CDAP Licensed under the Apache License, Version 2.0.