Skip to content

Commit

Permalink
Merge pull request #2244 from taozhi8833998/fix-real-type-athena
Browse files Browse the repository at this point in the history
fix: support real type in athena
  • Loading branch information
taozhi8833998 authored Nov 29, 2024
2 parents 3d1d73d + 6cf6a95 commit ab7376b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pegjs/athena.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -2469,6 +2469,7 @@ KW_MEDIUMTEXT = "MEDIUMTEXT"i !ident_start { return 'MEDIUMTEXT'; }
KW_LONGTEXT = "LONGTEXT"i !ident_start { return 'LONGTEXT'; }
KW_BIGINT = "BIGINT"i !ident_start { return 'BIGINT'; }
KW_FLOAT = "FLOAT"i !ident_start { return 'FLOAT'; }
KW_REAL = "REAL"i !ident_start { return 'REAL'; }
KW_DOUBLE = "DOUBLE"i !ident_start { return 'DOUBLE'; }
KW_DATE = "DATE"i !ident_start { return 'DATE'; }
KW_DATETIME = "DATETIME"i !ident_start { return 'DATETIME'; }
Expand Down Expand Up @@ -2802,9 +2803,9 @@ numeric_type_suffix
return result
}
numeric_type
= t:(KW_NUMERIC / KW_DECIMAL / KW_INT / KW_INTEGER / KW_SMALLINT / KW_TINYINT / KW_BIGINT / KW_FLOAT / KW_DOUBLE) __ LPAREN __ l:[0-9]+ __ r:(COMMA __ [0-9]+)? __ RPAREN __ s:numeric_type_suffix? { return { dataType: t, length: parseInt(l.join(''), 10), scale: r && parseInt(r[2].join(''), 10), parentheses: true, suffix: s }; }
/ t:(KW_NUMERIC / KW_DECIMAL / KW_INT / KW_INTEGER / KW_SMALLINT / KW_TINYINT / KW_BIGINT / KW_FLOAT / KW_DOUBLE)l:[0-9]+ __ s:numeric_type_suffix? { return { dataType: t, length: parseInt(l.join(''), 10), suffix: s }; }
/ t:(KW_NUMERIC / KW_DECIMAL / KW_INT / KW_INTEGER / KW_SMALLINT / KW_TINYINT / KW_BIGINT / KW_FLOAT / KW_DOUBLE) __ s:numeric_type_suffix? __{ return { dataType: t, suffix: s }; }
= t:(KW_NUMERIC / KW_DECIMAL / KW_INT / KW_INTEGER / KW_SMALLINT / KW_TINYINT / KW_BIGINT / KW_FLOAT / KW_DOUBLE / KW_REAL) __ LPAREN __ l:[0-9]+ __ r:(COMMA __ [0-9]+)? __ RPAREN __ s:numeric_type_suffix? { return { dataType: t, length: parseInt(l.join(''), 10), scale: r && parseInt(r[2].join(''), 10), parentheses: true, suffix: s }; }
/ t:(KW_NUMERIC / KW_DECIMAL / KW_INT / KW_INTEGER / KW_SMALLINT / KW_TINYINT / KW_BIGINT / KW_FLOAT / KW_DOUBLE / KW_REAL)l:[0-9]+ __ s:numeric_type_suffix? { return { dataType: t, length: parseInt(l.join(''), 10), suffix: s }; }
/ t:(KW_NUMERIC / KW_DECIMAL / KW_INT / KW_INTEGER / KW_SMALLINT / KW_TINYINT / KW_BIGINT / KW_FLOAT / KW_DOUBLE / KW_REAL) __ s:numeric_type_suffix? __{ return { dataType: t, suffix: s }; }
datetime_type
= t:(KW_DATE / KW_DATETIME / KW_TIME / KW_TIMESTAMP) __ LPAREN __ l:[0-9]+ __ RPAREN { return { dataType: t, length: parseInt(l.join(''), 10), parentheses: true }; }
/ t:(KW_DATE / KW_DATETIME / KW_TIME / KW_TIMESTAMP) { return { dataType: t }; }
Expand Down

0 comments on commit ab7376b

Please sign in to comment.