|
|
@@ -428,82 +428,6 @@ PrimaryKey_EDIT
|
|
|
}
|
|
|
;
|
|
|
|
|
|
-ClusteredBy
|
|
|
- : 'CLUSTERED' 'BY' ParenthesizedColumnList OptionalSortedBy 'INTO' 'UNSIGNED_INTEGER' 'BUCKETS'
|
|
|
- ;
|
|
|
-
|
|
|
-ClusteredBy_EDIT
|
|
|
- : 'CLUSTERED' 'CURSOR'
|
|
|
- {
|
|
|
- parser.suggestKeywords(['BY']);
|
|
|
- }
|
|
|
- | 'CLUSTERED' 'BY' ParenthesizedColumnList_EDIT OptionalSortedBy
|
|
|
- | 'CLUSTERED' 'BY' ParenthesizedColumnList_EDIT OptionalSortedBy 'INTO' 'UNSIGNED_INTEGER' 'BUCKETS'
|
|
|
- | 'CLUSTERED' 'BY' ParenthesizedColumnList OptionalSortedBy 'CURSOR'
|
|
|
- {
|
|
|
- if (!$4) {
|
|
|
- parser.suggestKeywords([{ value: 'INTO', weight: 1 }, { value: 'SORTED BY', weight: 2 }]);
|
|
|
- } else {
|
|
|
- parser.suggestKeywords(['INTO']);
|
|
|
- }
|
|
|
- }
|
|
|
- | 'CLUSTERED' 'BY' ParenthesizedColumnList OptionalSortedBy 'INTO' 'UNSIGNED_INTEGER' 'CURSOR'
|
|
|
- {
|
|
|
- parser.suggestKeywords(['BUCKETS']);
|
|
|
- }
|
|
|
- | 'CLUSTERED' 'BY' ParenthesizedColumnList OptionalSortedBy_EDIT 'INTO' 'UNSIGNED_INTEGER' 'BUCKETS'
|
|
|
- | 'CLUSTERED' 'BY' ParenthesizedColumnList OptionalSortedBy_EDIT
|
|
|
- ;
|
|
|
-
|
|
|
-OptionalSortedBy
|
|
|
- :
|
|
|
- | 'SORTED' 'BY' ParenthesizedSortList
|
|
|
- ;
|
|
|
-
|
|
|
-OptionalSortedBy_EDIT
|
|
|
- : 'SORTED' 'CURSOR'
|
|
|
- {
|
|
|
- parser.suggestKeywords(['BY']);
|
|
|
- }
|
|
|
- | 'SORTED' 'BY' ParenthesizedSortList_EDIT
|
|
|
- ;
|
|
|
-
|
|
|
-ParenthesizedSortList
|
|
|
- : '(' SortList ')'
|
|
|
- ;
|
|
|
-
|
|
|
-ParenthesizedSortList_EDIT
|
|
|
- : '(' SortList_EDIT RightParenthesisOrError
|
|
|
- ;
|
|
|
-
|
|
|
-SortList
|
|
|
- : SortIdentifier
|
|
|
- | SortList ',' SortIdentifier
|
|
|
- ;
|
|
|
-
|
|
|
-SortList_EDIT
|
|
|
- : SortIdentifier_EDIT
|
|
|
- | SortIdentifier_EDIT ',' SortList
|
|
|
- | SortList ',' SortIdentifier_EDIT
|
|
|
- | SortList ',' SortIdentifier_EDIT ',' SortList
|
|
|
- ;
|
|
|
-
|
|
|
-SortIdentifier
|
|
|
- : ColumnIdentifier OptionalAscOrDesc
|
|
|
- ;
|
|
|
-
|
|
|
-SortIdentifier_EDIT
|
|
|
- : ColumnIdentifier OptionalAscOrDesc 'CURSOR'
|
|
|
- {
|
|
|
- parser.checkForKeywords($2);
|
|
|
- }
|
|
|
- | ColumnIdentifier_EDIT OptionalAscOrDesc
|
|
|
- | AnyCursor OptionalAscOrDesc
|
|
|
- {
|
|
|
- parser.suggestColumns();
|
|
|
- }
|
|
|
- ;
|
|
|
-
|
|
|
ParenthesizedSkewedValueList
|
|
|
: '(' SkewedValueList ')'
|
|
|
;
|
|
|
@@ -513,30 +437,6 @@ SkewedValueList
|
|
|
| SkewedValueList ',' ParenthesizedSimpleValueList
|
|
|
;
|
|
|
|
|
|
-OptionalRowFormat
|
|
|
- :
|
|
|
- | RowFormat
|
|
|
- ;
|
|
|
-
|
|
|
-RowFormat
|
|
|
- : 'ROW' 'FORMAT' RowFormatSpec
|
|
|
- {
|
|
|
- $$ = $3
|
|
|
- }
|
|
|
- ;
|
|
|
-
|
|
|
-RowFormat_EDIT
|
|
|
- : 'ROW' 'CURSOR'
|
|
|
- {
|
|
|
- parser.suggestKeywords(['FORMAT']);
|
|
|
- }
|
|
|
- | 'ROW' 'FORMAT' 'CURSOR'
|
|
|
- {
|
|
|
- parser.suggestKeywords(['DELIMITED', 'SERDE']);
|
|
|
- }
|
|
|
- | 'ROW' 'FORMAT' RowFormatSpec_EDIT
|
|
|
- ;
|
|
|
-
|
|
|
OptionalStoredAsOrBy
|
|
|
:
|
|
|
| StoredAsOrBy
|
|
|
@@ -612,160 +512,6 @@ FileFormat
|
|
|
| 'TEXTFILE'
|
|
|
;
|
|
|
|
|
|
-RowFormatSpec
|
|
|
- : DelimitedRowFormat
|
|
|
- | 'SERDE' QuotedValue
|
|
|
- ;
|
|
|
-
|
|
|
-RowFormatSpec_EDIT
|
|
|
- : DelimitedRowFormat_EDIT
|
|
|
- ;
|
|
|
-
|
|
|
-DelimitedRowFormat
|
|
|
- : 'DELIMITED' OptionalFieldsTerminatedBy OptionalCollectionItemsTerminatedBy OptionalMapKeysTerminatedBy OptionalLinesTerminatedBy OptionalNullDefinedAs
|
|
|
- {
|
|
|
- if (!$2 && !$3 && !$4 && !$5 && !$6) {
|
|
|
- $$ = { suggestKeywords: [{ value: 'FIELDS TERMINATED BY', weight: 5 }, { value: 'COLLECTION ITEMS TERMINATED BY', weight: 4 }, { value: 'MAP KEYS TERMINATED BY', weight: 3 }, { value: 'LINES TERMINATED BY', weight: 2 }, { value: 'NULL DEFINED AS', weight: 1 }]};
|
|
|
- } else if ($2 && $2.suggestKeywords && !$3 && !$4 && !$5 && !$6) {
|
|
|
- $$ = { suggestKeywords: parser.createWeightedKeywords($2.suggestKeywords, 5).concat([{ value: 'COLLECTION ITEMS TERMINATED BY', weight: 4 }, { value: 'MAP KEYS TERMINATED BY', weight: 3 }, { value: 'LINES TERMINATED BY', weight: 2 }, { value: 'NULL DEFINED AS', weight: 1 }]) };
|
|
|
- } else if (!$3 && !$4 && !$5 && !$6) {
|
|
|
- $$ = { suggestKeywords: [{ value: 'COLLECTION ITEMS TERMINATED BY', weight: 4 }, { value: 'MAP KEYS TERMINATED BY', weight: 3 }, { value: 'LINES TERMINATED BY', weight: 2 }, { value: 'NULL DEFINED AS', weight: 1 }] };
|
|
|
- } else if (!$4 && !$5 && !$6) {
|
|
|
- $$ = { suggestKeywords: [{ value: 'MAP KEYS TERMINATED BY', weight: 3 }, { value: 'LINES TERMINATED BY', weight: 2 }, { value: 'NULL DEFINED AS', weight: 1 }] };
|
|
|
- } else if (!$5 && !$6) {
|
|
|
- $$ = { suggestKeywords: [{ value: 'LINES TERMINATED BY', weight: 2 }, { value: 'NULL DEFINED AS', weight: 1 }] };
|
|
|
- } else if (!$6) {
|
|
|
- $$ = { suggestKeywords: [{ value: 'NULL DEFINED AS', weight: 1 }] };
|
|
|
- }
|
|
|
- }
|
|
|
- ;
|
|
|
-
|
|
|
-DelimitedRowFormat_EDIT
|
|
|
- : 'DELIMITED' OptionalFieldsTerminatedBy_EDIT OptionalCollectionItemsTerminatedBy OptionalMapKeysTerminatedBy
|
|
|
- OptionalLinesTerminatedBy OptionalNullDefinedAs
|
|
|
- | 'DELIMITED' OptionalFieldsTerminatedBy OptionalCollectionItemsTerminatedBy_EDIT OptionalMapKeysTerminatedBy
|
|
|
- OptionalLinesTerminatedBy OptionalNullDefinedAs
|
|
|
- | 'DELIMITED' OptionalFieldsTerminatedBy OptionalCollectionItemsTerminatedBy OptionalMapKeysTerminatedBy_EDIT
|
|
|
- OptionalLinesTerminatedBy OptionalNullDefinedAs
|
|
|
- | 'DELIMITED' OptionalFieldsTerminatedBy OptionalCollectionItemsTerminatedBy OptionalMapKeysTerminatedBy
|
|
|
- OptionalLinesTerminatedBy_EDIT OptionalNullDefinedAs
|
|
|
- | 'DELIMITED' OptionalFieldsTerminatedBy OptionalCollectionItemsTerminatedBy OptionalMapKeysTerminatedBy
|
|
|
- OptionalLinesTerminatedBy OptionalNullDefinedAs_EDIT
|
|
|
- ;
|
|
|
-
|
|
|
-OptionalFieldsTerminatedBy
|
|
|
- :
|
|
|
- | 'FIELDS' 'TERMINATED' 'BY' SingleQuotedValue -> { suggestKeywords: ['ESCAPED BY'] }
|
|
|
- | 'FIELDS' 'TERMINATED' 'BY' SingleQuotedValue 'ESCAPED' 'BY' SingleQuotedValue
|
|
|
- ;
|
|
|
-
|
|
|
-OptionalFieldsTerminatedBy_EDIT
|
|
|
- : 'FIELDS' 'CURSOR'
|
|
|
- {
|
|
|
- parser.suggestKeywords(['TERMINATED BY']);
|
|
|
- }
|
|
|
- | 'FIELDS' 'TERMINATED' 'CURSOR'
|
|
|
- {
|
|
|
- parser.suggestKeywords(['BY']);
|
|
|
- }
|
|
|
- | 'FIELDS' 'TERMINATED' 'BY' SingleQuotedValue 'ESCAPED' 'CURSOR'
|
|
|
- {
|
|
|
- parser.suggestKeywords(['BY']);
|
|
|
- }
|
|
|
- ;
|
|
|
-
|
|
|
-OptionalCollectionItemsTerminatedBy
|
|
|
- :
|
|
|
- | 'COLLECTION' 'ITEMS' 'TERMINATED' 'BY' SingleQuotedValue
|
|
|
- ;
|
|
|
-
|
|
|
-OptionalCollectionItemsTerminatedBy_EDIT
|
|
|
- : 'COLLECTION' 'CURSOR'
|
|
|
- {
|
|
|
- parser.suggestKeywords(['ITEMS TERMINATED BY']);
|
|
|
- }
|
|
|
- | 'COLLECTION' 'ITEMS' 'CURSOR'
|
|
|
- {
|
|
|
- parser.suggestKeywords(['TERMINATED BY']);
|
|
|
- }
|
|
|
- | 'COLLECTION' 'ITEMS' 'TERMINATED' 'CURSOR'
|
|
|
- {
|
|
|
- parser.suggestKeywords(['BY']);
|
|
|
- }
|
|
|
- ;
|
|
|
-
|
|
|
-OptionalMapKeysTerminatedBy
|
|
|
- :
|
|
|
- | 'MAP' 'KEYS' 'TERMINATED' 'BY' SingleQuotedValue
|
|
|
- ;
|
|
|
-
|
|
|
-OptionalMapKeysTerminatedBy_EDIT
|
|
|
- : 'MAP' 'CURSOR'
|
|
|
- {
|
|
|
- parser.suggestKeywords(['KEYS TERMINATED BY']);
|
|
|
- }
|
|
|
- | 'MAP' 'KEYS' 'CURSOR'
|
|
|
- {
|
|
|
- parser.suggestKeywords(['TERMINATED BY']);
|
|
|
- }
|
|
|
- | 'MAP' 'KEYS' 'TERMINATED' 'CURSOR'
|
|
|
- {
|
|
|
- parser.suggestKeywords(['BY']);
|
|
|
- }
|
|
|
- ;
|
|
|
-
|
|
|
-OptionalLinesTerminatedBy
|
|
|
- :
|
|
|
- | 'LINES' 'TERMINATED' 'BY' SingleQuotedValue
|
|
|
- ;
|
|
|
-
|
|
|
-OptionalLinesTerminatedBy_EDIT
|
|
|
- : 'LINES' 'CURSOR'
|
|
|
- {
|
|
|
- parser.suggestKeywords(['TERMINATED BY']);
|
|
|
- }
|
|
|
- | 'LINES' 'TERMINATED' 'CURSOR'
|
|
|
- {
|
|
|
- parser.suggestKeywords(['BY']);
|
|
|
- }
|
|
|
- ;
|
|
|
-
|
|
|
-OptionalNullDefinedAs
|
|
|
- :
|
|
|
- | 'NULL' 'DEFINED' 'AS' SingleQuotedValue
|
|
|
- ;
|
|
|
-
|
|
|
-OptionalNullDefinedAs_EDIT
|
|
|
- : 'NULL' 'CURSOR'
|
|
|
- {
|
|
|
- parser.suggestKeywords(['DEFINED AS']);
|
|
|
- }
|
|
|
- | 'NULL' 'DEFINED' 'CURSOR'
|
|
|
- {
|
|
|
- parser.suggestKeywords(['AS']);
|
|
|
- }
|
|
|
- ;
|
|
|
-
|
|
|
-OptionalWithSerdeproperties
|
|
|
- :
|
|
|
- | WithSerdeproperties
|
|
|
- ;
|
|
|
-
|
|
|
-WithSerdeproperties
|
|
|
- :'WITH' 'SERDEPROPERTIES' ParenthesizedPropertyAssignmentList
|
|
|
- ;
|
|
|
-
|
|
|
-WithSerdeproperties_EDIT
|
|
|
- : 'WITH' 'CURSOR'
|
|
|
- {
|
|
|
- parser.suggestKeywords(['SERDEPROPERTIES']);
|
|
|
- }
|
|
|
- | 'WITH' 'CURSOR' ParenthesizedPropertyAssignmentList
|
|
|
- {
|
|
|
- parser.suggestKeywords(['SERDEPROPERTIES']);
|
|
|
- }
|
|
|
- ;
|
|
|
-
|
|
|
OptionalTblproperties
|
|
|
:
|
|
|
| TblProperties
|