Skip to content

Commit 558ad59

Browse files
authored
Merge branch 'main' into case_improvements
2 parents da76c30 + ec3d20b commit 558ad59

File tree

130 files changed

+9369
-4292
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+9369
-4292
lines changed

.asf.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ github:
4141
- sql
4242
enabled_merge_buttons:
4343
squash: true
44+
squash_commit_message: PR_TITLE_AND_DESC
4445
merge: false
4546
rebase: false
4647
features:

.github/workflows/audit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
steps:
4343
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4444
- name: Install cargo-audit
45-
uses: taiki-e/install-action@e7ef886cf8f69c25ecef6bbc2858a42e273496ec # v2.62.28
45+
uses: taiki-e/install-action@e43a5023a747770bfcb71ae048541a681714b951 # v2.62.33
4646
with:
4747
tool: cargo-audit
4848
- name: Run audit check

.github/workflows/extended.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ on:
3636
# it is not expected to have many changes in these branches,
3737
# so running extended tests is not a burden
3838
- 'branch-*'
39+
# Also run for changes to some critical areas that are most likely
40+
# to trigger errors in extended tests
41+
pull_request:
42+
branches: [ '**' ]
43+
paths:
44+
- 'datafusion/physical*/**/*.rs'
45+
- 'datafusion/expr*/**/*.rs'
46+
- 'datafusion/optimizer/**/*.rs'
3947
workflow_dispatch:
4048
inputs:
4149
pr_number:

.github/workflows/labeler/labeler-config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ execution:
5858

5959
datasource:
6060
- changed-files:
61-
- any-glob-to-any-file: ['datafusion/datasource/**/*', 'datafusion/datasource-avro/**/*', 'datafusion/datasource-csv/**/*', 'datafusion/datasource-json/**/*', 'datafusion/datasource-parquet/**/*']
61+
- any-glob-to-any-file: ['datafusion/datasource/**/*', 'datafusion/datasource-avro/**/*', 'datafusion/datasource-arrow/**/*', 'datafusion/datasource-csv/**/*', 'datafusion/datasource-json/**/*', 'datafusion/datasource-parquet/**/*']
6262

6363
functions:
6464
- changed-files:

.github/workflows/rust.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ jobs:
412412
sudo apt-get update -qq
413413
sudo apt-get install -y -qq clang
414414
- name: Setup wasm-pack
415-
uses: taiki-e/install-action@e7ef886cf8f69c25ecef6bbc2858a42e273496ec # v2.62.28
415+
uses: taiki-e/install-action@e43a5023a747770bfcb71ae048541a681714b951 # v2.62.33
416416
with:
417417
tool: wasm-pack
418418
- name: Run tests with headless mode
@@ -739,7 +739,7 @@ jobs:
739739
- name: Setup Rust toolchain
740740
uses: ./.github/actions/setup-builder
741741
- name: Install cargo-msrv
742-
uses: taiki-e/install-action@e7ef886cf8f69c25ecef6bbc2858a42e273496ec # v2.62.28
742+
uses: taiki-e/install-action@e43a5023a747770bfcb71ae048541a681714b951 # v2.62.33
743743
with:
744744
tool: cargo-msrv
745745

Cargo.lock

