Skip to content

Commit

Permalink
Merge pull request #1986 from mabel-dev/#1985
Browse files Browse the repository at this point in the history
  • Loading branch information
joocer authored Sep 6, 2024
2 parents 2c71a88 + b200f9d commit 6e2a71a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
4 changes: 2 additions & 2 deletions opteryx/__version__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__build__ = 768
__build__ = 771

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -28,7 +28,7 @@ class VersionStatus(Enum):

_major = 0
_minor = 17
_revision = 0
_revision = 1
_status = VersionStatus.RELEASE

__author__ = "@joocer"
Expand Down
5 changes: 4 additions & 1 deletion opteryx/operators/cross_join_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ def _cross_join_unnest_column(
schema = pyarrow.schema(
[pyarrow.field(name=target_column.identity, type=target_column.arrow_field.type)]
)
new_block = pyarrow.Table.from_arrays([single_column_collector], schema=schema)
arrow_array = pyarrow.array(single_column_collector)
if arrow_array.type != target_column.arrow_field.type:
arrow_array = arrow_array.cast(target_column.arrow_field.type)
new_block = pyarrow.Table.from_arrays([arrow_array], schema=schema)
yield new_block
at_least_once = True

Expand Down
2 changes: 1 addition & 1 deletion tests/requirements_arm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pandas
polars

# different storage providers
avro
fastavro
firebase-admin
sqlalchemy
pymysql
Expand Down
9 changes: 9 additions & 0 deletions tests/sql_battery/test_shapes_and_errors_battery.py
Original file line number Diff line number Diff line change
Expand Up @@ -1704,6 +1704,15 @@
("SELECT * FROM $missions WHERE Launched_at < current_time + INTERVAL '7' DAY;", 4503, 8, None),
("SELECT * FROM $missions WHERE current_time > Launched_at + INTERVAL '7' DAY;", 4503, 8, None),

("SELECT ARRAY_AGG(id) FROM $satellites GROUP BY planetId", 7, 1, None),
("SELECT * FROM (SELECT ARRAY_AGG(id) AS pids FROM $satellites GROUP BY planetId) AS sats", 7, 1, None),
("SELECT * FROM (SELECT ARRAY_AGG(id) AS pids, planetId FROM $satellites GROUP BY planetId) AS sats", 7, 2, None),
("SELECT * FROM $planets INNER JOIN (SELECT ARRAY_AGG(id) AS pids, planetId FROM $satellites GROUP BY planetId) AS sats ON sats.planetId = $planets.id", 7, 22, None),
("SELECT * FROM $planets LEFT JOIN (SELECT ARRAY_AGG(id) AS pids, planetId FROM $satellites GROUP BY planetId) AS sats ON sats.planetId = $planets.id", 9, 22, None),
("SELECT * FROM (SELECT * FROM $planets LEFT JOIN (SELECT ARRAY_AGG(id) AS pids, planetId FROM $satellites GROUP BY planetId) AS sats ON sats.planetId = $planets.id) as satellites", 9, 22, None),
("SELECT pids FROM (SELECT * FROM $planets LEFT JOIN (SELECT ARRAY_AGG(id) AS pids, planetId FROM $satellites GROUP BY planetId) AS sats ON sats.planetId = $planets.id) as satellites", 9, 1, None),
("SELECT pid FROM (SELECT * FROM $planets LEFT JOIN (SELECT ARRAY_AGG(id) AS pids, planetId FROM $satellites GROUP BY planetId) AS sats ON sats.planetId = $planets.id) as satellites CROSS JOIN UNNEST(pids) AS pid", 177, 1, None),

# ****************************************************************************************

# These are queries which have been found to return the wrong result or not run correctly
Expand Down

0 comments on commit 6e2a71a

Please sign in to comment.