|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pig.impl.logicalLayer.schema.Schema.FieldSchema
public static class Schema.FieldSchema
Field Summary | |
---|---|
String |
alias
Alias for this field. |
String |
canonicalName
Canonical name. |
static CanonicalNamer |
canonicalNamer
Canonical namer object to generate new canonical names on request. |
Schema |
schema
If this is a tuple itself, it can have a schema. |
byte |
type
Datatype, using codes from DataType . |
Constructor Summary | |
---|---|
Schema.FieldSchema(Schema.FieldSchema fs)
Copy Constructor. |
|
Schema.FieldSchema(String a,
byte t)
Constructor for any type. |
|
Schema.FieldSchema(String a,
Schema s)
Constructor for tuple fields. |
|
Schema.FieldSchema(String a,
Schema s,
byte t)
Constructor for tuple fields. |
Method Summary | |
---|---|
static boolean |
castable(Schema.FieldSchema castFs,
Schema.FieldSchema inputFs)
Recursively compare two schemas to check if the input schema can be cast to the cast schema |
Schema.FieldSchema |
clone()
Make a deep copy of this FieldSchema and return it. |
boolean |
equals(Object other)
Two field schemas are equal if types and schemas are equal in all levels. |
static boolean |
equals(Schema.FieldSchema fschema,
Schema.FieldSchema fother,
boolean relaxInner,
boolean relaxAlias)
Compare two field schema for equality |
Schema.FieldSchema |
findFieldSchema(String canonicalName)
Find a field schema instance in this FieldSchema hierarchy (including "this") that matches the given canonical name. |
int |
hashCode()
|
Schema.FieldSchema |
mergePrefixFieldSchema(Schema.FieldSchema otherFs)
Recursively prefix merge two schemas |
Schema.FieldSchema |
mergePrefixFieldSchema(Schema.FieldSchema otherFs,
boolean otherTakesAliasPrecedence)
Recursively prefix merge two schemas |
Schema.FieldSchema |
mergePrefixFieldSchema(Schema.FieldSchema otherFs,
boolean otherTakesAliasPrecedence,
boolean allowMergeableTypes)
Recursively prefix merge two schemas |
static void |
setFieldSchemaDefaultType(Schema.FieldSchema fs,
byte t)
Recursively set NULL type to the specifid type |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public String alias
public byte type
DataType
.
public Schema schema
public String canonicalName
public static final CanonicalNamer canonicalNamer
Constructor Detail |
---|
public Schema.FieldSchema(String a, byte t)
a
- Alias, if known. If unknown leave null.t
- Type, using codes from
DataType
.public Schema.FieldSchema(String a, Schema s)
a
- Alias, if known. If unknown leave null.s
- Schema of this tuple.public Schema.FieldSchema(String a, Schema s, byte t) throws FrontendException
a
- Alias, if known. If unknown leave null.s
- Schema of this tuple.t
- Type, using codes from
DataType
.
FrontendException
public Schema.FieldSchema(Schema.FieldSchema fs)
fs
- Source FieldSchemaMethod Detail |
---|
public boolean equals(Object other)
equals
in class Object
public int hashCode()
hashCode
in class Object
public static boolean castable(Schema.FieldSchema castFs, Schema.FieldSchema inputFs)
castFs
- schema of the cast operatorinputFs
- schema of the cast input
public static boolean equals(Schema.FieldSchema fschema, Schema.FieldSchema fother, boolean relaxInner, boolean relaxAlias)
fschema
- fother
- relaxInner
- If true, we don't check inner tuple schemasrelaxAlias
- If true, we don't check aliases
public String toString()
toString
in class Object
public Schema.FieldSchema clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public Schema.FieldSchema mergePrefixFieldSchema(Schema.FieldSchema otherFs) throws SchemaMergeException
otherFs
- the other field schema to be merged with
SchemaMergeException
- if they cannot be mergedpublic Schema.FieldSchema mergePrefixFieldSchema(Schema.FieldSchema otherFs, boolean otherTakesAliasPrecedence) throws SchemaMergeException
otherFs
- the other field schema to be merged withotherTakesAliasPrecedence
- true if aliases from the other
field schema take precedence
SchemaMergeException
- if they cannot be mergedpublic Schema.FieldSchema mergePrefixFieldSchema(Schema.FieldSchema otherFs, boolean otherTakesAliasPrecedence, boolean allowMergeableTypes) throws SchemaMergeException
otherFs
- the other field schema to be merged withotherTakesAliasPrecedence
- true if aliases from the other
field schema take precedenceallowMergeableTypes
- true if "mergeable" types should be allowed.
Two types are mergeable if any of the following conditions is true IN THE
BELOW ORDER of checks:
1) if either one has a type null or unknown and other has a type OTHER THAN
null or unknown, the result type will be the latter non null/unknown type
2) If either type is bytearray, then result type will be the other (possibly non BYTEARRAY) type
3) If current type can be cast to the other type, then the result type will be the
other type
SchemaMergeException
- if they cannot be mergedpublic static void setFieldSchemaDefaultType(Schema.FieldSchema fs, byte t)
fs
- the field schema whose NULL type has to be sett
- the specified typepublic Schema.FieldSchema findFieldSchema(String canonicalName)
canonicalName
- canonical name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |