Adding upstream version 16.2.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
577b79f5a7
commit
d61627452f
106 changed files with 41940 additions and 40162 deletions
|
@ -210,27 +210,19 @@
|
|||
</span></pre></div>
|
||||
|
||||
|
||||
<div class="docstring"><p>Parser consumes a list of tokens produced by the <code><a href="../tokens.html#Tokenizer">sqlglot.tokens.Tokenizer</a></code> and produces
|
||||
a parsed syntax tree.</p>
|
||||
<div class="docstring"><p>Parser consumes a list of tokens produced by the Tokenizer and produces a parsed syntax tree.</p>
|
||||
|
||||
<h6 id="arguments">Arguments:</h6>
|
||||
|
||||
<ul>
|
||||
<li><strong>error_level:</strong> the desired error level.
|
||||
<li><strong>error_level:</strong> The desired error level.
|
||||
Default: ErrorLevel.IMMEDIATE</li>
|
||||
<li><strong>error_message_context:</strong> determines the amount of context to capture from a
|
||||
<li><strong>error_message_context:</strong> Determines the amount of context to capture from a
|
||||
query string when displaying the error message (in number of characters).
|
||||
Default: 50.</li>
|
||||
<li><strong>index_offset:</strong> Index offset for arrays eg ARRAY[0] vs ARRAY[1] as the head of a list.
|
||||
Default: 0</li>
|
||||
<li><strong>alias_post_tablesample:</strong> If the table alias comes after tablesample.
|
||||
Default: False</li>
|
||||
Default: 100</li>
|
||||
<li><strong>max_errors:</strong> Maximum number of error messages to include in a raised ParseError.
|
||||
This is only relevant if error_level is ErrorLevel.RAISE.
|
||||
Default: 3</li>
|
||||
<li><strong>null_ordering:</strong> Indicates the default null ordering method to use if not explicitly set.
|
||||
Options are "nulls_are_small", "nulls_are_large", "nulls_are_last".
|
||||
Default: "nulls_are_small"</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
@ -279,49 +271,34 @@ Default: "nulls_are_small"</li>
|
|||
</span></pre></div>
|
||||
|
||||
|
||||
<div class="docstring"><p>Generator interprets the given syntax tree and produces a SQL string as an output.</p>
|
||||
<div class="docstring"><p>Generator converts a given syntax tree to the corresponding SQL string.</p>
|
||||
|
||||
<h6 id="arguments">Arguments:</h6>
|
||||
|
||||
<ul>
|
||||
<li><strong>time_mapping (dict):</strong> the dictionary of custom time mappings in which the key
|
||||
represents a python time format and the output the target time format</li>
|
||||
<li><strong>time_trie (trie):</strong> a trie of the time_mapping keys</li>
|
||||
<li><strong>pretty (bool):</strong> if set to True the returned string will be formatted. Default: False.</li>
|
||||
<li><strong>quote_start (str):</strong> specifies which starting character to use to delimit quotes. Default: '.</li>
|
||||
<li><strong>quote_end (str):</strong> specifies which ending character to use to delimit quotes. Default: '.</li>
|
||||
<li><strong>identifier_start (str):</strong> specifies which starting character to use to delimit identifiers. Default: ".</li>
|
||||
<li><strong>identifier_end (str):</strong> specifies which ending character to use to delimit identifiers. Default: ".</li>
|
||||
<li><strong>bit_start (str):</strong> specifies which starting character to use to delimit bit literals. Default: None.</li>
|
||||
<li><strong>bit_end (str):</strong> specifies which ending character to use to delimit bit literals. Default: None.</li>
|
||||
<li><strong>hex_start (str):</strong> specifies which starting character to use to delimit hex literals. Default: None.</li>
|
||||
<li><strong>hex_end (str):</strong> specifies which ending character to use to delimit hex literals. Default: None.</li>
|
||||
<li><strong>byte_start (str):</strong> specifies which starting character to use to delimit byte literals. Default: None.</li>
|
||||
<li><strong>byte_end (str):</strong> specifies which ending character to use to delimit byte literals. Default: None.</li>
|
||||
<li><strong>raw_start (str):</strong> specifies which starting character to use to delimit raw literals. Default: None.</li>
|
||||
<li><strong>raw_end (str):</strong> specifies which ending character to use to delimit raw literals. Default: None.</li>
|
||||
<li><strong>identify (bool | str):</strong> 'always': always quote, 'safe': quote identifiers if they don't contain an upcase, True defaults to always.</li>
|
||||
<li><strong>normalize (bool):</strong> if set to True all identifiers will lower cased</li>
|
||||
<li><strong>string_escape (str):</strong> specifies a string escape character. Default: '.</li>
|
||||
<li><strong>identifier_escape (str):</strong> specifies an identifier escape character. Default: ".</li>
|
||||
<li><strong>pad (int):</strong> determines padding in a formatted string. Default: 2.</li>
|
||||
<li><strong>indent (int):</strong> determines the size of indentation in a formatted string. Default: 4.</li>
|
||||
<li><strong>unnest_column_only (bool):</strong> if true unnest table aliases are considered only as column aliases</li>
|
||||
<li><strong>normalize_functions (str):</strong> normalize function names, "upper", "lower", or None
|
||||
Default: "upper"</li>
|
||||
<li><strong>alias_post_tablesample (bool):</strong> if the table alias comes after tablesample
|
||||
Default: False</li>
|
||||
<li><strong>identifiers_can_start_with_digit (bool):</strong> if an unquoted identifier can start with digit
|
||||
Default: False</li>
|
||||
<li><strong>unsupported_level (ErrorLevel):</strong> determines the generator's behavior when it encounters
|
||||
unsupported expressions. Default ErrorLevel.WARN.</li>
|
||||
<li><strong>null_ordering (str):</strong> Indicates the default null ordering method to use if not explicitly set.
|
||||
Options are "nulls_are_small", "nulls_are_large", "nulls_are_last".
|
||||
Default: "nulls_are_small"</li>
|
||||
<li><strong>max_unsupported (int):</strong> Maximum number of unsupported messages to include in a raised UnsupportedError.
|
||||
<li><strong>pretty:</strong> Whether or not to format the produced SQL string.
|
||||
Default: False.</li>
|
||||
<li><strong>identify:</strong> Determines when an identifier should be quoted. Possible values are:
|
||||
False (default): Never quote, except in cases where it's mandatory by the dialect.
|
||||
True or 'always': Always quote.
|
||||
'safe': Only quote identifiers that are case insensitive.</li>
|
||||
<li><strong>normalize:</strong> Whether or not to normalize identifiers to lowercase.
|
||||
Default: False.</li>
|
||||
<li><strong>pad:</strong> Determines the pad size in a formatted string.
|
||||
Default: 2.</li>
|
||||
<li><strong>indent:</strong> Determines the indentation size in a formatted string.
|
||||
Default: 2.</li>
|
||||
<li><strong>normalize_functions:</strong> Whether or not to normalize all function names. Possible values are:
|
||||
"upper" or True (default): Convert names to uppercase.
|
||||
"lower": Convert names to lowercase.
|
||||
False: Disables function name normalization.</li>
|
||||
<li><strong>unsupported_level:</strong> Determines the generator's behavior when it encounters unsupported expressions.
|
||||
Default ErrorLevel.WARN.</li>
|
||||
<li><strong>max_unsupported:</strong> Maximum number of unsupported messages to include in a raised UnsupportedError.
|
||||
This is only relevant if unsupported_level is ErrorLevel.RAISE.
|
||||
Default: 3</li>
|
||||
<li><strong>leading_comma (bool):</strong> if the the comma is leading or trailing in select statements
|
||||
<li><strong>leading_comma:</strong> Determines whether or not the comma is leading or trailing in select expressions.
|
||||
This is only relevant when generating in pretty mode.
|
||||
Default: False</li>
|
||||
<li><strong>max_text_width:</strong> The max number of characters in a segment before creating new lines in pretty mode.
|
||||
The default is on the smaller end because the length only represents a segment and not the true
|
||||
|
@ -387,6 +364,7 @@ Default: True</li>
|
|||
<dd id="Spark.Generator.notnullcolumnconstraint_sql" class="function"><a href="../generator.html#Generator.notnullcolumnconstraint_sql">notnullcolumnconstraint_sql</a></dd>
|
||||
<dd id="Spark.Generator.primarykeycolumnconstraint_sql" class="function"><a href="../generator.html#Generator.primarykeycolumnconstraint_sql">primarykeycolumnconstraint_sql</a></dd>
|
||||
<dd id="Spark.Generator.uniquecolumnconstraint_sql" class="function"><a href="../generator.html#Generator.uniquecolumnconstraint_sql">uniquecolumnconstraint_sql</a></dd>
|
||||
<dd id="Spark.Generator.createable_sql" class="function"><a href="../generator.html#Generator.createable_sql">createable_sql</a></dd>
|
||||
<dd id="Spark.Generator.create_sql" class="function"><a href="../generator.html#Generator.create_sql">create_sql</a></dd>
|
||||
<dd id="Spark.Generator.clone_sql" class="function"><a href="../generator.html#Generator.clone_sql">clone_sql</a></dd>
|
||||
<dd id="Spark.Generator.describe_sql" class="function"><a href="../generator.html#Generator.describe_sql">describe_sql</a></dd>
|
||||
|
@ -467,9 +445,11 @@ Default: True</li>
|
|||
<dd id="Spark.Generator.ordered_sql" class="function"><a href="../generator.html#Generator.ordered_sql">ordered_sql</a></dd>
|
||||
<dd id="Spark.Generator.matchrecognize_sql" class="function"><a href="../generator.html#Generator.matchrecognize_sql">matchrecognize_sql</a></dd>
|
||||
<dd id="Spark.Generator.query_modifiers" class="function"><a href="../generator.html#Generator.query_modifiers">query_modifiers</a></dd>
|
||||
<dd id="Spark.Generator.offset_limit_modifiers" class="function"><a href="../generator.html#Generator.offset_limit_modifiers">offset_limit_modifiers</a></dd>
|
||||
<dd id="Spark.Generator.after_limit_modifiers" class="function"><a href="../generator.html#Generator.after_limit_modifiers">after_limit_modifiers</a></dd>
|
||||
<dd id="Spark.Generator.select_sql" class="function"><a href="../generator.html#Generator.select_sql">select_sql</a></dd>
|
||||
<dd id="Spark.Generator.schema_sql" class="function"><a href="../generator.html#Generator.schema_sql">schema_sql</a></dd>
|
||||
<dd id="Spark.Generator.schema_columns_sql" class="function"><a href="../generator.html#Generator.schema_columns_sql">schema_columns_sql</a></dd>
|
||||
<dd id="Spark.Generator.star_sql" class="function"><a href="../generator.html#Generator.star_sql">star_sql</a></dd>
|
||||
<dd id="Spark.Generator.parameter_sql" class="function"><a href="../generator.html#Generator.parameter_sql">parameter_sql</a></dd>
|
||||
<dd id="Spark.Generator.sessionparameter_sql" class="function"><a href="../generator.html#Generator.sessionparameter_sql">sessionparameter_sql</a></dd>
|
||||
|
@ -494,7 +474,7 @@ Default: True</li>
|
|||
<dd id="Spark.Generator.nextvaluefor_sql" class="function"><a href="../generator.html#Generator.nextvaluefor_sql">nextvaluefor_sql</a></dd>
|
||||
<dd id="Spark.Generator.extract_sql" class="function"><a href="../generator.html#Generator.extract_sql">extract_sql</a></dd>
|
||||
<dd id="Spark.Generator.trim_sql" class="function"><a href="../generator.html#Generator.trim_sql">trim_sql</a></dd>
|
||||
<dd id="Spark.Generator.concat_sql" class="function"><a href="../generator.html#Generator.concat_sql">concat_sql</a></dd>
|
||||
<dd id="Spark.Generator.safeconcat_sql" class="function"><a href="../generator.html#Generator.safeconcat_sql">safeconcat_sql</a></dd>
|
||||
<dd id="Spark.Generator.check_sql" class="function"><a href="../generator.html#Generator.check_sql">check_sql</a></dd>
|
||||
<dd id="Spark.Generator.foreignkey_sql" class="function"><a href="../generator.html#Generator.foreignkey_sql">foreignkey_sql</a></dd>
|
||||
<dd id="Spark.Generator.primarykey_sql" class="function"><a href="../generator.html#Generator.primarykey_sql">primarykey_sql</a></dd>
|
||||
|
@ -544,6 +524,7 @@ Default: True</li>
|
|||
<dd id="Spark.Generator.respectnulls_sql" class="function"><a href="../generator.html#Generator.respectnulls_sql">respectnulls_sql</a></dd>
|
||||
<dd id="Spark.Generator.intdiv_sql" class="function"><a href="../generator.html#Generator.intdiv_sql">intdiv_sql</a></dd>
|
||||
<dd id="Spark.Generator.dpipe_sql" class="function"><a href="../generator.html#Generator.dpipe_sql">dpipe_sql</a></dd>
|
||||
<dd id="Spark.Generator.safedpipe_sql" class="function"><a href="../generator.html#Generator.safedpipe_sql">safedpipe_sql</a></dd>
|
||||
<dd id="Spark.Generator.div_sql" class="function"><a href="../generator.html#Generator.div_sql">div_sql</a></dd>
|
||||
<dd id="Spark.Generator.overlaps_sql" class="function"><a href="../generator.html#Generator.overlaps_sql">overlaps_sql</a></dd>
|
||||
<dd id="Spark.Generator.distance_sql" class="function"><a href="../generator.html#Generator.distance_sql">distance_sql</a></dd>
|
||||
|
@ -592,6 +573,7 @@ Default: True</li>
|
|||
<dd id="Spark.Generator.dictproperty_sql" class="function"><a href="../generator.html#Generator.dictproperty_sql">dictproperty_sql</a></dd>
|
||||
<dd id="Spark.Generator.dictrange_sql" class="function"><a href="../generator.html#Generator.dictrange_sql">dictrange_sql</a></dd>
|
||||
<dd id="Spark.Generator.dictsubproperty_sql" class="function"><a href="../generator.html#Generator.dictsubproperty_sql">dictsubproperty_sql</a></dd>
|
||||
<dd id="Spark.Generator.oncluster_sql" class="function"><a href="../generator.html#Generator.oncluster_sql">oncluster_sql</a></dd>
|
||||
|
||||
</div>
|
||||
<div><dt><a href="spark2.html#Spark2.Generator">sqlglot.dialects.spark2.Spark2.Generator</a></dt>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue