Code Monkey home page Code Monkey logo

Comments (3)

LockGit avatar LockGit commented on June 14, 2024

find a way ,
can change SQL to below when use elasticsearch-jdbc tool index data to elasticsearch from mysql , don't change mysql table structure !

elasticsearch-jdbc-2.3.3.1/bin/mysql-xxx.sh:

"statement": "select convert(bignum,CHAR) as bignum from xxx where xxxxx";

change to string type index to es

from elasticsearch-jdbc.

jprante avatar jprante commented on June 14, 2024

The fact is that database and JDBC know about big integer, Java knows big integer, but ES does not (and Javascript/JSON is silent about this).
JDBC importer tries to convert to JSON numbers by using Java, and ES tries again to index a numeric value from the JSON number.
JDBC importer tries by default to downgrade to numeric values to retain numbers. JDBC importer uses scale and precision defaults, they can be changed, but result must fit into Java double.
If you index strings, all numeric properties are lost.

from elasticsearch-jdbc.

LockGit avatar LockGit commented on June 14, 2024

@jprante thx, if i index long type, -8629845578222121431 will change to -8629845578222121000 , but correct data is -8629845578222121431,the -8629845578222121000 is an error data. so too long type number can only change index Strings.
you have good idea ?

from elasticsearch-jdbc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.