@InterfaceAudience.Public @InterfaceStability.Stable public class ResourceSchema extends java.lang.Object implements java.io.Serializable
Schema
, which is an internal Pig representation of a schema.Modifier and Type | Class and Description |
---|---|
static class |
ResourceSchema.Order |
static class |
ResourceSchema.ResourceFieldSchema |
Constructor and Description |
---|
ResourceSchema()
Construct an empty ResourceSchema.
|
ResourceSchema(LogicalSchema pigSchema)
Construct a ResourceSchema from a
LogicalSchema |
ResourceSchema(LogicalSchema pigSchema,
SortInfo sortInfo)
Only for use by Pig internal code.
|
ResourceSchema(Schema pigSchema)
Construct a ResourceSchema from a
Schema |
ResourceSchema(Schema pigSchema,
SortInfo sortInfo)
Only for use by Pig internal code.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
equals(ResourceSchema rs1,
ResourceSchema rs2)
Test whether two ResourceSchemas are the same.
|
java.lang.String[] |
fieldNames()
Get all field names.
|
ResourceSchema.ResourceFieldSchema[] |
getFields()
Get field schema for each field
|
ResourceSchema.Order[] |
getSortKeyOrders()
Get order for sort keys.
|
int[] |
getSortKeys()
Get the sort keys for this data.
|
int |
getVersion()
Get the version of this schema.
|
ResourceSchema |
setFields(ResourceSchema.ResourceFieldSchema[] fields)
Set all the fields.
|
ResourceSchema |
setSortKeyOrders(ResourceSchema.Order[] sortKeyOrders)
Set the order for each sort key.
|
ResourceSchema |
setSortKeys(int[] sortKeys)
Set the sort keys for htis data.
|
ResourceSchema |
setVersion(int version) |
java.lang.String |
toString() |
public ResourceSchema()
public ResourceSchema(Schema pigSchema)
Schema
pigSchema
- Schema to usepublic ResourceSchema(LogicalSchema pigSchema)
LogicalSchema
pigSchema
- Schema to use@InterfaceAudience.Private public ResourceSchema(Schema pigSchema, SortInfo sortInfo)
Schema
pigSchema
- Schema to usesortInfo
- information on how data is sorted@InterfaceAudience.Private public ResourceSchema(LogicalSchema pigSchema, SortInfo sortInfo)
LogicalSchema
pigSchema
- LogicalSchema to usesortInfo
- information on how data is sortedpublic int getVersion()
public ResourceSchema setVersion(int version)
public ResourceSchema.ResourceFieldSchema[] getFields()
public java.lang.String[] fieldNames()
public ResourceSchema setFields(ResourceSchema.ResourceFieldSchema[] fields)
fields
- to use as fields in this schemapublic int[] getSortKeys()
public ResourceSchema setSortKeys(int[] sortKeys)
sortKeys
- Each integer in the array represents the field number. So if the
schema of the data is (a, b, c, d) and the data is sorted on c, b, the sort keys
should be [2, 1]. Field numbers are zero based.public ResourceSchema.Order[] getSortKeyOrders()
getSortKeys()
.public ResourceSchema setSortKeyOrders(ResourceSchema.Order[] sortKeyOrders)
sortKeyOrders
- array of Order. Should be the same length as int[] passed to
setSortKeys(int[])
.public static boolean equals(ResourceSchema rs1, ResourceSchema rs2)
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2007-2017 The Apache Software Foundation