- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How to get the ConvertJSONToSQL to work with a MySql table that has a space in the name?
- Labels:
-
Apache NiFi
Created on
‎10-24-2019
09:34 AM
- last edited on
‎10-24-2019
11:03 AM
by
VidyaSargur
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm using the ConvertJSONToSQL processor, and the MySql table has a space in the name. It appears to be the problem because when I remove the name from the table it works as expected.
I can successfully query the table from various tools and the mysql command line using back ticks "`" around the table name.
The table name:
personal information
I've tried the following:
`personal information`
"personal information"
'personal information'
\"personal information\"
[personal information]
Any suggestions?
Created ‎10-30-2019 09:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I created a hack to solve this problem.
In the ConvertJSONtoSQL processor I put table name = personal information. Notice the space. This generated the sql like so:
insert into personal information <snipped>
Then using a ReplaceTextProcessor I did a find and replace so such that the sql inserts were converted to the following:
insert into `personal information` <snipped>
This works but is very hacky...would love to see the correct way to get the back ticks to work
Created ‎10-30-2019 09:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I created a hack to solve this problem.
In the ConvertJSONtoSQL processor I put table name = personal information. Notice the space. This generated the sql like so:
insert into personal information <snipped>
Then using a ReplaceTextProcessor I did a find and replace so such that the sql inserts were converted to the following:
insert into `personal information` <snipped>
This works but is very hacky...would love to see the correct way to get the back ticks to work
