Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/cachix/install-nix…
Browse files Browse the repository at this point in the history
…-action-v30
  • Loading branch information
codedmart authored Dec 20, 2024
2 parents cd709b2 + 5693ec6 commit 4031637
Show file tree
Hide file tree
Showing 25 changed files with 79 additions and 642 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cargo-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v4

- name: install protoc
uses: arduino/setup-protoc@v2
uses: arduino/setup-protoc@v3
with:
version: "23.3"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cargo-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- uses: actions/checkout@v4

- name: install protoc
uses: arduino/setup-protoc@v2
uses: arduino/setup-protoc@v3
with:
version: "23.3"

Expand Down
38 changes: 14 additions & 24 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[workspace]
resolver = "2"

package.version = "0.1.1"
package.version = "1.0.0"
package.edition = "2021"
package.license = "Apache-2.0"

Expand Down Expand Up @@ -54,7 +54,7 @@ nonempty = "0.10"
percent-encoding = "2"
prometheus = "0.13"
ref-cast = "1"
reqwest = "0.11"
reqwest = { version = "0.11", default-features = false }
schemars = "0.8"
serde = "1"
serde_derive = "^1.0"
Expand Down
4 changes: 3 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Changelog

## [Unreleased]
## [v1.0.0]

- Updated for stable release

### Added

Expand Down
1 change: 0 additions & 1 deletion crates/configuration/src/to_runtime_configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ fn convert_nullable(nullable: &metadata::Nullable) -> query_engine_metadata::met
fn convert_type(r#type: metadata::Type) -> query_engine_metadata::metadata::Type {
match r#type {
metadata::Type::ScalarType(t) => query_engine_metadata::metadata::Type::ScalarType(t),
metadata::Type::CompositeType(t) => query_engine_metadata::metadata::Type::CompositeType(t),
metadata::Type::ArrayType(t) => {
query_engine_metadata::metadata::Type::ArrayType(Box::new(convert_type(*t)))
}
Expand Down
2 changes: 1 addition & 1 deletion crates/connectors/ndc-bigquery/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ axum-test-helper = { workspace = true }
insta = { workspace = true, features = ["json"] }
env_logger = { workspace = true }
hyper = { workspace = true, features = ["tcp"] }
reqwest = { workspace = true, default-features = false, features = ["rustls-tls"] }
reqwest = { workspace = true, features = ["rustls-tls"] }
similar-asserts = { workspace = true }
url = { workspace = true }
1 change: 0 additions & 1 deletion crates/connectors/ndc-bigquery/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,5 @@ pub fn type_to_type(typ: &metadata::Type) -> models::Type {
metadata::Type::ScalarType(scalar_type) => models::Type::Named {
name: scalar_type.as_str().into(),
},
metadata::Type::CompositeType(t) => models::Type::Named { name: t.clone() },
}
}
22 changes: 0 additions & 22 deletions crates/query-engine/metadata/src/metadata/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ pub struct ScalarTypeTypeName(pub String);
#[serde(rename_all = "camelCase")]
pub enum Type {
ScalarType(models::ScalarTypeName),
CompositeType(models::TypeName),
ArrayType(Box<Type>),
}

Expand Down Expand Up @@ -44,27 +43,6 @@ pub struct ScalarType {
pub type_representation: Option<TypeRepresentation>,
}

/// Map of all known composite types.
#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct CompositeTypes(pub BTreeMap<models::TypeName, CompositeType>);

impl CompositeTypes {
pub fn empty() -> Self {
CompositeTypes(BTreeMap::new())
}
}

/// Information about a composite type. These are very similar to tables, but with the crucial
/// difference that composite types do not support constraints (such as NOT NULL).
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
pub struct CompositeType {
pub type_name: String,
pub schema_name: Option<String>,
pub fields: BTreeMap<models::FieldName, FieldInfo>,
pub description: Option<String>,
}

/// The complete list of supported binary operators for scalar types.
/// Not all of these are supported for every type.
#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize, JsonSchema)]
Expand Down
2 changes: 0 additions & 2 deletions crates/query-engine/sql/src/sql/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ pub enum SelectList {
SelectStar,
SelectStarFrom(TableReference),
Select1,
SelectStarComposite(Expression),
SelectListComposite(Box<SelectList>, Box<SelectList>),
}

/// A FROM clause
Expand Down
10 changes: 0 additions & 10 deletions crates/query-engine/sql/src/sql/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,9 @@ impl SelectList {
table_reference.to_sql(sql);
sql.append_syntax(".*");
}
SelectList::SelectStarComposite(expr) => {
sql.append_syntax("(");
expr.to_sql(sql);
sql.append_syntax(").*");
}
SelectList::Select1 => {
sql.append_syntax("1");
}
SelectList::SelectListComposite(select_list1, select_list2) => {
select_list1.to_sql(sql);
sql.append_syntax(", ");
select_list2.to_sql(sql);
}
}
}
}
Expand Down
14 changes: 0 additions & 14 deletions crates/query-engine/sql/src/sql/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,6 @@ pub fn make_column_alias(name: String) -> ColumnAlias {

// SELECTs //

/// Build a simple 'SELECT (exp).*'
pub fn select_composite(exp: Expression) -> Select {
Select {
with: empty_with(),
select_list: SelectList::SelectStarComposite(exp),
from: None,
joins: vec![],
where_: Where(empty_where()),
group_by: empty_group_by(),
order_by: empty_order_by(),
limit: empty_limit(),
}
}

/// Build a simple select with a select list and the rest are empty.
pub fn simple_select(select_list: Vec<(ColumnAlias, Expression)>) -> Select {
Select {
Expand Down
9 changes: 0 additions & 9 deletions crates/query-engine/sql/src/sql/rewrites/constant_folding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,9 @@ pub fn normalize_select(mut select: Select) -> Select {
/// Normalize all expressions in a select list.
pub fn normalize_select_list(select_list: SelectList) -> SelectList {
match select_list {
SelectList::SelectListComposite(select_list1, select_list2) => {
SelectList::SelectListComposite(
Box::new(normalize_select_list(*select_list1)),
Box::new(normalize_select_list(*select_list2)),
)
}
SelectList::SelectStar => SelectList::SelectStar,
SelectList::SelectStarFrom(table) => SelectList::SelectStarFrom(table),
SelectList::Select1 => SelectList::Select1,
SelectList::SelectStarComposite(exp) => {
SelectList::SelectStarComposite(normalize_expr(exp))
}
SelectList::SelectList(vec) => SelectList::SelectList(
vec.into_iter()
.map(|(alias, expr)| (alias, normalize_expr(expr)))
Expand Down
Loading

0 comments on commit 4031637

Please sign in to comment.