Skip to content
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

"Failed to create transformator" when NULL literal is used with local UNION ALL #124

Open
exaSR opened this issue Nov 8, 2024 · 1 comment
Labels
bug Unwanted / harmful behavior

Comments

@exaSR
Copy link

exaSR commented Nov 8, 2024

(Sorry if any inconsistencies show up, but I have to put this down from memory)

Background

  • Exasol as remote database, not LOCAL.
  • EXA2EXA transfer mode (JDBC seems to work, so it is not directly a problem for all java-jdbc dialects)

Query

(simplified for reproduction)

select null as X from VIRTUAL_TABLE
UNION ALL
select 1 from dual;

Pushdown

IMPORT INTO ( X decimal(1) ) FROM EXA AT ...
STATEMENT 'select null as x from VIRTUAL_TABLE'

Problem

  • remote Exasol will use boolean as smallest possible type for a null literal without context
  • ExaLoader refuses to import a boolean type into a decimal type:
[Code: 0, SQL State: 42636]  ETL-1299: Failed to create transformator for column=0 (starting from 0 for selected columns) 
[ETL-1202: Not implemented - Transformation for this combination of column types is not possible in this version.
A solution for this problem can be perhaps the conversion in another datatype in the database.
Otherwise please contact support for additional information]

Workaround

Exclude the LITERAL_NULL capability for the virtual schema

Solution (?)

As the pushdown query clearly expects a certain data type here, it should be possible to cast the null value properly:

STATEMENT `select cast(null as decimal(1)) as X ...`

Caveat

This can only apply to null values that are direct literals in the select list...filters, subselects etc. can not be handled (filters with null work differently anyway, subselects are not implemented.)

@exaSR
Copy link
Author

exaSR commented Nov 8, 2024

Marking Source as "Customer", because it showed up during a live migration project, the Customer found the issue and its workaround (and is content using that). But having an intrinsic fix sounds like a good idea...

@kaklakariada kaklakariada added the bug Unwanted / harmful behavior label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unwanted / harmful behavior
Projects
None yet
Development

No branches or pull requests

2 participants