Skip to content
Closed
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
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,6 @@ polyglot-sql = { git = "https://github.com/sqlstack-io/polyglot.git", rev = "876
"semantic",
"stacker",
] }
polyglot-sql-function-catalogs = { git = "https://github.com/sqlstack-io/polyglot.git", rev = "8767d688c5b504ad609645e27ab77a260d91c5a1", default-features = false, features = [
"dialect-duckdb",
] }
blake3 = { version = "1", features = ["rayon"] }
# Only sqlbuild-build-features uses these: each enables in the sqb build exactly the features the
# extension build resolves for that crate, so both builds share one compile of every common crate.
Expand Down
1 change: 0 additions & 1 deletion crates/sqlbuild-analysis/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ rust-version.workspace = true
[dependencies]
memchr.workspace = true
polyglot-sql.workspace = true
polyglot-sql-function-catalogs.workspace = true
rayon.workspace = true
regex.workspace = true
rustc-hash.workspace = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -550,12 +550,8 @@ fn analyze_compact_query_work(
if let (Some(sql), Ok(dialect)) = (diagnostic_sql, dialect)
&& let Some(validation) = result.validation.take()
{
let local_probes = crate::semantic_validation::models::FunctionProbes::default();
let probes = catalog.map_or(&local_probes, |catalog| catalog.function_probes.as_ref());
result.validation = Some(validation.and_then(|value| {
crate::semantic_validation::main::map_diagnostics::map_diagnostics(
&sql, dialect, value, probes,
)
crate::semantic_validation::main::map_diagnostics::map_diagnostics(&sql, dialect, value)
}));
}
result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::{Arc, Mutex, PoisonError};

use crate::semantic_validation::models::{
CatalogInput, Columns, CompactAnalysisJob, DiagnosticRow, FunctionProbes, ProjectCatalog,
CatalogInput, Columns, CompactAnalysisJob, DiagnosticRow, ProjectCatalog,
};
use crate::semantic_validation::types::{
BindingRequest, NormalizationRequest, PreparedCompactAnalysis, Relations,
Expand Down Expand Up @@ -160,7 +160,6 @@ impl ProjectCatalog {
tables: HashMap::new(),
overrides: Vec::new(),
analysis_tables: HashMap::new(),
function_probes: Arc::new(FunctionProbes::default()),
analysis_pool: Arc::default(),
running_analyses: Arc::default(),
};
Expand All @@ -176,15 +175,9 @@ impl ProjectCatalog {

pub fn with_relations(&self, relations: Relations) -> Self {
let mut catalog = Self {
dialect: self.dialect,
options: self.options.clone(),
quoted_ignore_case: self.quoted_ignore_case,
tables: self.tables.clone(),
overrides: Vec::new(),
analysis_tables: self.analysis_tables.clone(),
function_probes: Arc::new(FunctionProbes::default()),
analysis_pool: Arc::clone(&self.analysis_pool),
running_analyses: Arc::clone(&self.running_analyses),
..self.analysis_view()
};
catalog.update_relations(relations);
catalog
Expand Down Expand Up @@ -285,12 +278,7 @@ impl ProjectCatalog {
.map(|(sql, references, overrides)| {
let schema = self.schema(&references, overrides)?;
let result = self.validate(&sql, &schema)?;
let result = diagnostics::map_diagnostics(
&sql,
self.dialect,
result,
&self.function_probes,
)?;
let result = diagnostics::map_diagnostics(&sql, self.dialect, result)?;
Ok(result.errors.into_iter().map(diagnostic_row).collect())
})
.collect::<Result<Vec<_>, String>>()
Expand Down Expand Up @@ -356,7 +344,6 @@ impl ProjectCatalog {
tables: HashMap::new(),
overrides: Vec::new(),
analysis_tables: HashMap::new(),
function_probes: Arc::clone(&self.function_probes),
analysis_pool: Arc::clone(&self.analysis_pool),
running_analyses: Arc::clone(&self.running_analyses),
}
Expand Down Expand Up @@ -388,7 +375,6 @@ impl ProjectCatalog {
tables: HashMap::new(),
overrides: Vec::new(),
analysis_tables: HashMap::new(),
function_probes: Arc::new(FunctionProbes::default()),
analysis_pool: Arc::default(),
running_analyses: Arc::default(),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use crate::semantic_validation::_helpers::sqlite_temporal_casts;
use crate::semantic_validation::_helpers::truth_tests;
use crate::semantic_validation::_helpers::type_locations::locate_type_findings;
use crate::semantic_validation::models::DiagnosticRow;
use crate::semantic_validation::models::FunctionProbes;
use polyglot_sql::expressions::Select;
use polyglot_sql::{
Dialect, DialectType, Expression, ExpressionWalk, ValidationError, ValidationResult,
Expand Down Expand Up @@ -149,7 +148,6 @@ pub(crate) fn map_diagnostics(
sql: &str,
dialect: DialectType,
result: ValidationResult,
probes: &FunctionProbes,
) -> Result<ValidationResult, String> {
let mut context = DiagnosticContext {
sql,
Expand All @@ -164,9 +162,7 @@ pub(crate) fn map_diagnostics(
errors.push(error);
}
}
errors.extend(function_names::unsupported_function_errors(
sql, dialect, probes,
));
errors.extend(function_names::unsupported_function_errors(sql, dialect));
errors.extend(truth_tests::unsupported_truth_test_errors(sql, dialect));
errors.extend(sqlite_temporal_casts::sqlite_temporal_cast_warnings(
sql, dialect,
Expand Down Expand Up @@ -418,7 +414,6 @@ pub(crate) fn binding_diagnostics(
valid: false,
errors,
},
&FunctionProbes::default(),
)?;
Ok(result.errors.into_iter().map(diagnostic_row).collect())
}
Loading
Loading