logstash-plugins/logstash-input-jdbc

lowercase_column_names does not seem to work

adelanoy opened this issue · 3 comments

Hi,
It seems that 'lowercase_column_names' parameters does not work in some configuration.
My SQL statement converts all name in camel case and I can clearly see that in the filter stage, all names are lowered despite having configured 'lowercase_column_names => false'. Here is an excerpt of my config file:

input{
jdbc{
jdbc_driver_library => "../sql_driver/postgresql-42.2.4.jar"
jdbc_driver_class => "org.postgresql.Driver"
jdbc_connection_string => "jdbc:postgresql://..."
statement => "select work_order_id as workOrderId from t_wo where last_update > :sql_last_value"
last_run_metadata_path => "../config/last_run"
schedule => "/5 * * * * * "
lowercase_column_names => false
}
}

At filter stage workOrderId becomes workorderid

I'm experiencing the issue too.

Same issue:
DBC query {:exception=>"Java::OrgPostgresqlUtil::PSQLException: ERROR: column \"createdby\" does not exist\n Hint: Perhaps you meant to reference the column \"candidate.createdBy\".\n Position: 12"}

I solved this problem by putting

  • "lowercase_column_names" before the statement.
  • by putting schedule to top
  • and by putting my sql command between '...' instead of "..." because we need to write: work_order_id as "workOrderId"

and it works...

input{
jdbc{
schedule => "/5 * * * * * "
jdbc_driver_library => "../sql_driver/postgresql-42.2.4.jar"
jdbc_driver_class => "org.postgresql.Driver"
jdbc_connection_string => "jdbc:postgresql://..."
lowercase_column_names => false
statement => 'select work_order_id as "workOrderId" from t_wo where last_update > :sql_last_value'
last_run_metadata_path => "../config/last_run"
}
}