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
6 changes: 4 additions & 2 deletions packages/cubejs-backend-native/src/orchestrator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ use crate::node_obj_deserializer::JsValueDeserializer;
use crate::transport::MapCubeErrExt;
use cubeorchestrator::query_message_parser::QueryResult;
use cubeorchestrator::query_result_transform::{
DBResponsePrimitive, RequestResultData, RequestResultDataMulti, TransformedData,
DBResponsePrimitive, InternedKeyLookup, RequestResultData, RequestResultDataMulti,
TransformedData,
};
use cubeorchestrator::transport::{JsRawColumnarData, TransformDataRequest};
use cubesql::compile::engine::df::scan::{ColumnarValueObject, FieldValue, ValueObject};
Expand Down Expand Up @@ -212,7 +213,8 @@ impl ValueObject for ResultWrapper {
)));
};

row.get(field_name).unwrap_or(&DBResponsePrimitive::Null)
row.get(&InternedKeyLookup::new(field_name))
.unwrap_or(&DBResponsePrimitive::Null)
}
};

Expand Down
2 changes: 2 additions & 0 deletions packages/cubejs-dremio-driver/driver/DremioQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ class DremioQuery extends BaseQuery {
templates.functions.DATEDIFF = 'DATE_DIFF(DATE, DATE_TRUNC(\'{{ date_part }}\', {{ args[1] }}), DATE_TRUNC(\'{{ date_part }}\', {{ args[2] }}))';
templates.functions.STRING_AGG = 'LISTAGG({% if distinct %}DISTINCT {% endif %}{{ args_concat }})';
templates.expressions.interval_single_date_part = 'CAST({{ num }} as INTERVAL {{ date_part }})';
templates.expressions.like = '{{ expr }} {% if negated %}NOT {% endif %}LIKE {{ pattern }}{% if default_escape %} ESCAPE \'\\\'{% endif %}';
delete templates.expressions.ilike;
templates.quotes.identifiers = '"';
return templates;
}
Expand Down
2 changes: 2 additions & 0 deletions packages/cubejs-duckdb-driver/src/DuckDBQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ export class DuckDBQuery extends BaseQuery {
templates.functions.LEAST = 'LEAST({{ args_concat }})';
templates.functions.GREATEST = 'GREATEST({{ args_concat }})';
templates.functions.STRING_AGG = 'STRING_AGG({% if distinct %}DISTINCT {% endif %}{{ args[0] }}, COALESCE({{ args[1] }}, \'\'))';
templates.expressions.like = '{{ expr }} {% if negated %}NOT {% endif %}LIKE {{ pattern }}{% if default_escape %} ESCAPE \'\\\'{% endif %}';
templates.expressions.ilike = '{{ expr }} {% if negated %}NOT {% endif %}ILIKE {{ pattern }}{% if default_escape %} ESCAPE \'\\\'{% endif %}';
return templates;
}

Expand Down
10 changes: 9 additions & 1 deletion packages/cubejs-schema-compiler/src/adapter/BaseFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,15 @@ export class BaseFilter extends BaseDimension {
}

public isWildcardOperator() {
return this.camelizeOperator === 'contains' || this.camelizeOperator === 'notContains';
// All LIKE-based operators need wildcard chars escaped in user values
return (
this.camelizeOperator === 'contains' ||
this.camelizeOperator === 'notContains' ||
this.camelizeOperator === 'startsWith' ||
this.camelizeOperator === 'notStartsWith' ||
this.camelizeOperator === 'endsWith' ||
this.camelizeOperator === 'notEndsWith'
);
}

public filterParams() {
Expand Down
1 change: 1 addition & 0 deletions packages/cubejs-schema-compiler/src/adapter/MssqlQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ export class MssqlQuery extends BaseQuery {
delete templates.functions.STRING_AGG;
// PERCENTILE_CONT works but requires PARTITION BY
delete templates.functions.PERCENTILECONT;
templates.expressions.like = '{{ expr }} {% if negated %}NOT {% endif %}LIKE {{ pattern }}{% if default_escape %} ESCAPE \'\\\'{% endif %}';
delete templates.expressions.ilike;
// MSSQL uses + for string concatenation instead of ||
templates.expressions.concat_strings = '{{ strings | join(\' + \' ) }}';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ export class PrestodbQuery extends BaseQuery {
templates.expressions.binary = '{% if op == \'||\' %}' +
'(CAST({{ left }} AS VARCHAR) || CAST({{ right }} AS VARCHAR))' +
'{% else %}({{ left }} {{ op }} {{ right }}){% endif %}';
templates.expressions.like = '{{ expr }} {% if negated %}NOT {% endif %}LIKE {{ pattern }}{% if default_escape %} ESCAPE \'\\\'{% endif %}';
delete templates.expressions.ilike;
templates.types.string = 'VARCHAR';
templates.types.float = 'REAL';
Expand Down
2 changes: 2 additions & 0 deletions packages/cubejs-schema-compiler/src/adapter/SnowflakeQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ export class SnowflakeQuery extends BaseQuery {
templates.expressions.extract = 'EXTRACT({{ date_part }} FROM {{ expr }})';
templates.expressions.interval = 'INTERVAL \'{{ interval }}\'';
templates.expressions.timestamp_literal = '\'{{ value }}\'::timestamp_tz';
templates.expressions.like = '{{ expr }} {% if negated %}NOT {% endif %}LIKE {{ pattern }}{% if default_escape %} ESCAPE \'\\\\\'{% endif %}';
templates.expressions.ilike = '{{ expr }} {% if negated %}NOT {% endif %}ILIKE {{ pattern }}{% if default_escape %} ESCAPE \'\\\\\'{% endif %}';
templates.operators.is_not_distinct_from = 'IS NOT DISTINCT FROM';
templates.join_types.full = 'FULL';
delete templates.types.interval;
Expand Down
2 changes: 1 addition & 1 deletion rust/cube/cubeorchestrator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
[dependencies]
chrono = { version = "0.4.31", features = ["serde"] }
cubeshared = { path = "../cubeshared" }
serde = { version = "1.0.217", features = ["derive"] }
serde = { version = "1.0.217", features = ["derive", "rc"] }
serde_json = "1.0.133"
anyhow = "1.0"
itertools = "0.13.0"
Expand Down
Loading