Package org.apache.drill.exec.util
Class EncodedSchemaPathSet
java.lang.Object
org.apache.drill.exec.util.EncodedSchemaPathSet
This class provided utility methods to encode and decode a set of user specified
SchemaPaths to a set of encoded SchemaPaths with the following properties.
- Valid Drill identifier as per its grammar with only one, root name segment.
- A single identifier can not exceed 1024 characters in length.
Format of the encoded SchemaPath:
$$ENC\d\dlt;base32 encoded input paths>
We use Base-32 over Base-64 because the later's charset includes '\' and '+'.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String[]
Returns the decoded array of SchemaPath strings from the input which may contain a mix of encoded and non-encoded SchemaPaths.static Collection<SchemaPath>
decode
(Collection<SchemaPath> encodedPaths) Returns the decoded Collection of SchemaPath from the input which may contain a mix of encoded and non-encoded SchemaPaths.static String[]
Returns the encoded array of SchemaPath identifiers from the input array of SchemaPath.static boolean
isEncodedSchemaPath
(String schemaPath) static boolean
isEncodedSchemaPath
(SchemaPath schemaPath)
-
Field Details
-
ENCODED_STAR_COLUMN
-
-
Constructor Details
-
EncodedSchemaPathSet
public EncodedSchemaPathSet()
-
-
Method Details
-
encode
Returns the encoded array of SchemaPath identifiers from the input array of SchemaPath.The returned identifiers have the following properties:
- Each SchemaPath identifier in the array has only one single root NameSegment.
- Maximum length of each such identifier is equal to the maximum length of Drill identifier (currently 1024).
We take advantage of the fact that Java's modified utf-8 encoding can never contain embedded null byte.
-
isEncodedSchemaPath
-
isEncodedSchemaPath
-
decode
Returns the decoded Collection of SchemaPath from the input which may contain a mix of encoded and non-encoded SchemaPaths.The size of returned Collection is always equal to or greater than the input array.
The non-encoded SchemaPaths are collated in the beginning to the returned array, in the same order as that of the input array.
-
decode
Returns the decoded array of SchemaPath strings from the input which may contain a mix of encoded and non-encoded SchemaPaths.The size of returned array is always equal to or greater than the input array.
The non-encoded SchemaPaths are collated in the beginning to the returned array, in the same order as that of the input array.
-