sqlfluff / sqlfluff

@@ -195,6 +195,7 @@
Loading
195 195
DATA
196 196
DATABASE
197 197
DATABASES
198 +
DATA_FORMAT
198 199
DATA_RETENTION_TIME_IN_DAYS
199 200
DATE
200 201
DATE_FORMAT
@@ -390,6 +391,7 @@
Loading
390 391
PASSWORD
391 392
PAST
392 393
PATTERN
394 +
FIELD_OPTIONALITY_ENCLOSED_BY
393 395
PER
394 396
PERMUTE
395 397
PIPE

@@ -4073,6 +4073,12 @@
Loading
4073 4073
4074 4074
    https://docs.snowflake.com/en/sql-reference/sql/copy-into-table.html#format-type-options
4075 4075
    https://docs.snowflake.com/en/sql-reference/sql/copy-into-location.html#format-type-options
4076 +
4077 +
    This part specifically works for the format:
4078 +
        `FILE_FORMAT = (FORMAT_NAME = myformatname)`
4079 +
    Another case:
4080 +
        `FILE_FORMAT = (TYPE = mytype)` their fileFormatOptions are implemented in
4081 +
    their specific `FormatTypeParameters`
4076 4082
    """
4077 4083
4078 4084
    type = "format_type_options"
@@ -4105,6 +4111,44 @@
Loading
4105 4111
                Ref("EqualsSegment"),
4106 4112
                OneOf("NONE", Ref("QuotedLiteralSegment")),
4107 4113
            ),
4114 +
            Sequence(
4115 +
                "DATA_FORMAT",
4116 +
                Ref("EqualsSegment"),
4117 +
                OneOf("AUTO", Ref("QuotedLiteralSegment")),
4118 +
            ),
4119 +
            Sequence(
4120 +
                "TIME_FORMAT",
4121 +
                Ref("EqualsSegment"),
4122 +
                OneOf("NONE", Ref("QuotedLiteralSegment")),
4123 +
            ),
4124 +
            Sequence(
4125 +
                "TIMESTAMP_FORMAT",
4126 +
                Ref("EqualsSegment"),
4127 +
                OneOf("NONE", Ref("QuotedLiteralSegment")),
4128 +
            ),
4129 +
            Sequence(
4130 +
                "BINARY_FORMAT", Ref("EqualsSegment"), OneOf("HEX", "BASE64", "UTF8")
4131 +
            ),
4132 +
            Sequence(
4133 +
                "FIELD_OPTIONALITY_ENCLOSED_BY",
4134 +
                Ref("EqualsSegment"),
4135 +
                OneOf("NONE", Ref("QuotedLiteralSegment")),
4136 +
            ),
4137 +
            Sequence(
4138 +
                "NULL_IF",
4139 +
                Ref("EqualsSegment"),
4140 +
                Bracketed(Delimited(Ref("QuotedLiteralSegment"))),
4141 +
            ),
4142 +
            Sequence(
4143 +
                "EMPTY_FIELD_AS_NULL",
4144 +
                Ref("EqualsSegment"),
4145 +
                Ref("BooleanLiteralGrammar"),
4146 +
            ),
4147 +
            Sequence(
4148 +
                "SNAPPY_COMPRESSION",
4149 +
                Ref("EqualsSegment"),
4150 +
                Ref("BooleanLiteralGrammar"),
4151 +
            ),
4108 4152
        ),
4109 4153
        # COPY INTO <table>, open for extension
4110 4154
        AnySetOf(),
@@ -4232,6 +4276,21 @@
Loading
4232 4276
    )
4233 4277
4234 4278
4279 +
class PartitionBySegment(BaseSegment):
4280 +
    """A `PARTITION BY` for `copy_into_location` functions."""
4281 +
4282 +
    type = "partition_by_segment"
4283 +
4284 +
    match_grammar: Matchable = Sequence(
4285 +
        "PARTITION",
4286 +
        "BY",
4287 +
        Indent,
4288 +
        # Brackets are optional in a partition by statement
4289 +
        OptionallyBracketed(Delimited(Ref("ExpressionSegment"))),
4290 +
        Dedent,
4291 +
    )
4292 +
4293 +
4235 4294
class CopyIntoLocationStatementSegment(BaseSegment):
4236 4295
    """A Snowflake `COPY INTO <location>` statement.
4237 4296
@@ -4253,28 +4312,30 @@
Loading
4253 4312
            ),
4254 4313
            optional=True,
4255 4314
        ),
4256 -
        Ref("S3ExternalStageParameters", optional=True),
4315 +
        OneOf(
4316 +
            Ref("S3ExternalStageParameters"),
4317 +
            Ref("AzureBlobStorageExternalStageParameters"),
4318 +
            optional=True,
4319 +
        ),
4257 4320
        Ref("InternalStageParameters", optional=True),
4258 4321
        AnySetOf(
4259 -
            Ref("PartitionClauseSegment"),
4322 +
            Ref("PartitionBySegment"),
4260 4323
            Sequence(
4261 4324
                "FILE_FORMAT",
4262 4325
                Ref("EqualsSegment"),
4263 4326
                Ref("FileFormatSegment"),
4264 4327
            ),
4265 4328
            Ref("CopyOptionsSegment"),
4266 -
        ),
4267 -
        Sequence(
4268 -
            "VALIDATION_MODE",
4269 -
            Ref("EqualsSegment"),
4270 -
            Ref("ValidationModeOptionSegment"),
4271 -
            optional=True,
4272 -
        ),
4273 -
        Sequence(
4274 -
            "HEADER",
4275 -
            Ref("EqualsSegment"),
4276 -
            Ref("BooleanLiteralGrammar"),
4277 -
            optional=True,
4329 +
            Sequence(
4330 +
                "VALIDATION_MODE",
4331 +
                Ref("EqualsSegment"),
4332 +
                Ref("ValidationModeOptionSegment"),
4333 +
            ),
4334 +
            Sequence(
4335 +
                "HEADER",
4336 +
                Ref("EqualsSegment"),
4337 +
                Ref("BooleanLiteralGrammar"),
4338 +
            ),
4278 4339
        ),
4279 4340
    )
4280 4341
@@ -4300,7 +4361,11 @@
Loading
4300 4361
            ),
4301 4362
            optional=True,
4302 4363
        ),
4303 -
        Ref("S3ExternalStageParameters", optional=True),
4364 +
        OneOf(
4365 +
            Ref("S3ExternalStageParameters"),
4366 +
            Ref("AzureBlobStorageExternalStageParameters"),
4367 +
            optional=True,
4368 +
        ),
4304 4369
        Ref("InternalStageParameters", optional=True),
4305 4370
        AnySetOf(
4306 4371
            Sequence(
Files Coverage
src/sqlfluff 100.00%
Project Totals (195 files) 100.00%

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading