Class RedshiftSqlParser

Object
gudusoft.gsqlparser.parser.AbstractSqlParser
gudusoft.gsqlparser.parser.RedshiftSqlParser
All Implemented Interfaces:
SqlParser

Amazon Redshift SQL parser implementation.

This parser handles Redshift-specific SQL syntax including:

  • PostgreSQL-based syntax (Redshift is based on PostgreSQL 8.0.2)
  • PL/pgSQL functions and procedures
  • CREATE FUNCTION with LANGUAGE clause
  • Function body delimiters ($$)
  • Redshift-specific types (ARRAY<type>, %ROWTYPE, etc.)
  • Redshift-specific keywords (FILTER, LANGUAGE, etc.)

Design Notes:

Usage Example:

 // Get Redshift parser from factory
 SqlParser parser = SqlParserFactory.get(EDbVendor.dbvredshift);

 // Build context
 ParserContext context = new ParserContext.Builder(EDbVendor.dbvredshift)
     .sqlText("SELECT * FROM orders WHERE order_date > CURRENT_DATE - 7")
     .build();

 // Parse
 SqlParseResult result = parser.parse(context);

 // Access statements
 TStatementList statements = result.getSqlStatements();
 
Since:
3.2.0.0
See Also: