[jira] [Updated] (SPARK-19311) UDFs disregard UDT type hierarchy

2017-01-25 Thread Xiao Li (JIRA)

 [ 
https://issues.apache.org/jira/browse/SPARK-19311?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiao Li updated SPARK-19311:

Assignee: Gregor Moehler

> UDFs disregard UDT type hierarchy
> -
>
> Key: SPARK-19311
> URL: https://issues.apache.org/jira/browse/SPARK-19311
> Project: Spark
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 2.1.0
>Reporter: Gregor Moehler
>Assignee: Gregor Moehler
> Fix For: 2.1.1, 2.2.0
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> When you define UDTs based on hierarchical traits UDFs disregard the type 
> hierarchy:
> E.g. I have 2 UDTs based on 2 hierarchical traits. I then define 2 UDFs: The 
> first one returns the derived type, the second takes the base type. This 
> results in an error, although i believe it should be feasible:
> {quote}
> (...)cannot resolve 'UDF(UDF(22))' due to data type mismatch: argument 1 
> requires exampleBaseType type, however, 'UDF(22)' is of exampleFirstSubType 
> type.
> {quote}
> The reason is that DataType defines
> {quote}
> override private[sql] def acceptsType(dataType: DataType) =
> this.getClass == dataType.getClass
> {quote}
> However I believe it should be:
> {quote}
> override private[sql] def acceptsType(dataType: DataType) = dataType match \{
> case other: UserDefinedType[_] =>
>   this.getClass == other.getClass || 
> this.userClass.isAssignableFrom(other.userClass)
> case _ => false
>   \}
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Updated] (SPARK-19311) UDFs disregard UDT type hierarchy

2017-01-20 Thread Gregor Moehler (JIRA)

 [ 
https://issues.apache.org/jira/browse/SPARK-19311?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gregor Moehler updated SPARK-19311:
---
Description: 
When you define UDTs based on hierarchical traits UDFs disregard the type 
hierarchy:

E.g. I have 2 UDTs based on 2 hierarchical traits. I then define 2 UDFs: The 
first one returns the derived type, the second takes the base type. This 
results in an error, although i believe it should be feasible:

{quote}
(...)cannot resolve 'UDF(UDF(22))' due to data type mismatch: argument 1 
requires exampleBaseType type, however, 'UDF(22)' is of exampleFirstSubType 
type.
{quote}

The reason is that DataType defines
{quote}
override private[sql] def acceptsType(dataType: DataType) =
this.getClass == dataType.getClass
{quote}

However I believe it should be:

{quote}
override private[sql] def acceptsType(dataType: DataType) = dataType match \{
case other: UserDefinedType[_] =>
  this.getClass == other.getClass || 
this.userClass.isAssignableFrom(other.userClass)
case _ => false
  \}
{quote}

  was:
When you define UDTs based on hierarchical traits UDFs disregard the type 
hierarchy:

E.g. I have 2 UDTs based on 2 hierarchical traits. I then define 2 UDFs: The 
first one returns the derived type, the second takes the base type. This 
results in an error, although i believe it should be feasible:

{quote}
(...)cannot resolve 'UDF(UDF(22))' due to data type mismatch: argument 1 
requires exampleBaseType type, however, 'UDF(22)' is of exampleFirstSubType 
type.
{quote}

The reason is that DataType defines
{quote}
override private[sql] def acceptsType(dataType: DataType) =
this.getClass == dataType.getClass
{quote}

However I believe it should be:

{quote}
override private[sql] def acceptsType(dataType: DataType) = dataType match {
case other: UserDefinedType[_] =>
  this.getClass == other.getClass || 
this.userClass.isAssignableFrom(other.userClass)
case _ => false
  }
{quote}


> UDFs disregard UDT type hierarchy
> -
>
> Key: SPARK-19311
> URL: https://issues.apache.org/jira/browse/SPARK-19311
> Project: Spark
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 2.1.0
>Reporter: Gregor Moehler
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> When you define UDTs based on hierarchical traits UDFs disregard the type 
> hierarchy:
> E.g. I have 2 UDTs based on 2 hierarchical traits. I then define 2 UDFs: The 
> first one returns the derived type, the second takes the base type. This 
> results in an error, although i believe it should be feasible:
> {quote}
> (...)cannot resolve 'UDF(UDF(22))' due to data type mismatch: argument 1 
> requires exampleBaseType type, however, 'UDF(22)' is of exampleFirstSubType 
> type.
> {quote}
> The reason is that DataType defines
> {quote}
> override private[sql] def acceptsType(dataType: DataType) =
> this.getClass == dataType.getClass
> {quote}
> However I believe it should be:
> {quote}
> override private[sql] def acceptsType(dataType: DataType) = dataType match \{
> case other: UserDefinedType[_] =>
>   this.getClass == other.getClass || 
> this.userClass.isAssignableFrom(other.userClass)
> case _ => false
>   \}
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Updated] (SPARK-19311) UDFs disregard UDT type hierarchy

