Index: ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java (revision 1459158) +++ ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java (working copy) @@ -110,10 +110,10 @@ import org.apache.hadoop.hive.ql.plan.AddPartitionDesc; import org.apache.hadoop.hive.ql.plan.AlterDatabaseDesc; import org.apache.hadoop.hive.ql.plan.AlterIndexDesc; +import org.apache.hadoop.hive.ql.plan.AlterTableAlterPartDesc; import org.apache.hadoop.hive.ql.plan.AlterTableDesc; import org.apache.hadoop.hive.ql.plan.AlterTableDesc.AlterTableTypes; import org.apache.hadoop.hive.ql.plan.AlterTableSimpleDesc; -import org.apache.hadoop.hive.ql.plan.AlterTableAlterPartDesc; import org.apache.hadoop.hive.ql.plan.CreateDatabaseDesc; import org.apache.hadoop.hive.ql.plan.CreateIndexDesc; import org.apache.hadoop.hive.ql.plan.CreateTableDesc; @@ -1941,8 +1941,8 @@ outStream = fs.create(resFile); if (tbl.isView()) { - String createTab_stmt = "CREATE VIEW " + tableName + " AS " + tbl.getViewExpandedText(); - outStream.writeBytes(createTab_stmt.toString()); + String createTab_stmt = "CREATE VIEW " + tableName + " AS " + tbl.getViewExpandedText() + ";"; + outStream.write(createTab_stmt.getBytes("UTF-8")); ((FSDataOutputStream) outStream).close(); outStream = null; return 0; @@ -2123,8 +2123,8 @@ createTab_stmt.setAttribute(ROW_FORMAT, tbl_row_format); createTab_stmt.setAttribute(TBL_LOCATION, tbl_location); createTab_stmt.setAttribute(TBL_PROPERTIES, tbl_properties); - - outStream.writeBytes(createTab_stmt.toString()); + String createTable_stmt = createTab_stmt.toString() + ";"; + outStream.write(createTable_stmt.getBytes("UTF-8")); ((FSDataOutputStream) outStream).close(); outStream = null; } catch (FileNotFoundException e) {