Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to retrieve sample if remote data base has spaces in the column name #61

Open
HannaTrotsenko opened this issue Dec 30, 2020 · 0 comments

Comments

@HannaTrotsenko
Copy link

STR:

  1. Create the table in remote DB with spaces in the column name, e.g.
CREATE TABLE Employee  
(  
"EmployeeID" int,  
"First Name" varchar(255),  
"Last Name" varchar(255),  
"Email" varchar(255),  
"AddressLine" varchar(255),  
"City" varchar(255)  
)
  1. Use JDBC Insert action
  2. Choose new-created table and fill all metadata fields
    image
  3. Retrieve sample

AR:
Failed to retrieve sample

About to process message...
Message processed, going to emit
INFO  i.e.s.i.ApiClientImpl T: - Retrieving step data for user task-5feb514c5d543e0011a45fa5 at: https://api-popeye.elastic.io/v1/tasks/5feb514c5d543e0011a45fa5/steps/step_2
INFO  i.e.s.i.HttpUtils T: - Sending GET request to https://api-popeye.elastic.io/v1/tasks/5feb514c5d543e0011a45fa5/steps/step_2
INFO  i.e.s.i.HttpUtils T: - Got 200 response
INFO  i.e.s.i.HttpUtils T: - Successfully consumed response entity
INFO  i.e.s.ComponentDescriptorResolver T: - Component descriptor from classpath: /component.json
INFO  i.e.s.Sailor T: - Connecting to AMQP
java.lang.RuntimeException: org.postgresql.util.PSQLException: ERROR: syntax error at or near "Name"
  Position: 40
	at io.elastic.jdbc.actions.InsertAction.execute(InsertAction.java:52)
	at io.elastic.sailor.impl.MessageProcessorImpl.processMessage(MessageProcessorImpl.java:68)
	at io.elastic.sailor.impl.MessageConsumer.handleDelivery(MessageConsumer.java:68)
	at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
	at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near "Name"
  Position: 40
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308)
	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
	at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:150)
	at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:139)
	at io.elastic.jdbc.query_builders.PostgreSQL.executeInsert(PostgreSQL.java:96)
	at io.elastic.jdbc.actions.InsertAction.execute(InsertAction.java:42)
	... 7 more
INFO  i.e.s.i.AmqpServiceImpl T: - Connected to AMQP
INFO  i.e.s.i.AmqpServiceImpl T: - Opened publish channel
INFO  i.e.s.i.AmqpServiceImpl T: - Opened subscribe channel
INFO  i.e.s.Sailor T: - Processing flow step: step_2
INFO  i.e.s.Sailor T: - Component id to be executed: 55ffca6ecc04c20600000001
INFO  i.e.s.i.ModuleBuilderImpl T: - Module Java class to be instantiated: io.elastic.jdbc.actions.InsertAction
INFO  i.e.s.Sailor T: - Module to be executed: insert
INFO  i.e.s.i.ModuleBuilderImpl T: - Instantiating component io.elastic.jdbc.actions.InsertAction
INFO  i.e.s.Sailor T: - Initializing module for execution
INFO  i.e.s.Sailor T: - Subscribing to queues
INFO  i.e.s.i.AmqpServiceImpl T: - Subscribed consumer amq.ctag-JxZvcjyDO9O7SruEQRcDyA. Waiting for messages to arrive ...
INFO  i.e.s.Sailor T: - Sailor started
INFO  i.e.s.i.MessageConsumer T:fc806931-ffe2-45cf-816f-38f5316b04da - Consumer amq.ctag-JxZvcjyDO9O7SruEQRcDyA received message: deliveryTag=1, messageId=fb18098d-57c8-4c70-827a-4fbbc5923529, parentMessageId=51c303c7-50fa-4641-84a1-72079f324075, traceId=fc806931-ffe2-45cf-816f-38f5316b04da
INFO  i.e.s.i.CryptoServiceImpl T:fc806931-ffe2-45cf-816f-38f5316b04da - Parsing message JSON
INFO  i.e.j.a.InsertAction T:fc806931-ffe2-45cf-816f-38f5316b04da - Starting execute insert action
INFO  i.e.j.a.InsertAction T:fc806931-ffe2-45cf-816f-38f5316b04da - Found dbEngine: 'postgresql' and tableName: 'employee'
INFO  i.e.j.u.Utils T:fc806931-ffe2-45cf-816f-38f5316b04da - Connecting to jdbc:postgresql://dumbo.db.elephantsql.com:5432/xhsjlzzh
INFO  i.e.j.u.Utils T:fc806931-ffe2-45cf-816f-38f5316b04da - Got properties: {}
INFO  i.e.j.a.InsertAction T:fc806931-ffe2-45cf-816f-38f5316b04da - Detected column types: {last name=string, first name=string, city=string, addressline=string, employeeid=number, email=string}
INFO  i.e.j.a.InsertAction T:fc806931-ffe2-45cf-816f-38f5316b04da - Inserting in table 'employee' values '{"EmployeeID":1,"First Name":"John","Last Name":"Doe","Email":"foo@bar.com","AddressLine":"some street","City":"LA"}'
at io.elastic.sailor.impl.MessageConsumer.handleDelivery(MessageConsumer.java:68)
at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
Position: 40
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440)
at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:139)
... 7 common frames omitted
java.lang.RuntimeException: org.postgresql.util.PSQLException: ERROR: syntax error at or near "Name"
at io.elastic.jdbc.actions.InsertAction.execute(InsertAction.java:52)
at io.elastic.sailor.impl.MessageProcessorImpl.processMessage(MessageProcessorImpl.java:68)
at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.lang.Thread.run(Thread.java:748)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
at io.elastic.jdbc.query_builders.PostgreSQL.executeInsert(PostgreSQL.java:96)
ERROR i.e.s.i.MessageProcessorImpl T:fc806931-ffe2-45cf-816f-38f5316b04da - Component execution failed
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:150)
Position: 40
Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near "Name"
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308)
at io.elastic.jdbc.actions.InsertAction.execute(InsertAction.java:42)
INFO  i.e.s.i.AmqpServiceImpl T:fc806931-ffe2-45cf-816f-38f5316b04da - Pushing to exchange=59d341e9037f7200184a408b_org, routingKey=59d341e9037f7200184a408b.5feb514c5d543e0011a45fa5/debug.step_2.error_debug
INFO  i.e.s.i.AmqpServiceImpl T:fc806931-ffe2-45cf-816f-38f5316b04da - Message headers: {compId=55ffca6ecc04c20600000001, function=insert, stepId=step_2, start=1609257317647, parentMessageId=fb18098d-57c8-4c70-827a-4fbbc5923529, x-eio-meta-trace-id=fc806931-ffe2-45cf-816f-38f5316b04da, messageId=5c114d99-36fc-440a-b7ea-3e5f77f1a19d, userId=59d22e7eeb865b0018adc248, taskId=5feb514c5d543e0011a45fa5, execId=0484c08fe60b4a7ba0154d1f4ddd7b05}
INFO  i.e.s.i.AmqpServiceImpl T:fc806931-ffe2-45cf-816f-38f5316b04da - Successfully published data to 59d341e9037f7200184a408b_org
INFO  i.e.s.i.MessageConsumer T: - Execution stats: ExecutionStats{dataCount=0, errorCount=1, reboundCount=0}
INFO  i.e.s.i.MessageConsumer T: - Reject received messages 1

ER: Sample successfully retrieved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant