redshift

package
v0.0.0-...-a2c0b89 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2019 License: Unlicense Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TokenCopy is COPY
	TokenCopy lex.TokenType = 250 // TURELLA
	// TokenCIamRole is "iam_role" for authorization
	TokenCIamRole lex.TokenType = 350 // iam_role // TURELLA
	// TokenCDelimiter is "delimiter"
	TokenCDelimiter lex.TokenType = 351 // delimiter // TURELLA
	// TokenCEscape is "escape"
	TokenCEscape lex.TokenType = 352 // escape // TURELLA
	// TokenCManifest is "manifest"
	TokenCManifest lex.TokenType = 353 // manifest // TURELLA
	// TokenCQuoteAs is "quote-as"
	TokenCQuoteAs lex.TokenType = 354 // quote-as // TURELLA
	// TokenCExplicitIds is "explicit_ids"
	TokenCExplicitIds lex.TokenType = 355 // explicit_ids // TURELLA
	// TokenCRemovequotes is "removequotes"
	TokenCRemovequotes lex.TokenType = 356 // removequotes // TURELLA
	// TokenCEmptyasnull is "emptyasnull"
	TokenCEmptyasnull lex.TokenType = 357 // emptyasnull // TURELLA
	// TokenCBlanksasnull is "blanksasnull"
	TokenCBlanksasnull lex.TokenType = 358 // blanksasnull // TURELLA
	// TokenCMaxerror is "maxerror"
	TokenCMaxerror lex.TokenType = 359 // maxerror // TURELLA
	// TokenCTimeformat is "timeformat"
	TokenCTimeformat lex.TokenType = 360 // timeformat // TURELLA
	// TokenCFormatAs is "format-as"
	TokenCFormatAs lex.TokenType = 361 // format-as // TURELLA
	// TokenCFormatParquet is "parquet"
	TokenCFormatParquet lex.TokenType = 370 // parquet // TURELLA
	// TokenCFormatAvro is "avro"
	TokenCFormatAvro lex.TokenType = 371 // avro // TURELLA
	// TokenCGzip is "gzip"
	TokenCGzip lex.TokenType = 372 // gzip // TURELLA
	// TokenCFixedwidth is "fixedwidth"
	TokenCFixedwidth lex.TokenType = 373 // fixedwidth // TURELLA
	// TokenCCsv is "csv"
	TokenCCsv lex.TokenType = 374 // csv // TURELLA
	// TokenCJson is "JSON"
	TokenCJson lex.TokenType = 375 // JSON // TURELLA
	// TokenCLzop is "lzop"
	TokenCLzop lex.TokenType = 376 // lzop // TURELLA
	// TokenCReadratio is "readratio"
	TokenCReadratio lex.TokenType = 377 // readratio // TURELLA
	// TokenCEncripted is "encripted"
	TokenCEncripted lex.TokenType = 378 // encripted // TURELLA
	// TokenCRegion is "region"
	TokenCRegion lex.TokenType = 379 // region // TURELLA
	// TokenCSSH is "ssh"
	TokenCSSH lex.TokenType = 380 // ssh // TURELLA

	// RedshiftDialect is a dialect to parse the COPY FROM command
	RedshiftDialect *lex.Dialect = &lex.Dialect{
		Statements: []*lex.Clause{

			{Token: TokenCopy, Clauses: RedshiftCopy},
		},
		IdentityQuoting: lex.IdentityQuoting,
	}

	// RedshiftCopy copy statement
	RedshiftCopy = []*lex.Clause{
		{Token: TokenCopy, Lexer: lex.LexIdentifierOfType(lex.TokenTable)},
		{Token: lex.TokenLeftParenthesis, Lexer: lex.LexColumnNames, Optional: true},
		{Token: lex.TokenFrom, Lexer: lex.LexTableReferences, Clauses: sourceClauses, Name: "copyFrom.source"},

		{Token: TokenCRemovequotes, Lexer: lex.LexEmpty, Optional: true},
		{Token: TokenCEmptyasnull, Lexer: lex.LexEmpty, Optional: true},
		{Token: TokenCBlanksasnull, Lexer: lex.LexEmpty, Optional: true},
		{Token: TokenCMaxerror, Lexer: lex.LexValue, Optional: true},
		{Token: TokenCGzip, Lexer: lex.LexEmpty, Optional: true},
		{Token: TokenCEscape, Lexer: lex.LexEmpty, Optional: true},
		{Token: TokenCDelimiter, Lexer: lex.LexValue, Optional: true, Clauses: delimiterClauses},
		{Token: TokenCLzop, Lexer: lex.LexEmpty, Optional: true},
		{Token: TokenCEscape, Lexer: lex.LexEmpty, Optional: true},
		{Token: TokenCExplicitIds, Lexer: lex.LexEmpty, Optional: true},
		{Token: TokenCJson, Lexer: lex.LexValue, Optional: true},
		{Token: TokenCReadratio, Lexer: lex.LexValue, Optional: true},

		{Token: TokenCTimeformat, Lexer: lex.LexValue, Optional: true},
		{Token: TokenCFixedwidth, Lexer: lex.LexValue, Optional: true},
		{Token: TokenCCsv, Lexer: lex.LexEmpty, Optional: true},

		{Token: TokenCQuoteAs, Lexer: lex.LexEmpty, Optional: true, Clauses: quoteClauses},

		{Token: TokenCFormatAs, Lexer: lex.LexEmpty, Optional: true, Clauses: formatClauses},
		{Token: lex.TokenEofOrEos, Lexer: lex.LexEmpty},
	}
)

Functions

func NewRedshiftLexer

func NewRedshiftLexer(input string) *lex.Lexer

NewRedshiftLexer creates a new lexer for the input string using RedshiftDialect this is sql(ish) compatible parser.

func ParseCopy

func ParseCopy(sql string) (*rscopy.RsCopy, bool)

ParseCopy parses the COPY staatement, using the redshift dialect

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL