How to use it

java -jar JSQLTranspiler.jar [-d <arg> | --any | --bigquery |
   --databricks | --snowflake | --redshift]      [-D <arg> | --duckdb]
   [-i <arg>] [-o <arg>] [-h]
curl -X 'POST'                                                                   \
  '' \
  -H 'accept: text/plain'                                                        \
  -H 'Content-Type: text/plain'                                                  \
  -d 'SELECT Nvl(null, 1) a'
import ai.starlake.transpiler.JSQLTranspiler;
String providedSQL="SELECT Nvl(null, 1) a";
String expectedSQL="SELECT Coalesce(null, 1) a";
String result = JSQLTranspiler.transpile(providedSQL, Dialect.AMAZON_REDSHIFT);
assertEquals(expectedSQL, result);

Command Line Options (CLI)

-d,–input-dialect <arg> The SQL dialect to parse.



Interpret the SQL as Generic Dialect [DEFAULT].


Interpret the SQL as Google BigQuery Dialect.


Interpret the SQL as DataBricks Dialect.


Interpret the SQL as Snowflake Dialect.


Interpret the SQL as Amazon Snowflake Dialect.

-D,–output-dialect <arg> The SQL dialect to write.



Write the SQL in the Duck DB Dialect [DEFAULT].

-i,–inputFile <arg> The input SQL file or folder.

Read from STDIN when no input file provided.

-o,–outputFile <arg> The out SQL file for the formatted

statements. Create new SQL file when folder provided. Append when existing file provided. Write to STDOUT when no output file provided.

-h,–help Print the help synopsis.


You can provide the SQL Statements as an argument to the program, e.g.

java -jar jsqltranspiler.jar \
    "SELECT Nvl( NULL, 1 ) a;
    SELECT TOP 10 qtysold, sellerid
    FROM sales
    ORDER BY qtysold DESC, sellerid;"

TimeKey substitution

The transpiler can substitute time key expressions such as CURRENT_DATE, CURRENT_TIME or CURRENT_TIMESTAMP with System’s properties like

System.setProperty("CURRENT_TIMESTAMP", "2024-06-09 16:24:23.123");
String expected = "SELECT TIMESTAMP WITHOUT TIME ZONE '2024-06-09T16:24:23.123'";
String actual = JSQLTranspiler.transpileQuery("SELECT CURRENT_TIMESTAMP", JSQLTranspiler.Dialect.ANY);