2017-01-20 Thread Gregor Moehler (JIRA)

 [ 
https://issues.apache.org/jira/browse/SPARK-19311?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gregor Moehler updated SPARK-19311:
---
Description: 
When you define UDTs based on hierarchical traits UDFs disregard the type 
hierarchy:

E.g. I have 2 UDTs based on 2 hierarchical traits. I then define 2 UDFs: The 
first one returns the derived type, the second takes the base type. This 
results in an error, although i believe it should be feasible:

{quote}
(...)cannot resolve 'UDF(UDF(22))' due to data type mismatch: argument 1 
requires exampleBaseType type, however, 'UDF(22)' is of exampleFirstSubType 
type.
{quote}

The reason is that DataType defines
{quote}
override private[sql] def acceptsType(dataType: DataType) =
this.getClass == dataType.getClass
{quote}

However I believe it should be:

{quote}
override private[sql] def acceptsType(dataType: DataType) = dataType match {
case other: UserDefinedType[_] =>
  this.getClass == other.getClass || 
this.userClass.isAssignableFrom(other.userClass)
case _ => false
  }
{quote}

  was:
When you define UDTs based on hierarchical traits UDFs disregard the type 
hierarchy:

E.g. I have 2 UDTs based on 2 hierarchical traits. I then define 2 UDFs: The 
first one returns the derived type, the second takes the base type. This 
results in an error, although i believe it should be feasible:

(...)cannot resolve 'UDF(UDF(22))' due to data type mismatch: argument 1 
requires exampleBaseType type, however, 'UDF(22)' is of exampleFirstSubType 
type.

The reason is that DataType defines
{quote}
override private[sql] def acceptsType(dataType: DataType) =
this.getClass == dataType.getClass
{quote}

However I believe it should be:

{quote}
override private[sql] def acceptsType(dataType: DataType) = dataType match {
case other: UserDefinedType[_] =>
  this.getClass == other.getClass || 
this.userClass.isAssignableFrom(other.userClass)
case _ => false
  }
{quote}


> UDFs disregard UDT type hierarchy
> -
>
> Key: SPARK-19311
> URL: https://issues.apache.org/jira/browse/SPARK-19311
> Project: Spark
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 2.1.0
>Reporter: Gregor Moehler
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> When you define UDTs based on hierarchical traits UDFs disregard the type 
> hierarchy:
> E.g. I have 2 UDTs based on 2 hierarchical traits. I then define 2 UDFs: The 
> first one returns the derived type, the second takes the base type. This 
> results in an error, although i believe it should be feasible:
> {quote}
> (...)cannot resolve 'UDF(UDF(22))' due to data type mismatch: argument 1 
> requires exampleBaseType type, however, 'UDF(22)' is of exampleFirstSubType 
> type.
> {quote}
> The reason is that DataType defines
> {quote}
> override private[sql] def acceptsType(dataType: DataType) =
> this.getClass == dataType.getClass
> {quote}
> However I believe it should be:
> {quote}
> override private[sql] def acceptsType(dataType: DataType) = dataType match {
> case other: UserDefinedType[_] =>
>   this.getClass == other.getClass || 
> this.userClass.isAssignableFrom(other.userClass)
> case _ => false
>   }
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Updated] (SPARK-19311) UDFs disregard UDT type hierarchy

