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

Add support for BigInteger and BigDecimal types #24

Closed
akudiyar opened this issue May 15, 2022 · 0 comments · Fixed by #26
Closed

Add support for BigInteger and BigDecimal types #24

akudiyar opened this issue May 15, 2022 · 0 comments · Fixed by #26

Comments

@akudiyar
Copy link
Collaborator

akudiyar commented May 15, 2022

Currently the Tarantool Java driver (cartridge-java) supports these types, but when creating a decimal field in Tarantool it results in null values when inserting the data.

Schema in Tarantool:

test_space: 
     engine: memtx 
     is_local: false 
     temporary: false 
     sharding_key: [idreg] 
     format: 
       - {name: bucket_id          , type: unsigned    , is_nullable: false} 
       - {name: idreg              , type: decimal    , is_nullable: false} 
       - {name: regnum             , type: string      , is_nullable: true} 
     indexes: 
       - name: index_id 
         unique: true 
         type: TREE 
         parts: 
           - {path: idreg, type: decimal, is_nullable: false} 
       - name: bucket_id 
         unique: false 
         type: TREE 
         parts: 
           - {path: bucket_id, type: unsigned, is_nullable: false}

Spark SQL query:

  spark.sql("create database if not exists dl_raw") 
  spark.sql("drop table if exists DL_RAW.test_space") 
 
  spark.sql( 
    """ 
      |create table if not exists DL_RAW.test_space ( 
      |     bucket_id             integer 
      |    ,idreg                 decimal(38) 
      |    ,regnum                string 
      |  ) stored as orc""".stripMargin) 
  spark.sql( 
    """ 
      |insert into dl_raw.test_space values 
      |(1, 1085529600000, '404503014700028'), 
      |(1, 1085529600000, '404503014700028'), 
      |(1, 1087430400000, '304503016900085') 
      |""".stripMargin) 
 
 
  val ds = spark.table("dl_raw.test_space") 
 
 
  ds.show(false) 
  ds.printSchema()
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

Successfully merging a pull request may close this issue.

1 participant