Lines changed: 29 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ members = [
2222
"datafusion/catalog",
2323
"datafusion/catalog-listing",
2424
"datafusion/datasource",
25+
"datafusion/datasource-arrow",
2526
"datafusion/datasource-avro",
2627
"datafusion/datasource-csv",
2728
"datafusion/datasource-json",
@@ -116,6 +117,7 @@ datafusion-catalog-listing = { path = "datafusion/catalog-listing", version = "5
116117
datafusion-common = { path = "datafusion/common", version = "50.2.0", default-features = false }
117118
datafusion-common-runtime = { path = "datafusion/common-runtime", version = "50.2.0" }
118119
datafusion-datasource = { path = "datafusion/datasource", version = "50.2.0", default-features = false }
120+
datafusion-datasource-arrow = { path = "datafusion/datasource-arrow", version = "50.2.0", default-features = false }
119121
datafusion-datasource-avro = { path = "datafusion/datasource-avro", version = "50.2.0", default-features = false }
120122
datafusion-datasource-csv = { path = "datafusion/datasource-csv", version = "50.2.0", default-features = false }
121123
datafusion-datasource-json = { path = "datafusion/datasource-json", version = "50.2.0", default-features = false }

datafusion-cli/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async-trait = { workspace = true }
4040
aws-config = "1.8.7"
4141
aws-credential-types = "1.2.7"
4242
chrono = { workspace = true }
43-
clap = { version = "4.5.47", features = ["derive", "cargo"] }
43+
clap = { version = "4.5.47", features = ["cargo", "derive"] }
4444
datafusion = { workspace = true, features = [
4545
"avro",
4646
"compression",
@@ -55,6 +55,7 @@ datafusion = { workspace = true, features = [
5555
"sql",
5656
"unicode_expressions",
5757
] }
58+
datafusion-common = { workspace = true }
5859
dirs = "6.0.0"
5960
env_logger = { workspace = true }
6061
futures = { workspace = true }
@@ -65,7 +66,7 @@ parking_lot = { workspace = true }
6566
parquet = { workspace = true, default-features = false }
6667
regex = { workspace = true }
6768
rustyline = "17.0"
68-
tokio = { workspace = true, features = ["macros", "rt", "rt-multi-thread", "sync", "parking_lot", "signal"] }
69+
tokio = { workspace = true, features = ["macros", "parking_lot", "rt", "rt-multi-thread", "signal", "sync"] }
6970
url = { workspace = true }
7071

7172
[dev-dependencies]

datafusion-cli/src/command.rs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ impl Command {
128128
let profile_mode = mode
129129
.parse()
130130
.map_err(|_|
131-
exec_datafusion_err!("Failed to parse input: {mode}. Valid options are disabled, enabled")
131+
exec_datafusion_err!("Failed to parse input: {mode}. Valid options are disabled, summary, trace")
132132
)?;
133133
print_options
134134
.instrumented_registry
@@ -165,7 +165,7 @@ impl Command {
165165
("\\pset [NAME [VALUE]]", "set table output option\n(format)")
166166
}
167167
Self::ObjectStoreProfileMode(_) => (
168-
"\\object_store_profiling (disabled|enabled)",
168+
"\\object_store_profiling (disabled|summary|trace)",
169169
"print or set object store profile mode",
170170
),
171171
}
@@ -312,13 +312,22 @@ mod tests {
312312
InstrumentedObjectStoreMode::default()
313313
);
314314

315-
cmd = "object_store_profiling enabled"
315+
cmd = "object_store_profiling summary"
316316
.parse()
317317
.expect("expected parse to succeed");
318318
assert!(cmd.execute(&ctx, &mut print_options).await.is_ok());
319319
assert_eq!(
320320
print_options.instrumented_registry.instrument_mode(),
321-
InstrumentedObjectStoreMode::Enabled
321+
InstrumentedObjectStoreMode::Summary
322+
);
323+
324+
cmd = "object_store_profiling trace"
325+
.parse()
326+
.expect("expected parse to succeed");
327+
assert!(cmd.execute(&ctx, &mut print_options).await.is_ok());
328+
assert_eq!(
329+
print_options.instrumented_registry.instrument_mode(),
330+
InstrumentedObjectStoreMode::Trace
322331
);
323332

324333
cmd = "object_store_profiling does_not_exist"

datafusion-cli/src/helper.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ use crate::highlighter::{NoSyntaxHighlighter, SyntaxHighlighter};
2424

2525
use datafusion::sql::parser::{DFParser, Statement};
2626
use datafusion::sql::sqlparser::dialect::dialect_from_str;
27+
use datafusion_common::config::Dialect;
2728

2829
use rustyline::completion::{Completer, FilenameCompleter, Pair};
2930
use rustyline::error::ReadlineError;
@@ -34,33 +35,33 @@ use rustyline::{Context, Helper, Result};
3435

3536
pub struct CliHelper {
3637
completer: FilenameCompleter,
37-
dialect: String,
38+
dialect: Dialect,
3839
highlighter: Box<dyn Highlighter>,
3940
}
4041

4142
impl CliHelper {
42-
pub fn new(dialect: &str, color: bool) -> Self {
43+
pub fn new(dialect: &Dialect, color: bool) -> Self {
4344
let highlighter: Box<dyn Highlighter> = if !color {
4445
Box::new(NoSyntaxHighlighter {})
4546
} else {
4647
Box::new(SyntaxHighlighter::new(dialect))
4748
};
4849
Self {
4950
completer: FilenameCompleter::new(),
50-
dialect: dialect.into(),
51+
dialect: *dialect,
5152
highlighter,
5253
}
5354
}
5455

55-
pub fn set_dialect(&mut self, dialect: &str) {
56-
if dialect != self.dialect {
57-
self.dialect = dialect.to_string();
56+
pub fn set_dialect(&mut self, dialect: &Dialect) {
57+
if *dialect != self.dialect {
58+
self.dialect = *dialect;
5859
}
5960
}
6061

6162
fn validate_input(&self, input: &str) -> Result<ValidationResult> {
6263
if let Some(sql) = input.strip_suffix(';') {
63-
let dialect = match dialect_from_str(&self.dialect) {
64+
let dialect = match dialect_from_str(self.dialect) {
6465
Some(dialect) => dialect,
6566
None => {
6667
return Ok(ValidationResult::Invalid(Some(format!(
@@ -97,7 +98,7 @@ impl CliHelper {
9798

9899
impl Default for CliHelper {
99100
fn default() -> Self {
100-
Self::new("generic", false)
101+
Self::new(&Dialect::Generic, false)
101102
}
102103
}
103104

@@ -289,7 +290,7 @@ mod tests {
289290
);
290291

291292
// valid in postgresql dialect
292-
validator.set_dialect("postgresql");
293+
validator.set_dialect(&Dialect::PostgreSQL);
293294
let result =
294295
readline_direct(Cursor::new(r"select 1 # 2;".as_bytes()), &validator)?;
295296
assert!(matches!(result, ValidationResult::Valid(None)));

0 commit comments

Comments
 (0)