You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by Alberto Bengoa <al...@propus.com.br> on 2018/01/04 20:58:46 UTC

Maximum-value Columns on QueryDatabaseTable

Hello Folks,

Not sure if I'm running on a bug, but I'm facing a situation when I try to
use a "not compliance" column name as my Maximum-value Column.

First, I've tried to use a column named _Time-Stamp (underscore at the
beginning + hyphen on the middle). This column creates a state like this:

"man_fabrica-cdc"@!@_time-stamp 2018-01-04 15:58:07.877 Cluster

I was wondering if wouldn't QueryDatabaseTable works with Timestamp fields
as Maximum-value Column. So, I've changed to another column to make a try
(column name _Change-Sequence), and got this state:

"man_fabrica-cdc"@!@_change-sequence 252254 Cluster

Enabling Nifi debug I see that no "WHERE" clause was passed when
Maximum-value Column is filled with quotes ("_my-strange-column-name"). On
the other hand, if I do not wrap the odd column name with quotes I got an
error message like this from JDBC Driver:

nifi-app_2017-12-12_11.0.log:Caused by: java.sql.SQLException:
[DataDirect][OpenEdge JDBC Driver][OpenEdge] Syntax error in SQL statement
at or about "_Time-Stamp FROM "man_fabrica-cdc" WHERE" (10713)

I'm using "Normalize Table/Column Names" as suggested here [1].

[1] -
http://apache-nifi-users-list.2361937.n4.nabble.com/Hyphenated-Tables-and-Columns-names-td3650.html#a3655

Thanks!

Alberto

Re: Maximum-value Columns on QueryDatabaseTable

Posted by Alberto Bengoa <al...@propus.com.br>.
Hello Koji,

That's nice! Thanks for your contribution! I'm looking forward to have this
patch applied to the next stable version.

I've "workarounded" it renaming the odd column within a view on the source
table.

Cheers!



--
Alberto Bengoa
Fones: +55 51 3024-3568 | +55 11 4063-8864 |+55 92 3090-0115 | +1 212
202-1454
Propus - TI alinhada a negócios
Service | Telecom | Tech | Data Science
www.propus.com.br

On Tue, Jan 23, 2018 at 5:58 AM, Koji Kawamura <ij...@gmail.com>
wrote:

> Hi Alberto,
>
> Thanks for reporting the issue, I was able to reproduce the behavior
> you described.
> Although it's for Microsoft SQL Server, there has been an existing
> JIRA for the same issue, NIFI-4393.
> https://issues.apache.org/jira/browse/NIFI-4393
>
> I've created a Pull Request to fix MS SQL square brackets and MySQL
> back-ticks as well as generic escape with double quotes.
>
> I hope the fix to be merged and available soon.
>
> Thanks,
> Koji
>
> On Fri, Jan 5, 2018 at 5:58 AM, Alberto Bengoa <al...@propus.com.br>
> wrote:
> > Hello Folks,
> >
> > Not sure if I'm running on a bug, but I'm facing a situation when I try
> to
> > use a "not compliance" column name as my Maximum-value Column.
> >
> > First, I've tried to use a column named _Time-Stamp (underscore at the
> > beginning + hyphen on the middle). This column creates a state like this:
> >
> > "man_fabrica-cdc"@!@_time-stamp 2018-01-04 15:58:07.877 Cluster
> >
> > I was wondering if wouldn't QueryDatabaseTable works with Timestamp
> fields
> > as Maximum-value Column. So, I've changed to another column to make a try
> > (column name _Change-Sequence), and got this state:
> >
> > "man_fabrica-cdc"@!@_change-sequence 252254 Cluster
> >
> > Enabling Nifi debug I see that no "WHERE" clause was passed when
> > Maximum-value Column is filled with quotes ("_my-strange-column-name").
> On
> > the other hand, if I do not wrap the odd column name with quotes I got an
> > error message like this from JDBC Driver:
> >
> > nifi-app_2017-12-12_11.0.log:Caused by: java.sql.SQLException:
> > [DataDirect][OpenEdge JDBC Driver][OpenEdge] Syntax error in SQL
> statement
> > at or about "_Time-Stamp FROM "man_fabrica-cdc" WHERE" (10713)
> >
> > I'm using "Normalize Table/Column Names" as suggested here [1].
> >
> > [1] -
> > http://apache-nifi-users-list.2361937.n4.nabble.com/
> Hyphenated-Tables-and-Columns-names-td3650.html#a3655
> >
> > Thanks!
> >
> > Alberto
>

Re: Maximum-value Columns on QueryDatabaseTable

Posted by Koji Kawamura <ij...@gmail.com>.
Hi Alberto,

Thanks for reporting the issue, I was able to reproduce the behavior
you described.
Although it's for Microsoft SQL Server, there has been an existing
JIRA for the same issue, NIFI-4393.
https://issues.apache.org/jira/browse/NIFI-4393

I've created a Pull Request to fix MS SQL square brackets and MySQL
back-ticks as well as generic escape with double quotes.

I hope the fix to be merged and available soon.

Thanks,
Koji

On Fri, Jan 5, 2018 at 5:58 AM, Alberto Bengoa <al...@propus.com.br> wrote:
> Hello Folks,
>
> Not sure if I'm running on a bug, but I'm facing a situation when I try to
> use a "not compliance" column name as my Maximum-value Column.
>
> First, I've tried to use a column named _Time-Stamp (underscore at the
> beginning + hyphen on the middle). This column creates a state like this:
>
> "man_fabrica-cdc"@!@_time-stamp 2018-01-04 15:58:07.877 Cluster
>
> I was wondering if wouldn't QueryDatabaseTable works with Timestamp fields
> as Maximum-value Column. So, I've changed to another column to make a try
> (column name _Change-Sequence), and got this state:
>
> "man_fabrica-cdc"@!@_change-sequence 252254 Cluster
>
> Enabling Nifi debug I see that no "WHERE" clause was passed when
> Maximum-value Column is filled with quotes ("_my-strange-column-name"). On
> the other hand, if I do not wrap the odd column name with quotes I got an
> error message like this from JDBC Driver:
>
> nifi-app_2017-12-12_11.0.log:Caused by: java.sql.SQLException:
> [DataDirect][OpenEdge JDBC Driver][OpenEdge] Syntax error in SQL statement
> at or about "_Time-Stamp FROM "man_fabrica-cdc" WHERE" (10713)
>
> I'm using "Normalize Table/Column Names" as suggested here [1].
>
> [1] -
> http://apache-nifi-users-list.2361937.n4.nabble.com/Hyphenated-Tables-and-Columns-names-td3650.html#a3655
>
> Thanks!
>
> Alberto