Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
joocer committed Dec 22, 2024
1 parent 7c9df82 commit 9822658
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 18 deletions.
2 changes: 1 addition & 1 deletion opteryx/operators/aggregate_and_group_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def config(self): # pragma: no cover

@property
def name(self): # pragma: no cover
return "Group"
return "Group By"

def execute(self, morsel: pyarrow.Table, **kwargs):
if morsel == EOS:
Expand Down
2 changes: 0 additions & 2 deletions opteryx/operators/async_read_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,7 @@ def execute(self, morsel, **kwargs) -> Generator:
arrow_schema = morsel.schema

self.statistics.blobs_read += 1
self.records_out += morsel.num_rows
self.statistics.rows_read += morsel.num_rows
self.bytes_out += morsel.nbytes

yield morsel
except Exception as err:
Expand Down
2 changes: 0 additions & 2 deletions opteryx/operators/function_dataset_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ def execute(self, morsel, **kwargs) -> Generator:
else:
table = data

self.records_out += table.num_rows
self.bytes_out += table.nbytes
self.statistics.columns_read += len(table.column_names)

yield table
2 changes: 0 additions & 2 deletions opteryx/operators/read_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,7 @@ def execute(self, morsel, **kwargs) -> Generator:

self.statistics.time_reading_blobs += time.monotonic_ns() - start_clock
self.statistics.blobs_read += 1
self.records_out += morsel.num_rows
self.statistics.rows_read += morsel.num_rows
self.bytes_out += morsel.nbytes
yield morsel
start_clock = time.monotonic_ns()
if morsel:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,6 @@ def fold_constants(root: Node, statistics: QueryStatistics) -> Node:
root.left.schema_column = root.schema_column
statistics.optimization_constant_fold_reduce += 1
return root.left # anything
if (
root.value == "Divide"
and root.right.node_type == NodeType.IDENTIFIER
and root.left.node_type == NodeType.IDENTIFIER
and root.right.schema_column.identity == root.left.schema_column.identity
):
# anything / itself = 1 (0 is an exception)
node = build_literal_node(1, root, OrsoTypes.INTEGER)
statistics.optimization_constant_fold_reduce += 1
node.schema_column = root.schema_column
return node

if root.node_type == NodeType.COMPARISON_OPERATOR:
if (
Expand Down
2 changes: 2 additions & 0 deletions tests/sql_battery/test_shapes_and_errors_battery.py
Original file line number Diff line number Diff line change
Expand Up @@ -2180,6 +2180,8 @@
# 2059
("SELECT g FROM generate_series(10) as g CROSS JOIN UNNEST (g) as g1", 0, 0, TypeError),
("SELECT DISTINCT l FROM (SELECT split('a b c d e f g h i j', ' ') as letters) as plet CROSS JOIN UNNEST (letters) as l", 10, 1, None),
# 2112
("SELECT id FROM $planets WHERE surface_pressure / surface_pressure is null", 5, 1, None),
]
# fmt:on

Expand Down

0 comments on commit 9822658

Please sign in to comment.