Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
zhyass committed Jan 2, 2025
1 parent c148150 commit aa1b2fd
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/query/functions/src/scalars/hilbert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ pub fn register(registry: &mut FunctionRegistry) {

if std::intrinsics::unlikely(len > 64) {
ctx.set_error(builder.len(), "Width must be less than or equal to 64");
builder.push_null();
} else if std::intrinsics::unlikely(!(2..=5).contains(&dimension)) {
ctx.set_error(builder.len(), "Dimension must between 2 and 5");
builder.push_null();
} else {
let slice = hilbert_index(&points, len as usize);
builder.push(&slice);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2239,8 +2239,8 @@ Functions overloads:
1 h3_unidirectional_edge_is_valid(UInt64 NULL) :: Boolean NULL
0 haversine(Float64, Float64, Float64, Float64) :: Float64
1 haversine(Float64 NULL, Float64 NULL, Float64 NULL, Float64 NULL) :: Float64 NULL
0 hilbert_index(Array(Binary), UInt64) :: Binary
1 hilbert_index(Array(Binary) NULL, UInt64 NULL) :: Binary NULL
0 hilbert_index(Array(Binary NULL), UInt64) :: Binary NULL
1 hilbert_index(Array(Binary NULL) NULL, UInt64 NULL) :: Binary NULL
0 hilbert_key(String) :: Binary
1 hilbert_key(String NULL) :: Binary NULL
2 hilbert_key(UInt8) :: Binary
Expand Down Expand Up @@ -3501,6 +3501,8 @@ Functions overloads:
2 rand(UInt64 NULL) :: Float64 NULL
0 range(UInt64, UInt64) :: Array(UInt64)
1 range(UInt64 NULL, UInt64 NULL) :: Array(UInt64) NULL
0 range_partition_id(T0, Array(T0)) :: UInt64
1 range_partition_id(T0 NULL, Array(T0) NULL) :: UInt64 NULL
0 regexp(String, String) :: Boolean
1 regexp(String NULL, String NULL) :: Boolean NULL
0 regexp_instr FACTORY
Expand Down
6 changes: 2 additions & 4 deletions src/query/sql/src/planner/binder/ddl/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1180,10 +1180,8 @@ impl Binder {
) \
SELECT \
* EXCLUDE(_hilbert_index) \
FROM \
_source_data \
ORDER BY \
_hilbert_index"
FROM _source_data \
ORDER BY _hilbert_index"
);
let tokens = tokenize_sql(query.as_str())?;
let (stmt, _) = parse_sql(&tokens, self.dialect)?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
## See the License for the specific language governing permissions and
## limitations under the License.

statement ok
set enable_parallel_multi_merge_sort = 0;

statement ok
CREATE OR REPLACE TABLE test_hilbert(a int, b int) cluster by hilbert(a,b) row_per_block = 2;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Error: APIError: QueryFailed: [3905]Modification not permitted: Table 'attach_re
alter table flashback not allowed
Error: APIError: QueryFailed: [3905]Modification not permitted: Table 'attach_read_only' is READ ONLY, preventing any changes or updates.
alter table recluster not allowed
Error: APIError: QueryFailed: [3905]Modification not permitted: Table 'attach_read_only' is READ ONLY, preventing any changes or updates.
Error: APIError: QueryFailed: [1118]Unclustered table 'default.attach_read_only'
analyze table not allowed
Error: APIError: QueryFailed: [3905]Modification not permitted: Table 'attach_read_only' is READ ONLY, preventing any changes or updates.
optimize table
Expand Down

0 comments on commit aa1b2fd

Please sign in to comment.