carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anubhav100 <...@git.apache.org>
Subject [GitHub] incubator-carbondata issue #630: [CARBONDATA-730]added decimal type in carbo...
Date Thu, 09 Mar 2017 05:34:49 GMT
Github user anubhav100 commented on the issue:

    https://github.com/apache/incubator-carbondata/pull/630
  
    @jackylk i added a example in  CaseClassDataFrameAPIExample,i think its working correct
    
    case class Employee(name: String, salary: BigDecimal)
    
     val employee = List(Employee("anubhav", 20000))
        val employeeRDD = cc.sc.parallelize(employee)
        val employeeDataFrame = employeeRDD.toDF("name", "salary")
    
        employeeDataFrame.printSchema()
        employeeDataFrame.write
          .format("carbondata")
          .option("tableName", "carbon3")
          .option("compress", "true")
          .mode(SaveMode.Overwrite)
          .save()
    
     cc.sql("SELECT * FROM carbon2").show()
    
    here is result
    
    +-------+------+
    |   name|salary|
    +-------+------+
    |anubhav| 20000|
    +-------+------+


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message