Skip to content

fix(CLI): can not create external tables with format options#10739

Merged
alamb merged 1 commit intoapache:mainfrom
jonahgao:fix_external
May 31, 2024
Merged

fix(CLI): can not create external tables with format options#10739
alamb merged 1 commit intoapache:mainfrom
jonahgao:fix_external

Conversation

@jonahgao
Copy link
Copy Markdown
Member

@jonahgao jonahgao commented May 31, 2024

Which issue does this PR close?

Closes #10737.

Rationale for this change

When setting format options for TableOptions,

table_options.alter_with_string_hash_map(options)?;

the current_format of TableOptions must already exist, which means set_file_format must be called with a non-none file type first.

let Some(format) = &self.current_format else {
return _config_err!("Specify a format for TableOptions");
};

What changes are included in this PR?

Are these changes tested?

Yes

Are there any user-facing changes?

No

@berkaysynnada
Copy link
Copy Markdown
Contributor

Good catch 👍🏻 This explicit setup may not be very user-friendly, but it's necessary since we accept file formats directly from CreateExternalTable rather than from OPTIONS.

Copy link
Copy Markdown
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm thanks @jonahgao
💪

Copy link
Copy Markdown
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @jonahgao 🙏

@alamb alamb merged commit 7fd286b into apache:main May 31, 2024
@jonahgao jonahgao deleted the fix_external branch June 1, 2024 02:49
@jonahgao
Copy link
Copy Markdown
Member Author

jonahgao commented Jun 1, 2024

Thanks for the review @berkaysynnada @comphead @alamb

findepi pushed a commit to findepi/datafusion that referenced this pull request Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI cannot create external tables with format options

4 participants