Hi, I'm trying to run this query in the logstash jdbc but I'm facing this syntax error everytime. I tried multiple variations of single and double quotations but each time I'm getting the same error.
Query:
jdbc_streaming {
id => "jdbc_mainSKU"
jdbc_driver_library => "D:/projects/connectors/postgresql-42.7.1.jar"
jdbc_driver_class => "org.postgresql.Driver"
jdbc_connection_string => "jdbc:postgresql://192.168.1.213:5432/catalog_management"
jdbc_user => ""
jdbc_password => ""
jdbc_validation_timeout => "30"
jdbc_validate_connection => true
use_cache => false
statement => 'SELECT
id,
active,
barcode,
is_default AS "isDefault",
part_number AS "partNumber",
discount_price AS "discountPrice",
price,
quantity,
variant_id AS "variantId"
FROM
main_skus
WHERE
active = "ACTIVE" AND product_id = :product_id'
parameters => { "product_id" => "id" }
target => "mainSKU"
}
Error log:
[2024-08-07T12:05:52,653][WARN ][logstash.pluginmixins.jdbcstreaming.normalstatementhandler][product_pipeline][jdbc_mainSKU] Exception when executing JDBC query {:statement=>"SELECT\r\n id,\r\n active,\r\n barcode,\r\n is_default AS "isDefault",\r\n part_number AS "partNumber",\r\n discount_price AS "discountPrice",\r\n price,\r\n quantity,\r\n\r\n variant_id AS "variantId"\r\n FROM \r\n main_skus\r\n WHERE\r\n active = "ACTIVE" AND product_id = :product_id", :parameters=>{:product_id=>691}, :exception=>#<Sequel::DatabaseError: Java::OrgPostgresqlUtil::PSQLException: ERROR: column "ACTIVE" does not exist