uber / queryparser

Parsing and analysis of Vertica, Hive, and Presto SQL.
MIT License
1.08k stars 147 forks source link

Question about the query standardization #33

Open nodew opened 6 years ago

nodew commented 6 years ago

I want to know when the work on the query standardization will begin, is there a plan on it ? And, is there a sql style-guide you follow, so others could help with it.

h4v0kh3l1 commented 6 years ago

Short answer, it begins when you and I start on it.

Right now, the points in the FUTURE.md are great ideas that will definitely benefit the project, but haven't been started.

Specifically for query standardization, there's two missing components. We need the rendering capability, to convert ASTs back into queries, and we need a representation of all the whitespace and style variables in a query. From there, we can start making a plan.

A quick search online shows that there's a million and one ways to correctly style SQL. We could go the gofmt route and pick one to enforce everywhere, or we could be flexible and have customizable style rules. Again, all part of planning.

I'd like to know what you think. Unfortunately, I'm not in a position right now to actively develop these awesome features, but I'm more than happy to work with you and other contributors to make these a reality.

dlthomas commented 6 years ago

Depending on how strict the formatter, we may not care about the original whitespace. We should clearly preserve comments, though.

On Wed, Apr 4, 2018 at 11:16 AM, Heli Wang notifications@github.com wrote:

Short answer, it begins when you and I start on it.

Right now, the points in the FUTURE.md https://github.com/uber/queryparser/blob/master/FUTURE.md are great ideas that will definitely benefit the project, but haven't been started.

Specifically for query standardization, there's two missing components. We need the rendering capability, to convert ASTs back into queries, and we need a representation of all the whitespace and style variables in a query. From there, we can start making a plan.

A quick search online shows that there's a million and one ways to correctly style SQL. We could go the gofmt route and pick one to enforce everywhere, or we could be flexible and have customizable style rules. Again, all part of planning.

I'd like to know what you think. Unfortunately, I'm not in a position right now to actively develop these awesome features, but I'm more than happy to work with you and other contributors to make these a reality.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/uber/queryparser/issues/33#issuecomment-378695674, or mute the thread https://github.com/notifications/unsubscribe-auth/ABc4k3GU3pC6KsGYpfwVN2mvrJnwgIuLks5tlQ3mgaJpZM4TGDkc .