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

Closed
wants to merge 6 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@cpcloud
Member

cpcloud commented Oct 12, 2017

No description provided.

@cpcloud cpcloud self-assigned this Oct 12, 2017

@cpcloud cpcloud requested a review from wesm Oct 12, 2017

@cpcloud cpcloud added this to the 0.11.3 milestone Oct 12, 2017

@wesm

wesm approved these changes Oct 15, 2017

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),

This comment has been minimized.

@wesm

wesm Oct 15, 2017

Member

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)

This comment has been minimized.

@cpcloud

cpcloud Oct 16, 2017

Member

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.

This comment has been minimized.

@wesm

wesm Oct 16, 2017

Member

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

This comment has been minimized.

@wesm

wesm Oct 15, 2017

Member

Nice code removal here and above!

@cpcloud cpcloud force-pushed the cpcloud:complex-type-columns branch from 94fd309 to 006a98b Oct 16, 2017

@cpcloud

This comment has been minimized.

Member

cpcloud commented Oct 16, 2017

Merging on green.

@cpcloud cpcloud closed this in b01c533 Oct 16, 2017

@cpcloud cpcloud deleted the cpcloud:complex-type-columns branch Oct 16, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment