You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by Parth Chandra <pc...@maprtech.com> on 2015/06/24 01:44:09 UTC

Review Request 35808: DRILL-2862: Convert_to/Convert_From throw assertion when an incorrect encoding type is specified

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35808/
-----------------------------------------------------------

Review request for drill, Jinfeng Ni and Sudheesh Katkam.


Repository: drill-git


Description
-------

DRILL-2862: Convert_to/Convert_From throw assertion when an incorrect encoding type is specified or if the encoding type is not a string literal.

Instead of an assertion when user input is wrong, we now throw an exception with the appropriate error message. 
For the case where the user types in a type name incorrectly, the error message also provides a helpful suggestion. The suggested name is selected from the list of available functions.

For example: 

  select convert_from(foo, 'UTF') from dfs.`/table_foo`

will print the following error:

  Error: UNSUPPORTED_OPERATION ERROR: CONVERT_FROM does not support conversion from type 'UTF'.
  Did you mean UTF8?
  [Error Id: 87ed2941-f9c2-4c35-8ff2-a3f21eae1104 on localhost:31010] (state=,code=0)


Diffs
-----

  exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/PreProcessLogicalRel.java 0f8e45afd88fd2c4f82df87a8216f4505bfa03fe 
  exec/java-exec/src/main/java/org/apache/drill/exec/util/ApproximateStringMatcher.java PRE-CREATION 

Diff: https://reviews.apache.org/r/35808/diff/


Testing
-------

All regression tests


Thanks,

Parth Chandra


Re: Review Request 35808: DRILL-2862: Convert_to/Convert_From throw assertion when an incorrect encoding type is specified

Posted by Parth Chandra <pc...@maprtech.com>.

> On June 24, 2015, 12:15 a.m., Venki Korukanti wrote:
> > How about the case where the function is not found for the specific input col type and the encoding is correct? (https://issues.apache.org/jira/browse/DRILL-2648)?

If the matching function for the input col type is not found we catch the error. However, the case in DRILL-2648 is different because we find a convert(to/from) implementation that takes no type parameter. These are dummy convert methods and we assert because the number of arguments does not match. Updated patch fixes that.


- Parth


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35808/#review89103
-----------------------------------------------------------


On June 23, 2015, 11:44 p.m., Parth Chandra wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/35808/
> -----------------------------------------------------------
> 
> (Updated June 23, 2015, 11:44 p.m.)
> 
> 
> Review request for drill, Jinfeng Ni and Sudheesh Katkam.
> 
> 
> Repository: drill-git
> 
> 
> Description
> -------
> 
> DRILL-2862: Convert_to/Convert_From throw assertion when an incorrect encoding type is specified or if the encoding type is not a string literal.
> 
> Instead of an assertion when user input is wrong, we now throw an exception with the appropriate error message. 
> For the case where the user types in a type name incorrectly, the error message also provides a helpful suggestion. The suggested name is selected from the list of available functions.
> 
> For example: 
> 
>   select convert_from(foo, 'UTF') from dfs.`/table_foo`
> 
> will print the following error:
> 
>   Error: UNSUPPORTED_OPERATION ERROR: CONVERT_FROM does not support conversion from type 'UTF'.
>   Did you mean UTF8?
>   [Error Id: 87ed2941-f9c2-4c35-8ff2-a3f21eae1104 on localhost:31010] (state=,code=0)
> 
> 
> Diffs
> -----
> 
>   exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/PreProcessLogicalRel.java 0f8e45afd88fd2c4f82df87a8216f4505bfa03fe 
>   exec/java-exec/src/main/java/org/apache/drill/exec/util/ApproximateStringMatcher.java PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/35808/diff/
> 
> 
> Testing
> -------
> 
> All regression tests
> 
> 
> Thanks,
> 
> Parth Chandra
> 
>


Re: Review Request 35808: DRILL-2862: Convert_to/Convert_From throw assertion when an incorrect encoding type is specified

Posted by Venki Korukanti <ve...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35808/#review89103
-----------------------------------------------------------


How about the case where the function is not found for the specific input col type and the encoding is correct? (https://issues.apache.org/jira/browse/DRILL-2648)?

- Venki Korukanti


On June 23, 2015, 4:44 p.m., Parth Chandra wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/35808/
> -----------------------------------------------------------
> 
> (Updated June 23, 2015, 4:44 p.m.)
> 
> 
> Review request for drill, Jinfeng Ni and Sudheesh Katkam.
> 
> 
> Repository: drill-git
> 
> 
> Description
> -------
> 
> DRILL-2862: Convert_to/Convert_From throw assertion when an incorrect encoding type is specified or if the encoding type is not a string literal.
> 
> Instead of an assertion when user input is wrong, we now throw an exception with the appropriate error message. 
> For the case where the user types in a type name incorrectly, the error message also provides a helpful suggestion. The suggested name is selected from the list of available functions.
> 
> For example: 
> 
>   select convert_from(foo, 'UTF') from dfs.`/table_foo`
> 
> will print the following error:
> 
>   Error: UNSUPPORTED_OPERATION ERROR: CONVERT_FROM does not support conversion from type 'UTF'.
>   Did you mean UTF8?
>   [Error Id: 87ed2941-f9c2-4c35-8ff2-a3f21eae1104 on localhost:31010] (state=,code=0)
> 
> 
> Diffs
> -----
> 
>   exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/PreProcessLogicalRel.java 0f8e45afd88fd2c4f82df87a8216f4505bfa03fe 
>   exec/java-exec/src/main/java/org/apache/drill/exec/util/ApproximateStringMatcher.java PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/35808/diff/
> 
> 
> Testing
> -------
> 
> All regression tests
> 
> 
> Thanks,
> 
> Parth Chandra
> 
>


Re: Review Request 35808: DRILL-2862: Convert_to/Convert_From throw assertion when an incorrect encoding type is specified

Posted by Parth Chandra <pc...@maprtech.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35808/
-----------------------------------------------------------

(Updated June 24, 2015, 4:53 p.m.)


Review request for drill, Jinfeng Ni and Sudheesh Katkam.


Changes
-------

Added check for DRILL-2648 case. 
Rebased on master.


Repository: drill-git


Description
-------

DRILL-2862: Convert_to/Convert_From throw assertion when an incorrect encoding type is specified or if the encoding type is not a string literal.

Instead of an assertion when user input is wrong, we now throw an exception with the appropriate error message. 
For the case where the user types in a type name incorrectly, the error message also provides a helpful suggestion. The suggested name is selected from the list of available functions.

For example: 

  select convert_from(foo, 'UTF') from dfs.`/table_foo`

will print the following error:

  Error: UNSUPPORTED_OPERATION ERROR: CONVERT_FROM does not support conversion from type 'UTF'.
  Did you mean UTF8?
  [Error Id: 87ed2941-f9c2-4c35-8ff2-a3f21eae1104 on localhost:31010] (state=,code=0)


Diffs (updated)
-----

  exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/PreProcessLogicalRel.java 0f8e45a 
  exec/java-exec/src/main/java/org/apache/drill/exec/util/ApproximateStringMatcher.java PRE-CREATION 

Diff: https://reviews.apache.org/r/35808/diff/


Testing
-------

All regression tests


Thanks,

Parth Chandra