-
Notifications
You must be signed in to change notification settings - Fork 6
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
No type information is used to map SQL types to JSON types #73
Comments
@bserdar Could you give some more specific technical details of the change? Like the some snippets of the change and which places it would be applied, etc. @derek63 @bserdar I'm going to take this issue but the milestone and label is not set , so it is in the backlog. May I take it anyway. Burak, don't you think it would be easier if you take this issue? |
I am not that familiar with the rdbms code. I'll take a look, determine On Wed, Jan 28, 2015 at 10:53 AM, luan-cestari [email protected]
|
I've been looking at the code of DynVar and how it is used. It looks like in RDBMSProcessor.convertProjection(), DynVar keys are used as JSON document field names. However, as far as I can see, DynVar.keys are populated using table column names/aliases (VariableUpdateRowMapper). It looks like this builds a JSON document containing SQL table column names, not field names. It is during this DynVar setup that I believe the mapping between metadata field and SQL columns are lost. Or, am I missing something? |
Weird, I made comment yesterday here, I think I forgot to click on the comment button, sorry for that @bserdar . I think you described correct, I would just make an addendum which is the use of DynVar. It was using InOut list before, which is basically the projection fields. The change that resulted in the misused of DynVar occurred when I fixed the projections using ' * ', and I forgot that the DynVar doesn't have the documents names, but the DB names instead. The solution would not be just switching back to InOut list but enhanced it to get the projected paths (even using features like '*') and for this issue (#73) it would probably need some more information from metadata, IMHO. What do you think? Do you want me to take this issue? |
Yes, please, you're more familiar with the code. The basic idea is to use On Fri, Jan 30, 2015 at 11:31 AM, luan-cestari [email protected]
|
@bserdar could you give me some high level ideas of the conversions that I need to do? By now I can think on the method where now DynVar is used to get the names of fields/columns, which would map a sql.Type to JsonNode. |
You need to maintain a mapping between SQL columns and metadata fields. jsonDoc.modify(fieldName,field.type().toJson(),true) should do that. You have to be careful when inserting array elements. The field name should x.y..z There can be multiple indexes if the array is multi-level. you can choose On Fri, Jan 30, 2015 at 12:43 PM, luan-cestari [email protected]
|
The Json doc output fields are String, regardless of field type in metadata. The type subsystem must be used to convert database values to Json values in queries, and Json values to database values in insert/update statements. Same goes for bindings: metadata type of fields must be used to convert Json values to/from Java values.
The text was updated successfully, but these errors were encountered: