-
Notifications
You must be signed in to change notification settings - Fork 1.2k
C# to Java type mapping #1643
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
Comments
@niemyjski thanks for reporting this. I'm looking at this in the 2.0 branch, with the following C# to Elasticsearch data type mappings:
/cc @gmarz @Mpdreamz, I think we should consider also handling Within the 2.0 branch, you can use the |
This fixes discrepancies between how C# types compare to Java types as documented in https://msdn.microsoft.com/en-us/library/ms228360(v=vs.90).aspx and https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html. Fixes issue #1643 Add additional unit tests for inferred types
…alker This fixes discrepancies between how C# types compare to Java types as documented in https://msdn.microsoft.com/en-us/library/ms228360(v=vs.90).aspx and https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html. Fixes issue #1643 Add additional unit tests for inferred types
Closing this as we are doing the correct thing in 2.0 (unless i'm going crosseyed @niemyjski @russcam please reopen!) |
@Mpdreamz We adhere to the above mappings in 2.0 (and also have been backported to the next release of 1.x). The only remaining consideration is handling |
@russcam was this back ported to 1.8? |
@niemyjski yes, it went into 1.7.2 in aa8c993 |
I have a dictionary that I do dynamic mapping on in our app. I append a type suffix to the field name so I can share mappings (multi tenant). Currently I'm only handling decimal and double mappings in .net and this leads to some insert errors when I detect it incorrectly (obviously a bug on our part).. I think the solutions for us going forward is to have a typed field mapping based on the suffix that maps to the largest numeric type (sucks because you use more memory) or parse out the specific type (and use more processing time).
I wanted to look through your code to see if I could find a method where I could pass a type/instance or string (do a parse of the type for me) and return the name it would be mapped to (E.G.,
number
). I came across this and this in master. To my knowledge, correct me if I'm wrong.. seem to incorrectly handle some data types incorrectly or not at all. For example it doesn't seem like some data types are handled likeDateTimeOffset
and possibly some numeric types. Secondly the java types as defined here don't match up with your .NET data type mappings. Example:Java
byte
is -128 to 127 which is the same as a .NET SByte. In the code I saw you had it mapped to a .NETByte
as well which is 0-255. Which I believe the methods would return the incorrect mapping if the value is >127.Would it be possible to expose some helper methods that make it easier to get the mapped types as well as update these mappings?
The text was updated successfully, but these errors were encountered: