Skip to content

HANA DB: SHORTTEXT casting not supported anymore? #1027

@lschneiderbauer

Description

@lschneiderbauer

I updated the Hana driver recently, and I noticed that some previously working dbplyr queries are failing now.

In particular, a data type conversion using as.character seems to be failing with the SQL error message

Error in `collect()`:
! Failed to collect lazy table.
Caused by error in `new_result()`:
! nanodbc/nanodbc.cpp:1412: 42000: [SAP AG][LIBODBCHDB DLL][HDBODBC] Syntax error or access violation;257 sql syntax error: incorrect syntax near "SHORTTEXT": line 1 col 27 (at pos 27) 

An explicit example which returns that error:

some_lazy_table %>% select(some_number) %>% mutate(some_text = as.character(some_number))

which generates the SQL

SELECT "some_number", CAST("some_number" AS SHORTTEXT) AS "some_text"
FROM "MYSCHEMA"."some_lazy_table"

When looking up the specs for CAST, SHORTTEXT is also not mentioned as allowed data type, so I wonder if it was ever supported in the first place.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorfunc trans 🌍Translation of individual functions to SQL

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions