MCPcopy Create free account
hub / github.com/apache/datafusion / register_aggregate_csv_by_sql

Function register_aggregate_csv_by_sql

datafusion/core/tests/sql/mod.rs:75–111  ·  view source on GitHub ↗
(ctx: &SessionContext)

Source from the content-addressed store, hash-verified

73mod unparser;
74
75async fn register_aggregate_csv_by_sql(ctx: &SessionContext) {
76 let testdata = test_util::arrow_test_data();
77
78 let df = ctx
79 .sql(&format!(
80 "
81 CREATE EXTERNAL TABLE aggregate_test_100 (
82 c1 VARCHAR NOT NULL,
83 c2 TINYINT NOT NULL,
84 c3 SMALLINT NOT NULL,
85 c4 SMALLINT NOT NULL,
86 c5 INTEGER NOT NULL,
87 c6 BIGINT NOT NULL,
88 c7 SMALLINT NOT NULL,
89 c8 INT NOT NULL,
90 c9 INT UNSIGNED NOT NULL,
91 c10 BIGINT UNSIGNED NOT NULL,
92 c11 FLOAT NOT NULL,
93 c12 DOUBLE NOT NULL,
94 c13 VARCHAR NOT NULL
95 )
96 STORED AS CSV
97 LOCATION '{testdata}/csv/aggregate_test_100.csv'
98 OPTIONS ('format.has_header' 'true')
99 "
100 ))
101 .await
102 .expect("Creating dataframe for CREATE EXTERNAL TABLE");
103
104 // Mimic the CLI and execute the resulting plan -- even though it
105 // is effectively a no-op (returns zero rows)
106 let results = df.collect().await.expect("Executing CREATE EXTERNAL TABLE");
107 assert!(
108 results.is_empty(),
109 "Expected no rows from executing CREATE EXTERNAL TABLE"
110 );
111}
112
113async fn register_aggregate_csv(ctx: &SessionContext) -> Result<()> {
114 let testdata = test_util::arrow_test_data();

Callers 9

csv_explain_plansFunction · 0.85
csv_explain_verboseFunction · 0.85
csv_explain_analyzeFunction · 0.85

Calls 3

arrow_test_dataFunction · 0.85
sqlMethod · 0.80
collectMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…