Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions crates/core-executor/src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use core_metastore::{
TableFormat as MetastoreTableFormat, TableIdent as MetastoreTableIdent, Volume, VolumeType,
models::volumes::create_object_store_from_url,
};
use datafusion::arrow::array::{Int64Array, RecordBatch};
use datafusion::arrow::array::{Int64Array, RecordBatch, StringArray};
use datafusion::arrow::datatypes::{DataType, Field, Schema as ArrowSchema, SchemaRef};
use datafusion::arrow::datatypes::{Fields, SchemaBuilder};
use datafusion::catalog::{CatalogProvider, SchemaProvider};
Expand Down Expand Up @@ -2754,7 +2754,15 @@ impl UserQuery {
false,
)]));
Ok(QueryResult::new(
vec![RecordBatch::new_empty(schema.clone())],
vec![
RecordBatch::try_new(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I actually think that this should not be fixed query executor modifying QueryResult. This "Statement executed ..." message that was added looks like belongs to a rest api. It naturally belongs to the snowflake-rest.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also I believe that such change should be covered by a separate test in snowlake-rest as well

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We should probably do that later, I agree

schema.clone(),
vec![Arc::new(StringArray::from(vec![
"Statement executed successfully.",
]))],
)
.context(ex_error::ArrowSnafu)?,
],
schema,
self.query_context.query_id,
))
Expand Down
1 change: 1 addition & 0 deletions crates/core-executor/src/tests/sql/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ mod like_any;
mod pivot;
mod rlike_regexp;
mod show;
mod status_message;
mod top;
mod unpivot;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
source: crates/core-executor/src/tests/sql/commands/status_message.rs
description: "\"SET test = 2\""
---
Ok(
[
"+----------------------------------+",
"| status |",
"+----------------------------------+",
"| Statement executed successfully. |",
"+----------------------------------+",
],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
source: crates/core-executor/src/tests/sql/commands/status_message.rs
description: "\"USE DATABASE embucket\""
---
Ok(
[
"+----------------------------------+",
"| status |",
"+----------------------------------+",
"| Statement executed successfully. |",
"+----------------------------------+",
],
)
13 changes: 13 additions & 0 deletions crates/core-executor/src/tests/sql/commands/status_message.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
use crate::test_query;

test_query!(
status_message_use,
"USE DATABASE embucket",
snapshot_path = "status_message"
);

test_query!(
status_message_set,
"SET test = 2",
snapshot_path = "status_message"
);
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ info: "Setup queries: DROP SCHEMA embucket.public"
---
Ok(
[
"+--------+",
"| status |",
"+--------+",
"+--------+",
"+----------------------------------+",
"| status |",
"+----------------------------------+",
"| Statement executed successfully. |",
"+----------------------------------+",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ info: "Setup queries: CREATE TABLE embucket.public.test (id INT) as VALUES (1),
---
Ok(
[
"+--------+",
"| status |",
"+--------+",
"+--------+",
"+----------------------------------+",
"| status |",
"+----------------------------------+",
"| Statement executed successfully. |",
"+----------------------------------+",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ info: "Setup queries: CREATE TABLE embucket.public.test (id INT) as VALUES (1),
---
Ok(
[
"+--------+",
"| status |",
"+--------+",
"+--------+",
"+----------------------------------+",
"| status |",
"+----------------------------------+",
"| Statement executed successfully. |",
"+----------------------------------+",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ description: "\"ALTER TABLE IF EXISTS embucket.public.missing_table add column c
---
Ok(
[
"+--------+",
"| status |",
"+--------+",
"+--------+",
"+----------------------------------+",
"| status |",
"+----------------------------------+",
"| Statement executed successfully. |",
"+----------------------------------+",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ info: "Setup queries: CREATE SCHEMA embucket.test; CREATE TABLE embucket.test.so
---
Ok(
[
"+--------+",
"| status |",
"+--------+",
"+--------+",
"+----------------------------------+",
"| status |",
"+----------------------------------+",
"| Statement executed successfully. |",
"+----------------------------------+",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ info: "Setup queries: CREATE SCHEMA embucket.test; CREATE TABLE embucket.test.so
---
Ok(
[
"+--------+",
"| status |",
"+--------+",
"+--------+",
"+----------------------------------+",
"| status |",
"+----------------------------------+",
"| Statement executed successfully. |",
"+----------------------------------+",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ description: "\"DROP TABLE IF EXISTS embucket.public.missing\""
---
Ok(
[
"+--------+",
"| status |",
"+--------+",
"+--------+",
"+----------------------------------+",
"| status |",
"+----------------------------------+",
"| Statement executed successfully. |",
"+----------------------------------+",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ info: "Setup queries: CREATE SCHEMA embucket.public_snowplow_manifest; CREATE TA
---
Ok(
[
"+--------+",
"| status |",
"+--------+",
"+--------+",
"+----------------------------------+",
"| status |",
"+----------------------------------+",
"| Statement executed successfully. |",
"+----------------------------------+",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ info: "Setup queries: CREATE SCHEMA embucket.test; CREATE TABLE embucket.test.so
---
Ok(
[
"+--------+",
"| status |",
"+--------+",
"+--------+",
"+----------------------------------+",
"| status |",
"+----------------------------------+",
"| Statement executed successfully. |",
"+----------------------------------+",
],
)
Loading