Uploaded image for project: 'CarbonData'
  1. CarbonData
  2. CARBONDATA-1023

Able to do load from dataframe with byte data type in carbon table

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 1.0.0-incubating
    • 1.1.0
    • sql
    • None
    • spark common

    Description

      i am able to load data with bytetype from dataframe in a carbon table
      as far as documentation says byte type is not supported

      val rdd1 = sqlContext.sparkContext.parallelize(
      Row("byte",1234.toByte) :: Nil)

      val schema1 = StructType(
      StructField("string",StringType, nullable = false) ::
      StructField("byte",ByteType, nullable = false) :: Nil)

      val dataFrame = sqlContext.createDataFrame(rdd1, schema1)

      dataFrame.write
      .format("carbondata")
      .option("tableName", "carbon1")
      .option("compress", "true")
      .mode(SaveMode.Overwrite)
      .save()

      sql("select * from carbon1").show()

      --------+

      string byte

      --------+

      byte -46

      --------+

      if we try to create a table with byte type it shows error

      sql(
      "CREATE TABLE restructure (empno byte, empname String, designation String, doj Timestamp, " +
      "workgroupcategory int, workgroupcategoryname String, deptno int, deptname String, " +
      "projectcode int, projectjoindate Timestamp, projectenddate Timestamp,attendance int," +
      "utilization int,salary int) STORED BY 'org.apache.carbondata.format'")

      result

      org.apache.carbondata.spark.exception.MalformedCarbonCommandException: Unsupported data type: StructField(empno,ByteType,true).getType

      Attachments

        Activity

          People

            anubhavtarar anubhav tarar
            anubhavtarar anubhav tarar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 40m
                40m