HCatalog
  1. HCatalog
  2. HCATALOG-165

HCatInputFormat.getTableSchema throws Exception rather than IOException

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: mapreduce
    • Labels:
      None

      Description

      For users, if they want the table schema for what they are reading they need to do the following:
      this.schema = HCatInputFormat.getTableSchema(context);

      For their output they do the same but for HCatOutputFormat:
      this.schema = HCatOutputFormat.getTableSchema(context);

      The HCatOutputFormat.getTableSchema throws an IOException and the HCatInputFormat.getTableSchema throws just Exception. This is caused by
      "private static InputJobInfo getJobInfo(JobContext jobContext) throws Exception" in HCatBaseInputformat

      This method should match the HCatBaseOutputFormat's version which throws the following
      throw new HCatException(ErrorType.ERROR_NOT_INITIALIZED);

        Activity

        Hide
        David Capwell added a comment -

        Since nether of these methods do IO but check state, should these methods both throw InvalidStateException instead?

        Show
        David Capwell added a comment - Since nether of these methods do IO but check state, should these methods both throw InvalidStateException instead?

          People

          • Assignee:
            Unassigned
            Reporter:
            David Capwell
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development