-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SNOW-1887901: fix partitioning logic #2944
base: dev/data-source
Are you sure you want to change the base?
Conversation
if column_type != int | ||
else int(processed_lower_bound + i * stride) | ||
l_bound = ( | ||
f"{column} >= {self._to_external_value(current_value, column_type)}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in spark
partitionColumn must be a numeric, date, or timestamp column
do we handle all 3 types here?
also can you check the pyspark behavior if passing column unsupported type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found I actually wrote the code to support all types, so I just added a test here
tests/integ/test_data_source_api.py
Outdated
@@ -8,6 +8,8 @@ | |||
from unittest.mock import MagicMock | |||
import pytest | |||
|
|||
from snowflake.snowpark.types import IntegerType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's add tests for a couple of more types? like float, decimal, datetime, date
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also unsupported type test
Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-1887901
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
fix partition logic, now it would generate same results as spark do