Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-360

Generalize the FileFormat Interface in Hive

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.4.0
    • 0.4.0
    • None
    • None
    • Reviewed
    • HIVE-360. Generalize the FileFormat Interface in Hive. (He Yongqiang via zshao)

    Description

      Currently the FileFormat support in Hive is not generalized - we do "if ... else" to support TextFileFormat and SequenceFileFormat. There is no way to support a 3rd one without changing the "if...else" structure. We should make an interface for the FileFormat need for Hive.

      The OutputFileFormat interface that Hive requires will contain one more method than the Hadoop OutputFileFormat - create a File with a specific name.

      Hive.g:409 (Hive.g already supports the custom file format but DDLSemanticAnalyzer.java is not recognizing it yet

      KW_STORED KW_AS KW_INPUTFORMAT inFmt=StringLiteral KW_OUTPUTFORMAT outFmt=StringLiteral
      

      Please add the handling of TOK_TABLEFILEFORMAT here:
      DDLSemanticAnalyzer.java:223

              case HiveParser.TOK_TBLSEQUENCEFILE:
              ...
      

      Please add the handling of custom outputFormat here by adding a new interface (and cast the user-provided file format to that interface), instead of doing "if ... else"
      FileSinkOperator.java:129-174:

            if(outputFormat instanceof IgnoreKeyTextOutputFormat) {
              finalPath = new Path(Utilities.toTempPath(conf.getDirName()), Utilities.getTaskId(hconf) +
                                   Utilities.getFileExtension(jc, isCompressed));
            ...
      

      Attachments

        1. qfile.tar
          1 kB
          He Yongqiang
        2. hive-360-2009-04-09-3.patch
          577 kB
          He Yongqiang
        3. hive-360-2009-04-09.patch
          580 kB
          He Yongqiang
        4. hive-360-2009-04-08-3.patch
          39 kB
          He Yongqiang
        5. hive-360-2009-04-08.patch
          38 kB
          He Yongqiang
        6. hive-360-2009-04-07-5.patch
          29 kB
          He Yongqiang
        7. hive-360-2009-04-04-4.patch
          21 kB
          He Yongqiang
        8. hive-360-2009-04-01.patch
          20 kB
          He Yongqiang
        9. hive-360-2009-03-31.patch
          13 kB
          He Yongqiang
        10. HIVE-360.patch
          575 kB
          Zheng Shao

        Issue Links

          Activity

            People

              he yongqiang He Yongqiang
              zshao Zheng Shao
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: