primitiveDefaultValue in CodeGenUtils in Table API

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

primitiveDefaultValue in CodeGenUtils in Table API

Cody Innowhere
Hi guys,
I found that in CodeGenUtils, default values of numeric primitive types are
set to -1, what's the consideration of setting the default values to -1
instead of 0? IMHO 0 would make more sense, although in DB if a field is
null then all operations on this field will return null anyway.
Reply | Threaded
Open this post in threaded view
|

Re: primitiveDefaultValue in CodeGenUtils in Table API

Timo Walther-2
Hi Cody,

default values are needed in cases where NULL values are not supported.
This happens if the null check is disabled in TableConfig for efficiency
reasons. Using 0 to DataType.MAX_VALUE for numeric types and -1 as a
NULL equivalent in special cases seems more reasonable to me.

Hope that helps.

Timo

On 29.06.2016 05:24, Cody Innowhere wrote:
> Hi guys,
> I found that in CodeGenUtils, default values of numeric primitive types are
> set to -1, what's the consideration of setting the default values to -1
> instead of 0? IMHO 0 would make more sense, although in DB if a field is
> null then all operations on this field will return null anyway.
>
Reply | Threaded
Open this post in threaded view
|

Re: primitiveDefaultValue in CodeGenUtils in Table API

Cody Innowhere
@Fabian,
given the example that a user wants to sum a column whose value might be
null, with null check enabled. In this case, when the column value is null,
-1 is set instead? Am I understanding correctly?


On Wed, Jun 29, 2016 at 3:28 PM, Timo Walther <[hidden email]> wrote:

> Hi Cody,
>
> default values are needed in cases where NULL values are not supported.
> This happens if the null check is disabled in TableConfig for efficiency
> reasons. Using 0 to DataType.MAX_VALUE for numeric types and -1 as a NULL
> equivalent in special cases seems more reasonable to me.
>
> Hope that helps.
>
> Timo
>
>
> On 29.06.2016 05:24, Cody Innowhere wrote:
>
>> Hi guys,
>> I found that in CodeGenUtils, default values of numeric primitive types
>> are
>> set to -1, what's the consideration of setting the default values to -1
>> instead of 0? IMHO 0 would make more sense, although in DB if a field is
>> null then all operations on this field will return null anyway.
>>
>>
Reply | Threaded
Open this post in threaded view
|

AW: primitiveDefaultValue in CodeGenUtils in Table API

Fabian Hueske-2
Hi Cody,

Aggregations are currently not performed by code-generated user functions. This would be a good improvement though. Check the  DataSetAggregate class to learn how aggregations are translated into Flink Dataset programs.

Best, Fabian


Von: Cody Innowhere
Reply | Threaded
Open this post in threaded view
|

Re: primitiveDefaultValue in CodeGenUtils in Table API

Cody Innowhere
Oh yes we've made a bit change on flink table API so that we can work on
data streams like data sets, thus code-generation is called.

On Wed, Jun 29, 2016 at 8:31 PM, Fabian Hueske <[hidden email]> wrote:

> Hi Cody,
>
>
>
> Aggregations are currently not performed by code-generated user functions.
> This would be a good improvement though. Check the  DataSetAggregate class
> to learn how aggregations are translated into Flink Dataset programs.
>
>
>
> Best, Fabian
>
>
>
>
>
> *Von: *Cody Innowhere <[hidden email]>
> *Gesendet: *Mittwoch, 29. Juni 2016 10:06
> *An: *[hidden email]
> *Betreff: *Re: primitiveDefaultValue in CodeGenUtils in Table API
>
>
>
> @Fabian,
>
> given the example that a user wants to sum a column whose value might be
>
> null, with null check enabled. In this case, when the column value is null,
>
> -1 is set instead? Am I understanding correctly?
>
>
>
>
>
> On Wed, Jun 29, 2016 at 3:28 PM, Timo Walther <[hidden email]> wrote:
>
>
>
> > Hi Cody,
>
> >
>
> > default values are needed in cases where NULL values are not supported.
>
> > This happens if the null check is disabled in TableConfig for efficiency
>
> > reasons. Using 0 to DataType.MAX_VALUE for numeric types and -1 as a NULL
>
> > equivalent in special cases seems more reasonable to me.
>
> >
>
> > Hope that helps.
>
> >
>
> > Timo
>
> >
>
> >
>
> > On 29.06.2016 05:24, Cody Innowhere wrote:
>
> >
>
> >> Hi guys,
>
> >> I found that in CodeGenUtils, default values of numeric primitive types
>
> >> are
>
> >> set to -1, what's the consideration of setting the default values to -1
>
> >> instead of 0? IMHO 0 would make more sense, although in DB if a field is
>
> >> null then all operations on this field will return null anyway.
>
> >>
>
> >>
>
>
>