Coder Social home page Coder Social logo

trino-query-formatter's People

Contributors

dependabot[bot] avatar findepi avatar kokosing avatar nineinchnick avatar yuokada avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

trino-query-formatter's Issues

AWS Athena query support

Not sure whether this is certain place to ask but I was looking for Presto (AWS athena query) formatter and came up here.
Would it be possible to support Athena query or do they use dialect so it wouldn't be supported here?

I already faced three error on parsing... I'll put error messages below.

  1. CREATE EXTERNAL when I tried to create external table
$ cat sample.sql | presto-query-formatter-0.2-executable.jar > formatted.sql
Exception in thread "main" com.facebook.presto.sql.parser.ParsingException: line 1:8: no viable alternative at input 'CREATE EXTERNAL'
	at com.facebook.presto.sql.parser.SqlParser$1.syntaxError(SqlParser.java:45)
	at org.antlr.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:41)
	at org.antlr.v4.runtime.Parser.notifyErrorListeners(Parser.java:540)
	at org.antlr.v4.runtime.DefaultErrorStrategy.reportNoViableAlternative(DefaultErrorStrategy.java:284)
	at org.antlr.v4.runtime.DefaultErrorStrategy.reportError(DefaultErrorStrategy.java:121)
	at com.facebook.presto.sql.parser.SqlBaseParser.statement(SqlBaseParser.java:2638)
	at com.facebook.presto.sql.parser.SqlBaseParser.singleStatement(SqlBaseParser.java:236)
	at com.facebook.presto.sql.parser.SqlParser.invokeParser(SqlParser.java:92)
	at com.facebook.presto.sql.parser.SqlParser.createStatement(SqlParser.java:65)
	at rocks.prestodb.query.formatter.Main.format(Main.java:61)
	at rocks.prestodb.query.formatter.Main.main(Main.java:42)
Caused by: org.antlr.v4.runtime.NoViableAltException
	at org.antlr.v4.runtime.atn.ParserATNSimulator.noViableAlt(ParserATNSimulator.java:2025)
	at org.antlr.v4.runtime.atn.ParserATNSimulator.execATN(ParserATNSimulator.java:467)
	at org.antlr.v4.runtime.atn.ParserATNSimulator.adaptivePredict(ParserATNSimulator.java:393)
	at com.facebook.presto.sql.parser.SqlBaseParser.statement(SqlBaseParser.java:1376)
  1. ` backtick
$ cat sample.sql | presto-query-formatter-0.2-executable.jar > formatted.sql
Exception in thread "main" com.facebook.presto.sql.parser.ParsingException: line 2:9: backquoted identifiers are not supported; use double quotes to quote identifiers
	at com.facebook.presto.sql.parser.SqlParser$PostProcessor.exitBackQuotedIdentifier(SqlParser.java:133)
	at com.facebook.presto.sql.parser.SqlBaseParser$BackQuotedIdentifierContext.exitRule(SqlBaseParser.java:10605)
	at org.antlr.v4.runtime.Parser.triggerExitRuleEvent(Parser.java:404)
	at org.antlr.v4.runtime.Parser.exitRule(Parser.java:620)
	at com.facebook.presto.sql.parser.SqlBaseParser.singleStatement(SqlBaseParser.java:247)
	at com.facebook.presto.sql.parser.SqlParser.invokeParser(SqlParser.java:92)
	at com.facebook.presto.sql.parser.SqlParser.createStatement(SqlParser.java:65)
	at rocks.prestodb.query.formatter.Main.format(Main.java:61)
	at rocks.prestodb.query.formatter.Main.main(Main.java:42)
  1. struct after <
$ cat sample.sql | presto-query-formatter-0.2-executable.jar > formatted.sql
Exception in thread "main" com.facebook.presto.sql.parser.ParsingException: line 4:29: mismatched input '<' expecting {'(', 'ARRAY', '>'}
	at com.facebook.presto.sql.parser.SqlParser$1.syntaxError(SqlParser.java:45)
	at org.antlr.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:41)
	at org.antlr.v4.runtime.Parser.notifyErrorListeners(Parser.java:540)
	at org.antlr.v4.runtime.DefaultErrorStrategy.reportInputMismatch(DefaultErrorStrategy.java:301)
	at org.antlr.v4.runtime.DefaultErrorStrategy.reportError(DefaultErrorStrategy.java:124)
	at com.facebook.presto.sql.parser.SqlBaseParser.type(SqlBaseParser.java:9038)
	at com.facebook.presto.sql.parser.SqlBaseParser.type(SqlBaseParser.java:8921)
	at com.facebook.presto.sql.parser.SqlBaseParser.columnDefinition(SqlBaseParser.java:2987)
	at com.facebook.presto.sql.parser.SqlBaseParser.tableElement(SqlBaseParser.java:2922)
	at com.facebook.presto.sql.parser.SqlBaseParser.statement(SqlBaseParser.java:1638)
	at com.facebook.presto.sql.parser.SqlBaseParser.singleStatement(SqlBaseParser.java:236)
	at com.facebook.presto.sql.parser.SqlParser.invokeParser(SqlParser.java:92)
	at com.facebook.presto.sql.parser.SqlParser.createStatement(SqlParser.java:65)
	at rocks.prestodb.query.formatter.Main.format(Main.java:61)
	at rocks.prestodb.query.formatter.Main.main(Main.java:42)
Caused by: org.antlr.v4.runtime.InputMismatchException
	at org.antlr.v4.runtime.DefaultErrorStrategy.sync(DefaultErrorStrategy.java:244)
	at com.facebook.presto.sql.parser.SqlBaseParser.type(SqlBaseParser.java:8979)
	... 9 more

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.