-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: read_text table function #2924
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine as is but I have a few questions.
columns.sort_by(|a, b| a.0.cmp(&b.0)); | ||
|
||
let batch = RecordBatch::try_new( | ||
schema.clone(), | ||
columns.into_iter().map(|(_, v)| v).collect(), | ||
)?; | ||
|
||
let stream = once(async move { Ok(batch) }).boxed(); | ||
Ok(stream) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let me see if I understand this:
so this is all running (already) inside of an async function/task, and we start another task to convert something into a stream, which produces a record batch that has exactly one row in it?
(I think also that we can call .flatten()
to avoid the extra function here; and also the sort is cheap in this case but probably can be enforced procedurally in the code)
select filename from read_text('gs://${GCS_BUCKET_NAME}/multi_csv/**/*', gcp_creds); | ||
---- | ||
multi_csv/bikeshare_stations.csv | ||
multi_csv/bikeshare_stations_2.csv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a way to assert in an SLT that the value that we expect to have data/content isn't empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah we are testing that in testdata/sqllogictests/functions/read_text.slt
query I
select content from read_text('./testdata/blob/hello.txt');
----
hello world
No description provided.