2017-01-20 Thread Gregor Moehler (JIRA)

 [ 
https://issues.apache.org/jira/browse/SPARK-19311?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gregor Moehler updated SPARK-19311:
---
Description: 
When you define UDTs based on hierarchical traits UDFs disregard the type 
hierarchy:

E.g. I have 2 UDTs based on 2 hierarchical traits. I then define 2 UDFs: The 
first one returns the derived type, the second takes the base type. This 
results in an error, although i believe it should be feasible:

(...)cannot resolve 'UDF(UDF(22))' due to data type mismatch: argument 1 
requires exampleBaseType type, however, 'UDF(22)' is of exampleFirstSubType 
type.

The reason is that DataType defines
{quote}
override private[sql] def acceptsType(dataType: DataType) =
this.getClass == dataType.getClass
{quote}

However I believe it should be:

{quote}
override private[sql] def acceptsType(dataType: DataType) = dataType match {
case other: UserDefinedType[_] =>
  this.getClass == other.getClass || 
this.userClass.isAssignableFrom(other.userClass)
case _ => false
  }
{quote}

  was:
When you define UDTs based on hierarchical traits UDFs disregard the type 
hierarchy:

E.g. I have 2 UDTs based on 2 hierarchical traits. I then define 2 UDFs: The 
first one returns the derived type, the second takes the base type. This 
results in an error, although i believe it should be feasible:

(...)cannot resolve 'UDF(UDF(22))' due to data type mismatch: argument 1 
requires exampleBaseType type, however, 'UDF(22)' is of exampleFirstSubType 
type.

The reason is that DataType defines
override private[sql] def acceptsType(dataType: DataType) =
this.getClass == dataType.getClass

However I believe it should be:

override private[sql] def acceptsType(dataType: DataType) = dataType match {
case other: UserDefinedType[_] =>
  this.getClass == other.getClass || 
this.userClass.isAssignableFrom(other.userClass)
case _ => false
  }


> UDFs disregard UDT type hierarchy
> -
>
> Key: SPARK-19311
> URL: https://issues.apache.org/jira/browse/SPARK-19311
> Project: Spark
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 2.1.0
>Reporter: Gregor Moehler
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> When you define UDTs based on hierarchical traits UDFs disregard the type 
> hierarchy:
> E.g. I have 2 UDTs based on 2 hierarchical traits. I then define 2 UDFs: The 
> first one returns the derived type, the second takes the base type. This 
> results in an error, although i believe it should be feasible:
> (...)cannot resolve 'UDF(UDF(22))' due to data type mismatch: argument 1 
> requires exampleBaseType type, however, 'UDF(22)' is of exampleFirstSubType 
> type.
> The reason is that DataType defines
> {quote}
> override private[sql] def acceptsType(dataType: DataType) =
> this.getClass == dataType.getClass
> {quote}
> However I believe it should be:
> {quote}
> override private[sql] def acceptsType(dataType: DataType) = dataType match {
> case other: UserDefinedType[_] =>
>   this.getClass == other.getClass || 
> this.userClass.isAssignableFrom(other.userClass)
> case _ => false
>   }
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Updated] (SPARK-19311) UDFs disregard UDT type hierarchy

2017-01-20 Thread Gregor Moehler (JIRA)

 [ 
https://issues.apache.org/jira/browse/SPARK-19311?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gregor Moehler updated SPARK-19311:
---
Description: 
When you define UDTs based on hierarchical traits UDFs disregard the type 
hierarchy:

E.g. I have 2 UDTs based on 2 hierarchical traits. I then define 2 UDFs: The 
first one returns the derived type, the second takes the base type. This 
results in an error, although i believe it should be feasible:

(...)cannot resolve 'UDF(UDF(22))' due to data type mismatch: argument 1 
requires exampleBaseType type, however, 'UDF(22)' is of exampleFirstSubType 
type.

The reason is that DataType defines
override private[sql] def acceptsType(dataType: DataType) =
this.getClass == dataType.getClass

However I believe it should be:

override private[sql] def acceptsType(dataType: DataType) = dataType match {
case other: UserDefinedType[_] =>
  this.getClass == other.getClass || 
this.userClass.isAssignableFrom(other.userClass)
case _ => false
  }

  was:
When you define UDTs based on hierarchical traits UDFs disregard the type 
hierarchy:

E.g. I have 2 UDTs based on 2 hierarchical traits. I then define 2 UDFs: The 
first one returns the derived type, the second takes the base type. This 
results in an error, although i believe it should be feasible:

(...)cannot resolve 'UDF(UDF(22))' due to data type mismatch: argument 1 
requires exampleBaseType type, however, 'UDF(22)' is of exampleFirstSubType 
type.

The reason is that DataType defines
override private[sql] def acceptsType(dataType: DataType) =
this.getClass == dataType.getClass

However I believe it should be:

```override private[sql] def acceptsType(dataType: DataType) = dataType match {
case other: UserDefinedType[_] =>
  this.getClass == other.getClass ||
this.userClass.isAssignableFrom(other.userClass)
case _ => false
  }```


> UDFs disregard UDT type hierarchy
> -
>
> Key: SPARK-19311
> URL: https://issues.apache.org/jira/browse/SPARK-19311
> Project: Spark
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 2.1.0
>Reporter: Gregor Moehler
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> When you define UDTs based on hierarchical traits UDFs disregard the type 
> hierarchy:
> E.g. I have 2 UDTs based on 2 hierarchical traits. I then define 2 UDFs: The 
> first one returns the derived type, the second takes the base type. This 
> results in an error, although i believe it should be feasible:
> (...)cannot resolve 'UDF(UDF(22))' due to data type mismatch: argument 1 
> requires exampleBaseType type, however, 'UDF(22)' is of exampleFirstSubType 
> type.
> The reason is that DataType defines
> override private[sql] def acceptsType(dataType: DataType) =
> this.getClass == dataType.getClass
> However I believe it should be:
> override private[sql] def acceptsType(dataType: DataType) = dataType match {
> case other: UserDefinedType[_] =>
>   this.getClass == other.getClass || 
> this.userClass.isAssignableFrom(other.userClass)
> case _ => false
>   }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Updated] (SPARK-19311) UDFs disregard UDT type hierarchy

