JSqlParser icon indicating copy to clipboard operation
JSqlParser copied to clipboard

Missing support for presto : TABLESAMPLE BERNOULLI clause

Open ctdcj opened this issue 3 years ago • 2 comments
trafficstars

SELECT * FROM fact_halllogin_detail TABLESAMPLE BERNOULLI (10) where dt>=20220710 limit 10

Exception: Encountered unexpected token: "BERNOULLI" <S_IDENTIFIER> at line 1, column 49.

Was expecting one of:

";"
"CONNECT"
"EMIT"
"GROUP"
"HAVING"
"PIVOT"
"START"
"WINDOW"
<EOF>

ctdcj avatar Jul 18 '22 05:07 ctdcj

Greetings. You will need to provide much more information please:

  1. What RDBMS
  2. What Version of JSQLParser
  3. What should the BERNOULLI(10) represent, it seems to be far from any SQL dialect I know

Looks like we are talking about: https://wiki.postgresql.org/wiki/TABLESAMPLE_Implementation In short, it is not supported but you can provide or sponsor an Implementation.

Correction, it seems to be in the SQL:2003 standard also: http://www.neilconway.org/talks/hacking/ottawa/sql_standard.pdf

Suggestion: Edit the caption into something like "Missing support for SQL:2003 TABLESAMPLE clause"

manticore-projects avatar Jul 18 '22 05:07 manticore-projects

Greetings. I am using jsqlparser version 4.4 and the corresponding database is prestodb.

ctdcj avatar Jul 18 '22 05:07 ctdcj

Working on it, since it is SQL:2016 compliant.

manticore-projects avatar May 11 '23 13:05 manticore-projects