Fork me on GitHub

has anyone tried parsing between sql flavors? For example make a Redshift legal sql query a Hive legal sql query, assuming identical table and column names ? Would instaparse be a good fit for this kind of translation?


I'm not familiar with the differences of Redshift and Hive formats; how many gotchas are there when going between the two styles?


there are differences in data types in create table statements, there are also differences in syntax and function calls


just trying to gauge if such translations are a good fit to try in instaparse


Instaparse's job is to fully parse a string and return its meaning as a tree of data. If you need to fully parse a sql query and examine the data before you know what to do with it, Instaparse is a good choice. But if the problem could be solved by a regular expression searching the string for patterns, Instaparse might be overkill.