Dmitry Lychagin has submitted this change and it was merged. Change subject: [ASTERIXDB-2351][COMP] Allow '+' after exponent indicator in double literals ......................................................................
[ASTERIXDB-2351][COMP] Allow '+' after exponent indicator in double literals - user model changes: no - storage format changes: no - interface changes: no Details: - Allow '+' sign after exponent indicator when parsing double literals in scientific notation Change-Id: I1f27c0db786269cce90ef43463df1a398fd1e5cd Reviewed-on: https://asterix-gerrit.ics.uci.edu/2552 Sonar-Qube: Jenkins <jenk...@fulliautomatix.ics.uci.edu> Tested-by: Jenkins <jenk...@fulliautomatix.ics.uci.edu> Integration-Tests: Jenkins <jenk...@fulliautomatix.ics.uci.edu> Contrib: Jenkins <jenk...@fulliautomatix.ics.uci.edu> Reviewed-by: Till Westmann <ti...@apache.org> --- M asterixdb/asterix-app/src/test/resources/runtimets/queries/numeric/scientific/scientific.1.query.aql M asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/numeric/scientific/scientific.1.query.sqlpp M asterixdb/asterix-app/src/test/resources/runtimets/results/numeric/scientific/scientific.1.adm M asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj M asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj 5 files changed, 15 insertions(+), 9 deletions(-) Approvals: Anon. E. Moose #1000171: Till Westmann: Looks good to me, approved Jenkins: Verified; No violations found; ; Verified diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/numeric/scientific/scientific.1.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/numeric/scientific/scientific.1.query.aql index d668b0b..2ae391b 100644 --- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/numeric/scientific/scientific.1.query.aql +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/numeric/scientific/scientific.1.query.aql @@ -17,5 +17,7 @@ * under the License. */ -[2e5, 2e-5, .2e2, .2e-2, 0.5e3, 0.5e-3, 3.2e5, 3.2e-5] +let $v1 := [2e5, 2e+5, 2e-5, .2e2, .2e+2, .2e-2, 0.5e3, 0.5e+3, 0.5e-3, 3.2e5, 3.2e+5, 3.2e-5 ] +let $v2 := [2E5, 2E+5, 2E-5, .2E2, .2E+2, .2E-2, 0.5E3, 0.5E+3, 0.5E-3, 3.2E5, 3.2E+5, 3.2E-5 ] +return { "t1": $v1, "t2": $v2 } diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/numeric/scientific/scientific.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/numeric/scientific/scientific.1.query.sqlpp index d668b0b..2bfe15f 100644 --- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/numeric/scientific/scientific.1.query.sqlpp +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/numeric/scientific/scientific.1.query.sqlpp @@ -17,5 +17,9 @@ * under the License. */ -[2e5, 2e-5, .2e2, .2e-2, 0.5e3, 0.5e-3, 3.2e5, 3.2e-5] +{ + "t1": [2e5, 2e+5, 2e-5, .2e2, .2e+2, .2e-2, 0.5e3, 0.5e+3, 0.5e-3, 3.2e5, 3.2e+5, 3.2e-5 ], + "t2": [2E5, 2E+5, 2E-5, .2E2, .2E+2, .2E-2, 0.5E3, 0.5E+3, 0.5E-3, 3.2E5, 3.2E+5, 3.2E-5 ] +} + diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/numeric/scientific/scientific.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/numeric/scientific/scientific.1.adm index f65c2fe..1a2e70f 100644 --- a/asterixdb/asterix-app/src/test/resources/runtimets/results/numeric/scientific/scientific.1.adm +++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/numeric/scientific/scientific.1.adm @@ -1 +1 @@ -[ 200000.0, 2.0E-5, 20.0, 0.002, 500.0, 5.0E-4, 320000.0, 3.2E-5 ] \ No newline at end of file +{ "t1": [ 200000.0, 200000.0, 2.0E-5, 20.0, 20.0, 0.002, 500.0, 500.0, 5.0E-4, 320000.0, 320000.0, 3.2E-5 ], "t2": [ 200000.0, 200000.0, 2.0E-5, 20.0, 20.0, 0.002, 500.0, 500.0, 5.0E-4, 320000.0, 320000.0, 3.2E-5 ] } \ No newline at end of file diff --git a/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj b/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj index 74fe907..2d87556 100644 --- a/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj +++ b/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj @@ -2805,9 +2805,9 @@ <DEFAULT,IN_DBL_BRACE> TOKEN: { - < DOUBLE_LITERAL: <DIGITS> ( "." <DIGITS> ) (("e"|"E") ("-")? <DIGITS>)? - | <DIGITS> (("e"|"E") ("-")? <DIGITS>) - | "." <DIGITS> (("e"|"E") ("-")? <DIGITS>)? + < DOUBLE_LITERAL: <DIGITS> ( "." <DIGITS> ) (("e"|"E") ("+"|"-")? <DIGITS>)? + | <DIGITS> (("e"|"E") ("+"|"-")? <DIGITS>) + | "." <DIGITS> (("e"|"E") ("+"|"-")? <DIGITS>)? > | < FLOAT_LITERAL: <DIGITS> ( "f" | "F" ) | <DIGITS> ( "." <DIGITS> ( "f" | "F" ) )? diff --git a/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj b/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj index 246c251..9af114b 100644 --- a/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj +++ b/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj @@ -3387,9 +3387,9 @@ <DEFAULT,IN_DBL_BRACE> TOKEN: { - < DOUBLE_LITERAL: <DIGITS> ( "." <DIGITS> ) (("e"|"E") ("-")? <DIGITS>)? - | <DIGITS> (("e"|"E") ("-")? <DIGITS>) - | "." <DIGITS> (("e"|"E") ("-")? <DIGITS>)? + < DOUBLE_LITERAL: <DIGITS> ( "." <DIGITS> ) (("e"|"E") ("+"|"-")? <DIGITS>)? + | <DIGITS> (("e"|"E") ("+"|"-")? <DIGITS>) + | "." <DIGITS> (("e"|"E") ("+"|"-")? <DIGITS>)? > | < FLOAT_LITERAL: <DIGITS> ( "f" | "F" ) | <DIGITS> ( "." <DIGITS> ( "f" | "F" ) )? -- To view, visit https://asterix-gerrit.ics.uci.edu/2552 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1f27c0db786269cce90ef43463df1a398fd1e5cd Gerrit-PatchSet: 3 Gerrit-Project: asterixdb Gerrit-Branch: release-0.9.4-pre-rc Gerrit-Owner: Dmitry Lychagin <dmitry.lycha...@couchbase.com> Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Dmitry Lychagin <dmitry.lycha...@couchbase.com> Gerrit-Reviewer: Jenkins <jenk...@fulliautomatix.ics.uci.edu> Gerrit-Reviewer: Till Westmann <ti...@apache.org>