2017-01-20 Thread Gregor Moehler (JIRA)

 [ 
https://issues.apache.org/jira/browse/SPARK-19311?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gregor Moehler updated SPARK-19311:
---
Description: 
When you define UDTs based on hierarchical traits UDFs disregard the type 
hierarchy:

E.g. I have 2 UDTs based on 2 hierarchical traits. I then define 2 UDFs: The 
first one returns the derived type, the second takes the base type. This 
results in an error, although i believe it should be feasible:

(...)cannot resolve 'UDF(UDF(22))' due to data type mismatch: argument 1 
requires exampleBaseType type, however, 'UDF(22)' is of exampleFirstSubType 
type.

The reason is that DataType defines
override private[sql] def acceptsType(dataType: DataType) =
this.getClass == dataType.getClass

However I believe it should be:

```override private[sql] def acceptsType(dataType: DataType) = dataType match {
case other: UserDefinedType[_] =>
  this.getClass == other.getClass ||
this.userClass.isAssignableFrom(other.userClass)
case _ => false
  }```

  was:
When you define UDTs based on hierarchical traits UDFs disregard the type 
hierarchy:

E.g. I have 2 UDTs based on 2 hierarchical traits. I then define 2 UDFs: The 
first one returns the derived type, the second takes the base type. This 
results in an error, although i believe it should be feasible:

(...)cannot resolve 'UDF(UDF(22))' due to data type mismatch: argument 1 
requires exampleBaseType type, however, 'UDF(22)' is of exampleFirstSubType 
type.

The reason is that DataType defines
override private[sql] def acceptsType(dataType: DataType) =
this.getClass == dataType.getClass

However I believe it should be:

override private[sql] def acceptsType(dataType: DataType) = dataType match {
case other: UserDefinedType[_] =>
  this.getClass == other.getClass ||
this.userClass.isAssignableFrom(other.userClass)
case _ => false
  }


> UDFs disregard UDT type hierarchy
> -
>
> Key: SPARK-19311
> URL: https://issues.apache.org/jira/browse/SPARK-19311
> Project: Spark
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 2.1.0
>Reporter: Gregor Moehler
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> When you define UDTs based on hierarchical traits UDFs disregard the type 
> hierarchy:
> E.g. I have 2 UDTs based on 2 hierarchical traits. I then define 2 UDFs: The 
> first one returns the derived type, the second takes the base type. This 
> results in an error, although i believe it should be feasible:
> (...)cannot resolve 'UDF(UDF(22))' due to data type mismatch: argument 1 
> requires exampleBaseType type, however, 'UDF(22)' is of exampleFirstSubType 
> type.
> The reason is that DataType defines
> override private[sql] def acceptsType(dataType: DataType) =
> this.getClass == dataType.getClass
> However I believe it should be:
> ```override private[sql] def acceptsType(dataType: DataType) = dataType match 
> {
> case other: UserDefinedType[_] =>
>   this.getClass == other.getClass ||
> this.userClass.isAssignableFrom(other.userClass)
> case _ => false
>   }```



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org