You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by DEHAY Aurelien <au...@faurecia.com> on 2019/02/01 15:37:02 UTC

Json to SQL empty field

Hello.

We're trying to inject json data into impala (via jdbc connection and a DBCPConnectionPool) in Nifi 1.8.0.

Given the following json (note the empty fields event):

{
    "_msgid": "5c40a721b02db11867a3db95",
    "event": ""
}

PutDataBaseRecord or ConvertJsonToSQL+PutSQL is generating the following sql statement, and fails with
ERROR processing query/statement. Error Code: 0, SQL state: TStatus(statusCode:ERROR_STATUS, sqlState:HY000, errorMessage:AnalysisException: Char size must be > 0: 0

INSERT INTO `e_cycletime_rfid_event`
(`_msgid`,  `event`) VALUES (
CAST('5c40a721b02db11867a3db95' AS CHAR(24)),
CAST('' AS CHAR(0))
)


Is there a way to mitigate the issue, should I open a JIRA on nifi site or to Cloudera support?

Thanks.

This electronic transmission (and any attachments thereto) is intended solely for the use of the addressee(s). It may contain confidential or legally privileged information. If you are not the intended recipient of this message, you must delete it immediately and notify the sender. Any unauthorized use or disclosure of this message is strictly prohibited.  Faurecia does not guarantee the integrity of this transmission and shall therefore never be liable if the message is altered or falsified nor for any virus, interception or damage to your system.

Re: Json to SQL empty field

Posted by DEHAY Aurelien <au...@faurecia.com>.
Hello

Empty string if the field is present but empty.

I’ll have to check but it seems there is another problem with null value Jason field, set as string « null » in the database.

Thanks.

Envoyé de mon iPhone

Le 3 févr. 2019 à 22:39, Pierre Villard <pi...@gmail.com>> a écrit :

Hey,

By no mean an expert on the subject, but, just to be sure, would expect the null value to be added in the database or do you really want the empty string?

Pierre

Le ven. 1 févr. 2019 à 16:37, DEHAY Aurelien <au...@faurecia.com>> a écrit :
Hello.

We’re trying to inject json data into impala (via jdbc connection and a DBCPConnectionPool) in Nifi 1.8.0.

Given the following json (note the empty fields event):

{
    "_msgid": "5c40a721b02db11867a3db95",
    "event": ""
}

PutDataBaseRecord or ConvertJsonToSQL+PutSQL is generating the following sql statement, and fails with
ERROR processing query/statement. Error Code: 0, SQL state: TStatus(statusCode:ERROR_STATUS, sqlState:HY000, errorMessage:AnalysisException: Char size must be > 0: 0

INSERT INTO `e_cycletime_rfid_event`
(`_msgid`,  `event`) VALUES (
CAST('5c40a721b02db11867a3db95' AS CHAR(24)),
CAST('' AS CHAR(0))
)


Is there a way to mitigate the issue, should I open a JIRA on nifi site or to Cloudera support?

Thanks.

This electronic transmission (and any attachments thereto) is intended solely for the use of the addressee(s). It may contain confidential or legally privileged information. If you are not the intended recipient of this message, you must delete it immediately and notify the sender. Any unauthorized use or disclosure of this message is strictly prohibited.  Faurecia does not guarantee the integrity of this transmission and shall therefore never be liable if the message is altered or falsified nor for any virus, interception or damage to your system.

This electronic transmission (and any attachments thereto) is intended solely for the use of the addressee(s). It may contain confidential or legally privileged information. If you are not the intended recipient of this message, you must delete it immediately and notify the sender. Any unauthorized use or disclosure of this message is strictly prohibited.  Faurecia does not guarantee the integrity of this transmission and shall therefore never be liable if the message is altered or falsified nor for any virus, interception or damage to your system.

Re: Json to SQL empty field

Posted by Pierre Villard <pi...@gmail.com>.
Hey,

By no mean an expert on the subject, but, just to be sure, would expect the
null value to be added in the database or do you really want the empty
string?

Pierre

Le ven. 1 févr. 2019 à 16:37, DEHAY Aurelien <au...@faurecia.com>
a écrit :

> Hello.
>
>
>
> We’re trying to inject json data into impala (via jdbc connection and a
> DBCPConnectionPool) in Nifi 1.8.0.
>
>
>
> Given the following json (note the empty fields event):
>
>
>
> {
>
>     "_msgid": "5c40a721b02db11867a3db95",
>
>     "event": ""
>
> }
>
>
>
> PutDataBaseRecord or ConvertJsonToSQL+PutSQL is generating the following
> sql statement, and fails with
>
> ERROR processing query/statement. Error Code: 0, SQL state:
> TStatus(statusCode:ERROR_STATUS, sqlState:HY000,
> errorMessage:AnalysisException: Char size must be > 0: 0
>
>
>
> INSERT INTO `e_cycletime_rfid_event`
>
> (`_msgid`,  `event`) VALUES (
>
> CAST('5c40a721b02db11867a3db95' AS CHAR(24)),
>
> CAST('' AS CHAR(0))
>
> )
>
>
>
>
>
> Is there a way to mitigate the issue, should I open a JIRA on nifi site or
> to Cloudera support?
>
>
>
> Thanks.
>
> This electronic transmission (and any attachments thereto) is intended
> solely for the use of the addressee(s). It may contain confidential or
> legally privileged information. If you are not the intended recipient of
> this message, you must delete it immediately and notify the sender. Any
> unauthorized use or disclosure of this message is strictly prohibited.
> Faurecia does not guarantee the integrity of this transmission and shall
> therefore never be liable if the message is altered or falsified nor for
> any virus, interception or damage to your system.
>