-
Notifications
You must be signed in to change notification settings - Fork 590
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
Add expressions for Map/Struct types and columns #1166
Conversation
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.
Looked through this pretty carefully, looks good to me. Will be cool to see this working on engines that support it
| (list('abc'), 'array<string>', ir.ArrayScalar), | ||
| ([1, 2, 3], 'array<int8>', ir.ArrayScalar), | ||
| ({'a': 1, 'b': 2, 'c': 3}, 'map<string, int8>', ir.MapScalar), | ||
| ({1: 2, 3: 4, 5: 6}, 'map<int8, int8>', ir.MapScalar), |
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.
Aside: I wonder how much we benefit / are hurt overall from aggressively choosing the smallest type integer that will fit the literal values vs. using int32 (unless some values are larger than INT32_MAX)
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.
Interesting, I tried to compute (2 ** 20) ** 200000 and got an overflow error. I think we should not try to infer the smallest integer type containing the result of an integer operation since it could take an unreasonably long amount of time to raise OverflowError.
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.
Yeah, the question is what is the benefit or cost (if any) of literal([1, 2, 3]) returning an array<int8> vs. array<int32>
| def factory(arg, name=None): | ||
| return ArrayScalar(arg, self.type(), name=name) | ||
| return factory | ||
|
|
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.
Nice code removal here and above!
94fd309
to
006a98b
Compare
|
Merging on green. |
No description provided.