Uploaded image for project: 'Hadoop Map/Reduce'
  1. Hadoop Map/Reduce
  2. MAPREDUCE-3695

Error:ORA 00911 invalid character(the result of mapreduce insert into oracle)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.0.0-alpha
    • None
    • mrv2

    Description

      Exception occurred when the result of mapreduce insert into oracle except mysql.

      [org.apache.hadoop.mapred.Child.main(Child.java:234)] Exception running child : java.io.IOException: ORA-00911: invalid character at org.apache.hadoop.mapreduce.lib.db.DBOutputFormat$DBRecordWriter.close(DBOutputFormat.java:103) at org.apache.hadoop.mapred.ReduceTask.runNewReducer(ReduceTask.java:545) at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:385) at org.apache.hadoop.mapred.Child$4.run(Child.java:217) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:396) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:742) at org.apache.hadoop.mapred.Child.main(Child.java:211) 2012-01-19 15:41:22 [INFO][main][org.apache.hadoop.mapred.Task]-[org.apache.hadoop.mapred.Task.taskCleanup(Task.java:996)] Runnning cleanup for the task

      The exception in the 161 line of the DBOutputFormat.java,modify as follows and exception fixed.
      the reason is more than a semicolon.

      public String constructQuery(String table, String[] fieldNames) {
      if(fieldNames == null)

      { throw new IllegalArgumentException("Field names may not be null"); }

      StringBuilder query = new StringBuilder();
      query.append("INSERT INTO ").append(table);

      if (fieldNames.length > 0 && fieldNames[0] != null) {
      query.append(" (");
      for (int i = 0; i < fieldNames.length; i++) {
      query.append(fieldNames[i]);
      if (i != fieldNames.length - 1)

      { query.append(","); }

      }
      query.append(")");
      }
      query.append(" VALUES (");

      for (int i = 0; i < fieldNames.length; i++) {
      query.append("?");
      if(i != fieldNames.length - 1)

      { query.append(","); }

      }
      query.append(");");

      return query.toString();
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            mapserver000 杨果
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: