Skip to content

[DISCUSSION] Should `CREATE EXTERNAL TABLE's create a new file if it doesn't exist? #15944

@berkaysynnada

Description

@berkaysynnada

CREATE EXTERNAL TABLE t STORED AS CSV LOCATION '~/files/foo.csv'; gives an error if the given file does not exist. When we are trying to create a new file and then insert some values into it, we are forced to create the file externally.

I wonder how it sounds if create external table's create the file indeed if it doesn't exist. If it seems like a useful behavior, then there will be a few more questions like

  • at what instance exactly the file is generated (during table provider generation, or during scan, or during the next select or insert into query?)
  • how are the stores other than local file system treated?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions