您的位置:首页 > 编程语言

带你底层看Sqoop如何转换成MapReduce作业运行的(代码程序)

2017-03-18 20:31 417 查看
补充

  其实啊,我们知道,sqoop在运行的时候,最终会去转换成mapreduce作业,这个很简单,不多赘述。直接贴出来。



  

  具体这些怎么运行的,见我如下这篇博客。这里只做一个引子。

Sqoop Import HDFS 和 Sqoop Export HDFS(五)

  因为,我一般是在/usr/local/sqoop/sqoopRunCreate目录下,运行对Soop Import HDFS/Hive/HBase 和 Soop Export HDFS/Hive/HBase。

[hadoop@djt002 sqoopRunCreate]$ pwd
/usr/local/sqoop/sqoopRunCreate
[hadoop@djt002 sqoopRunCreate]$ ls
djt_user_copy.java  djt_user.java  QueryResult.java
[hadoop@djt002 sqoopRunCreate]$ cat djt_user_copy.java
// ORM class for table 'djt_user_copy'
// WARNING: This class is AUTO-GENERATED. Modify at your own risk.
//
// Debug information:
// Generated date: Sat Mar 18 19:21:03 CST 2017
// For connector: org.apache.sqoop.manager.MySQLManager
import org.apache.hadoop.io.BytesWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.Writable;
import org.apache.hadoop.mapred.lib.db.DBWritable;
import com.cloudera.sqoop.lib.JdbcWritableBridge;
import com.cloudera.sqoop.lib.DelimiterSet;
import com.cloudera.sqoop.lib.FieldFormatter;
import com.cloudera.sqoop.lib.RecordParser;
import com.cloudera.sqoop.lib.BooleanParser;
import com.cloudera.sqoop.lib.BlobRef;
import com.cloudera.sqoop.lib.ClobRef;
import com.cloudera.sqoop.lib.LargeObjectLoader;
import com.cloudera.sqoop.lib.SqoopRecord;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

public class djt_user_copy extends SqoopRecord  implements DBWritable, Writable {
private final int PROTOCOL_VERSION = 3;
public int getClassFormatVersion() { return PROTOCOL_VERSION; }
protected ResultSet __cur_result_set;
private Integer id;
public Integer get_id() {
return id;
}
public void set_id(Integer id) {
this.id = id;
}
public djt_user_copy with_id(Integer id) {
this.id = id;
return this;
}
private String name;
public String get_name() {
return name;
}
public void set_name(String name) {
this.name = name;
}
public djt_user_copy with_name(String name) {
this.name = name;
return this;
}
private String sex;
public String get_sex() {
return sex;
}
public void set_sex(String sex) {
this.sex = sex;
}
public djt_user_copy with_sex(String sex) {
this.sex = sex;
return this;
}
private Integer age;
public Integer get_age() {
return age;
}
public void set_age(Integer age) {
this.age = age;
}
public djt_user_copy with_age(Integer age) {
this.age = age;
return this;
}
private String profile;
public String get_profile() {
return profile;
}
public void set_profile(String profile) {
this.profile = profile;
}
public djt_user_copy with_profile(String profile) {
this.profile = profile;
return this;
}
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof djt_user_copy)) {
return false;
}
djt_user_copy that = (djt_user_copy) o;
boolean equal = true;
equal = equal && (this.id == null ? that.id == null : this.id.equals(that.id));
equal = equal && (this.name == null ? that.name == null : this.name.equals(that.name));
equal = equal && (this.sex == null ? that.sex == null : this.sex.equals(that.sex));
equal = equal && (this.age == null ? that.age == null : this.age.equals(that.age));
equal = equal && (this.profile == null ? that.profile == null : this.profile.equals(that.profile));
return equal;
}
public boolean equals0(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof djt_user_copy)) {
return false;
}
djt_user_copy that = (djt_user_copy) o;
boolean equal = true;
equal = equal && (this.id == null ? that.id == null : this.id.equals(that.id));
equal = equal && (this.name == null ? that.name == null : this.name.equals(that.name));
equal = equal && (this.sex == null ? that.sex == null : this.sex.equals(that.sex));
equal = equal && (this.age == null ? that.age == null : this.age.equals(that.age));
equal = equal && (this.profile == null ? that.profile == null : this.profile.equals(that.profile));
return equal;
}
public void readFields(ResultSet __dbResults) throws SQLException {
this.__cur_result_set = __dbResults;
this.id = JdbcWritableBridge.readInteger(1, __dbResults);
this.name = JdbcWritableBridge.readString(2, __dbResults);
this.sex = JdbcWritableBridge.readString(3, __dbResults);
this.age = JdbcWritableBridge.readInteger(4, __dbResults);
this.profile = JdbcWritableBridge.readString(5, __dbResults);
}
public void readFields0(ResultSet __dbResults) throws SQLException {
this.id = JdbcWritableBridge.readInteger(1, __dbResults);
this.name = JdbcWritableBridge.readString(2, __dbResults);
this.sex = JdbcWritableBridge.readString(3, __dbResults);
this.age = JdbcWritableBridge.readInteger(4, __dbResults);
this.profile = JdbcWritableBridge.readString(5, __dbResults);
}
public void loadLargeObjects(LargeObjectLoader __loader)
throws SQLException, IOException, InterruptedException {
}
public void loadLargeObjects0(LargeObjectLoader __loader)
throws SQLException, IOException, InterruptedException {
}
public void write(PreparedStatement __dbStmt) throws SQLException {
write(__dbStmt, 0);
}

public int write(PreparedStatement __dbStmt, int __off) throws SQLException {
JdbcWritableBridge.writeInteger(id, 1 + __off, 4, __dbStmt);
JdbcWritableBridge.writeString(name, 2 + __off, 12, __dbStmt);
JdbcWritableBridge.writeString(sex, 3 + __off, 12, __dbStmt);
JdbcWritableBridge.writeInteger(age, 4 + __off, -6, __dbStmt);
JdbcWritableBridge.writeString(profile, 5 + __off, 12, __dbStmt);
return 5;
}
public void write0(PreparedStatement __dbStmt, int __off) throws SQLException {
JdbcWritableBridge.writeInteger(id, 1 + __off, 4, __dbStmt);
JdbcWritableBridge.writeString(name, 2 + __off, 12, __dbStmt);
JdbcWritableBridge.writeString(sex, 3 + __off, 12, __dbStmt);
JdbcWritableBridge.writeInteger(age, 4 + __off, -6, __dbStmt);
JdbcWritableBridge.writeString(profile, 5 + __off, 12, __dbStmt);
}
public void readFields(DataInput __dataIn) throws IOException {
this.readFields0(__dataIn);  }
public void readFields0(DataInput __dataIn) throws IOException {
if (__dataIn.readBoolean()) {
this.id = null;
} else {
this.id = Integer.valueOf(__dataIn.readInt());
}
if (__dataIn.readBoolean()) {
this.name = null;
} else {
this.name = Text.readString(__dataIn);
}
if (__dataIn.readBoolean()) {
this.sex = null;
} else {
this.sex = Text.readString(__dataIn);
}
if (__dataIn.readBoolean()) {
this.age = null;
} else {
this.age = Integer.valueOf(__dataIn.readInt());
}
if (__dataIn.readBoolean()) {
this.profile = null;
} else {
this.profile = Text.readString(__dataIn);
}
}
public void write(DataOutput __dataOut) throws IOException {
if (null == this.id) {
__dataOut.writeBoolean(true);
} else {
__dataOut.writeBoolean(false);
__dataOut.writeInt(this.id);
}
if (null == this.name) {
__dataOut.writeBoolean(true);
} else {
__dataOut.writeBoolean(false);
Text.writeString(__dataOut, name);
}
if (null == this.sex) {
__dataOut.writeBoolean(true);
} else {
__dataOut.writeBoolean(false);
Text.writeString(__dataOut, sex);
}
if (null == this.age) {
__dataOut.writeBoolean(true);
} else {
__dataOut.writeBoolean(false);
__dataOut.writeInt(this.age);
}
if (null == this.profile) {
__dataOut.writeBoolean(true);
} else {
__dataOut.writeBoolean(false);
Text.writeString(__dataOut, profile);
}
}
public void write0(DataOutput __dataOut) throws IOException {
if (null == this.id) {
__dataOut.writeBoolean(true);
} else {
__dataOut.writeBoolean(false);
__dataOut.writeInt(this.id);
}
if (null == this.name) {
__dataOut.writeBoolean(true);
} else {
__dataOut.writeBoolean(false);
Text.writeString(__dataOut, name);
}
if (null == this.sex) {
__dataOut.writeBoolean(true);
} else {
__dataOut.writeBoolean(false);
Text.writeString(__dataOut, sex);
}
if (null == this.age) {
__dataOut.writeBoolean(true);
} else {
__dataOut.writeBoolean(false);
__dataOut.writeInt(this.age);
}
if (null == this.profile) {
__dataOut.writeBoolean(true);
} else {
__dataOut.writeBoolean(false);
Text.writeString(__dataOut, profile);
}
}
private static final DelimiterSet __outputDelimiters = new DelimiterSet((char) 44, (char) 10, (char) 0, (char) 0, false);
public String toString() {
return toString(__outputDelimiters, true);
}
public String toString(DelimiterSet delimiters) {
return toString(delimiters, true);
}
public String toString(boolean useRecordDelim) {
return toString(__outputDelimiters, useRecordDelim);
}
public String toString(DelimiterSet delimiters, boolean useRecordDelim) {
StringBuilder __sb = new StringBuilder();
char fieldDelim = delimiters.getFieldsTerminatedBy();
__sb.append(FieldFormatter.escapeAndEnclose(id==null?"null":"" + id, delimiters));
__sb.append(fieldDelim);
__sb.append(FieldFormatter.escapeAndEnclose(name==null?"null":name, delimiters));
__sb.append(fieldDelim);
__sb.append(FieldFormatter.escapeAndEnclose(sex==null?"null":sex, delimiters));
__sb.append(fieldDelim);
__sb.append(FieldFormatter.escapeAndEnclose(age==null?"null":"" + age, delimiters));
__sb.append(fieldDelim);
__sb.append(FieldFormatter.escapeAndEnclose(profile==null?"null":profile, delimiters));
if (useRecordDelim) {
__sb.append(delimiters.getLinesTerminatedBy());
}
return __sb.toString();
}
public void toString0(DelimiterSet delimiters, StringBuilder __sb, char fieldDelim) {
__sb.append(FieldFormatter.escapeAndEnclose(id==null?"null":"" + id, delimiters));
__sb.append(fieldDelim);
__sb.append(FieldFormatter.escapeAndEnclose(name==null?"null":name, delimiters));
__sb.append(fieldDelim);
__sb.append(FieldFormatter.escapeAndEnclose(sex==null?"null":sex, delimiters));
__sb.append(fieldDelim);
__sb.append(FieldFormatter.escapeAndEnclose(age==null?"null":"" + age, delimiters));
__sb.append(fieldDelim);
__sb.append(FieldFormatter.escapeAndEnclose(profile==null?"null":profile, delimiters));
}
private static final DelimiterSet __inputDelimiters = new DelimiterSet((char) 64, (char) 10, (char) 0, (char) 0, false);
private RecordParser __parser;
public void parse(Text __record) throws RecordParser.ParseError {
if (null == this.__parser) {
this.__parser = new RecordParser(__inputDelimiters);
}
List<String> __fields = this.__parser.parseRecord(__record);
__loadFromFields(__fields);
}

public void parse(CharSequence __record) throws RecordParser.ParseError {
if (null == this.__parser) {
this.__parser = new RecordParser(__inputDelimiters);
}
List<String> __fields = this.__parser.parseRecord(__record);
__loadFromFields(__fields);
}

public void parse(byte [] __record) throws RecordParser.ParseError {
if (null == this.__parser) {
this.__parser = new RecordParser(__inputDelimiters);
}
List<String> __fields = this.__parser.parseRecord(__record);
__loadFromFields(__fields);
}

public void parse(char [] __record) throws RecordParser.ParseError {
if (null == this.__parser) {
this.__parser = new RecordParser(__inputDelimiters);
}
List<String> __fields = this.__parser.parseRecord(__record);
__loadFromFields(__fields);
}

public void parse(ByteBuffer __record) throws RecordParser.ParseError {
if (null == this.__parser) {
this.__parser = new RecordParser(__inputDelimiters);
}
List<String> __fields = this.__parser.parseRecord(__record);
__loadFromFields(__fields);
}

public void parse(CharBuffer __record) throws RecordParser.ParseError {
if (null == this.__parser) {
this.__parser = new RecordParser(__inputDelimiters);
}
List<String> __fields = this.__parser.parseRecord(__record);
__loadFromFields(__fields);
}

private void __loadFromFields(List<String> fields) {
Iterator<String> __it = fields.listIterator();
String __cur_str = null;
try {
__cur_str = __it.next();
if (__cur_str.equals("null") || __cur_str.length() == 0) { this.id = null; } else {
this.id = Integer.valueOf(__cur_str);
}

__cur_str = __it.next();
if (__cur_str.equals("null")) { this.name = null; } else {
this.name = __cur_str;
}

__cur_str = __it.next();
if (__cur_str.equals("null")) { this.sex = null; } else {
this.sex = __cur_str;
}

__cur_str = __it.next();
if (__cur_str.equals("null") || __cur_str.length() == 0) { this.age = null; } else {
this.age = Integer.valueOf(__cur_str);
}

__cur_str = __it.next();
if (__cur_str.equals("null")) { this.profile = null; } else {
this.profile = __cur_str;
}

} catch (RuntimeException e) {    throw new RuntimeException("Can't parse input data: '" + __cur_str + "'", e);    }  }

private void __loadFromFields0(Iterator<String> __it) {
String __cur_str = null;
try {
__cur_str = __it.next();
if (__cur_str.equals("null") || __cur_str.length() == 0) { this.id = null; } else {
this.id = Integer.valueOf(__cur_str);
}

__cur_str = __it.next();
if (__cur_str.equals("null")) { this.name = null; } else {
this.name = __cur_str;
}

__cur_str = __it.next();
if (__cur_str.equals("null")) { this.sex = null; } else {
this.sex = __cur_str;
}

__cur_str = __it.next();
if (__cur_str.equals("null") || __cur_str.length() == 0) { this.age = null; } else {
this.age = Integer.valueOf(__cur_str);
}

__cur_str = __it.next();
if (__cur_str.equals("null")) { this.profile = null; } else {
this.profile = __cur_str;
}

} catch (RuntimeException e) {    throw new RuntimeException("Can't parse input data: '" + __cur_str + "'", e);    }  }

public Object clone() throws CloneNotSupportedException {
djt_user_copy o = (djt_user_copy) super.clone();
return o;
}

public void clone0(djt_user_copy o) throws CloneNotSupportedException {
}

public Map<String, Object> getFieldMap() {
Map<String, Object> __sqoop$field_map = new TreeMap<String, Object>();
__sqoop$field_map.put("id", this.id);
__sqoop$field_map.put("name", this.name);
__sqoop$field_map.put("sex", this.sex);
__sqoop$field_map.put("age", this.age);
__sqoop$field_map.put("profile", this.profile);
return __sqoop$field_map;
}

public void getFieldMap0(Map<String, Object> __sqoop$field_map) {
__sqoop$field_map.put("id", this.id);
__sqoop$field_map.put("name", this.name);
__sqoop$field_map.put("sex", this.sex);
__sqoop$field_map.put("age", this.age);
__sqoop$field_map.put("profile", this.profile);
}

public void setField(String __fieldName, Object __fieldVal) {
if ("id".equals(__fieldName)) {
this.id = (Integer) __fieldVal;
}
else    if ("name".equals(__fieldName)) {
this.name = (String) __fieldVal;
}
else    if ("sex".equals(__fieldName)) {
this.sex = (String) __fieldVal;
}
else    if ("age".equals(__fieldName)) {
this.age = (Integer) __fieldVal;
}
else    if ("profile".equals(__fieldName)) {
this.profile = (String) __fieldVal;
}
else {
throw new RuntimeException("No such field: " + __fieldName);
}
}
public boolean setField0(String __fieldName, Object __fieldVal) {
if ("id".equals(__fieldName)) {
this.id = (Integer) __fieldVal;
return true;
}
else    if ("name".equals(__fieldName)) {
this.name = (String) __fieldVal;
return true;
}
else    if ("sex".equals(__fieldName)) {
this.sex = (String) __fieldVal;
return true;
}
else    if ("age".equals(__fieldName)) {
this.age = (Integer) __fieldVal;
return true;
}
else    if ("profile".equals(__fieldName)) {
this.profile = (String) __fieldVal;
return true;
}
else {
return false;    }
}
}
[hadoop@djt002 sqoopRunCreate]$


[hadoop@djt002 sqoopRunCreate]$ ls
djt_user_copy.java  djt_user.java  QueryResult.java
[hadoop@djt002 sqoopRunCreate]$ cat QueryResult.java
// ORM class for table 'null'
// WARNING: This class is AUTO-GENERATED. Modify at your own risk.
//
// Debug information:
// Generated date: Sat Mar 18 18:41:26 CST 2017
// For connector: org.apache.sqoop.manager.MySQLManager
import org.apache.hadoop.io.BytesWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.Writable;
import org.apache.hadoop.mapred.lib.db.DBWritable;
import com.cloudera.sqoop.lib.JdbcWritableBridge;
import com.cloudera.sqoop.lib.DelimiterSet;
import com.cloudera.sqoop.lib.FieldFormatter;
import com.cloudera.sqoop.lib.RecordParser;
import com.cloudera.sqoop.lib.BooleanParser;
import com.cloudera.sqoop.lib.BlobRef;
import com.cloudera.sqoop.lib.ClobRef;
import com.cloudera.sqoop.lib.LargeObjectLoader;
import com.cloudera.sqoop.lib.SqoopRecord;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

public class QueryResult extends SqoopRecord  implements DBWritable, Writable {
private final int PROTOCOL_VERSION = 3;
public int getClassFormatVersion() { return PROTOCOL_VERSION; }
protected ResultSet __cur_result_set;
private Integer id;
public Integer get_id() {
return id;
}
public void set_id(Integer id) {
this.id = id;
}
public QueryResult with_id(Integer id) {
this.id = id;
return this;
}
private String name;
public String get_name() {
return name;
}
public void set_name(String name) {
this.name = name;
}
public QueryResult with_name(String name) {
this.name = name;
return this;
}
private String sex;
public String get_sex() {
return sex;
}
public void set_sex(String sex) {
this.sex = sex;
}
public QueryResult with_sex(String sex) {
this.sex = sex;
return this;
}
private Integer age;
public Integer get_age() {
return age;
}
public void set_age(Integer age) {
this.age = age;
}
public QueryResult with_age(Integer age) {
this.age = age;
return this;
}
private String profile;
public String get_profile() {
return profile;
}
public void set_profile(String profile) {
this.profile = profile;
}
public QueryResult with_profile(String profile) {
this.profile = profile;
return this;
}
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof QueryResult)) {
return false;
}
QueryResult that = (QueryResult) o;
boolean equal = true;
equal = equal && (this.id == null ? that.id == null : this.id.equals(that.id));
equal = equal && (this.name == null ? that.name == null : this.name.equals(that.name));
equal = equal && (this.sex == null ? that.sex == null : this.sex.equals(that.sex));
equal = equal && (this.age == null ? that.age == null : this.age.equals(that.age));
equal = equal && (this.profile == null ? that.profile == null : this.profile.equals(that.profile));
return equal;
}
public boolean equals0(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof QueryResult)) {
return false;
}
QueryResult that = (QueryResult) o;
boolean equal = true;
equal = equal && (this.id == null ? that.id == null : this.id.equals(that.id));
equal = equal && (this.name == null ? that.name == null : this.name.equals(that.name));
equal = equal && (this.sex == null ? that.sex == null : this.sex.equals(that.sex));
equal = equal && (this.age == null ? that.age == null : this.age.equals(that.age));
equal = equal && (this.profile == null ? that.profile == null : this.profile.equals(that.profile));
return equal;
}
public void readFields(ResultSet __dbResults) throws SQLException {
this.__cur_result_set = __dbResults;
this.id = JdbcWritableBridge.readInteger(1, __dbResults);
this.name = JdbcWritableBridge.readString(2, __dbResults);
this.sex = JdbcWritableBridge.readString(3, __dbResults);
this.age = JdbcWritableBridge.readInteger(4, __dbResults);
this.profile = JdbcWritableBridge.readString(5, __dbResults);
}
public void readFields0(ResultSet __dbResults) throws SQLException {
this.id = JdbcWritableBridge.readInteger(1, __dbResults);
this.name = JdbcWritableBridge.readString(2, __dbResults);
this.sex = JdbcWritableBridge.readString(3, __dbResults);
this.age = JdbcWritableBridge.readInteger(4, __dbResults);
this.profile = JdbcWritableBridge.readString(5, __dbResults);
}
public void loadLargeObjects(LargeObjectLoader __loader)
throws SQLException, IOException, InterruptedException {
}
public void loadLargeObjects0(LargeObjectLoader __loader)
throws SQLException, IOException, InterruptedException {
}
public void write(PreparedStatement __dbStmt) throws SQLException {
write(__dbStmt, 0);
}

public int write(PreparedStatement __dbStmt, int __off) throws SQLException {
JdbcWritableBridge.writeInteger(id, 1 + __off, 4, __dbStmt);
JdbcWritableBridge.writeString(name, 2 + __off, 12, __dbStmt);
JdbcWritableBridge.writeString(sex, 3 + __off, 12, __dbStmt);
JdbcWritableBridge.writeInteger(age, 4 + __off, -6, __dbStmt);
JdbcWritableBridge.writeString(profile, 5 + __off, 12, __dbStmt);
return 5;
}
public void write0(PreparedStatement __dbStmt, int __off) throws SQLException {
JdbcWritableBridge.writeInteger(id, 1 + __off, 4, __dbStmt);
JdbcWritableBridge.writeString(name, 2 + __off, 12, __dbStmt);
JdbcWritableBridge.writeString(sex, 3 + __off, 12, __dbStmt);
JdbcWritableBridge.writeInteger(age, 4 + __off, -6, __dbStmt);
JdbcWritableBridge.writeString(profile, 5 + __off, 12, __dbStmt);
}
public void readFields(DataInput __dataIn) throws IOException {
this.readFields0(__dataIn);  }
public void readFields0(DataInput __dataIn) throws IOException {
if (__dataIn.readBoolean()) {
this.id = null;
} else {
this.id = Integer.valueOf(__dataIn.readInt());
}
if (__dataIn.readBoolean()) {
this.name = null;
} else {
this.name = Text.readString(__dataIn);
}
if (__dataIn.readBoolean()) {
this.sex = null;
} else {
this.sex = Text.readString(__dataIn);
}
if (__dataIn.readBoolean()) {
this.age = null;
} else {
this.age = Integer.valueOf(__dataIn.readInt());
}
if (__dataIn.readBoolean()) {
this.profile = null;
} else {
this.profile = Text.readString(__dataIn);
}
}
public void write(DataOutput __dataOut) throws IOException {
if (null == this.id) {
__dataOut.writeBoolean(true);
} else {
__dataOut.writeBoolean(false);
__dataOut.writeInt(this.id);
}
if (null == this.name) {
__dataOut.writeBoolean(true);
} else {
__dataOut.writeBoolean(false);
Text.writeString(__dataOut, name);
}
if (null == this.sex) {
__dataOut.writeBoolean(true);
} else {
__dataOut.writeBoolean(false);
Text.writeString(__dataOut, sex);
}
if (null == this.age) {
__dataOut.writeBoolean(true);
} else {
__dataOut.writeBoolean(false);
__dataOut.writeInt(this.age);
}
if (null == this.profile) {
__dataOut.writeBoolean(true);
} else {
__dataOut.writeBoolean(false);
Text.writeString(__dataOut, profile);
}
}
public void write0(DataOutput __dataOut) throws IOException {
if (null == this.id) {
__dataOut.writeBoolean(true);
} else {
__dataOut.writeBoolean(false);
__dataOut.writeInt(this.id);
}
if (null == this.name) {
__dataOut.writeBoolean(true);
} else {
__dataOut.writeBoolean(false);
Text.writeString(__dataOut, name);
}
if (null == this.sex) {
__dataOut.writeBoolean(true);
} else {
__dataOut.writeBoolean(false);
Text.writeString(__dataOut, sex);
}
if (null == this.age) {
__dataOut.writeBoolean(true);
} else {
__dataOut.writeBoolean(false);
__dataOut.writeInt(this.age);
}
if (null == this.profile) {
__dataOut.writeBoolean(true);
} else {
__dataOut.writeBoolean(false);
Text.writeString(__dataOut, profile);
}
}
private static final DelimiterSet __outputDelimiters = new DelimiterSet((char) 64, (char) 10, (char) 0, (char) 0, false);
public String toString() {
return toString(__outputDelimiters, true);
}
public String toString(DelimiterSet delimiters) {
return toString(delimiters, true);
}
public String toString(boolean useRecordDelim) {
return toString(__outputDelimiters, useRecordDelim);
}
public String toString(DelimiterSet delimiters, boolean useRecordDelim) {
StringBuilder __sb = new StringBuilder();
char fieldDelim = delimiters.getFieldsTerminatedBy();
__sb.append(FieldFormatter.escapeAndEnclose(id==null?"###":"" + id, delimiters));
__sb.append(fieldDelim);
__sb.append(FieldFormatter.escapeAndEnclose(name==null?"###":name, delimiters));
__sb.append(fieldDelim);
__sb.append(FieldFormatter.escapeAndEnclose(sex==null?"###":sex, delimiters));
__sb.append(fieldDelim);
__sb.append(FieldFormatter.escapeAndEnclose(age==null?"###":"" + age, delimiters));
__sb.append(fieldDelim);
__sb.append(FieldFormatter.escapeAndEnclose(profile==null?"###":profile, delimiters));
if (useRecordDelim) {
__sb.append(delimiters.getLinesTerminatedBy());
}
return __sb.toString();
}
public void toString0(DelimiterSet delimiters, StringBuilder __sb, char fieldDelim) {
__sb.append(FieldFormatter.escapeAndEnclose(id==null?"###":"" + id, delimiters));
__sb.append(fieldDelim);
__sb.append(FieldFormatter.escapeAndEnclose(name==null?"###":name, delimiters));
__sb.append(fieldDelim);
__sb.append(FieldFormatter.escapeAndEnclose(sex==null?"###":sex, delimiters));
__sb.append(fieldDelim);
__sb.append(FieldFormatter.escapeAndEnclose(age==null?"###":"" + age, delimiters));
__sb.append(fieldDelim);
__sb.append(FieldFormatter.escapeAndEnclose(profile==null?"###":profile, delimiters));
}
private static final DelimiterSet __inputDelimiters = new DelimiterSet((char) 64, (char) 10, (char) 0, (char) 0, false);
private RecordParser __parser;
public void parse(Text __record) throws RecordParser.ParseError {
if (null == this.__parser) {
this.__parser = new RecordParser(__inputDelimiters);
}
List<String> __fields = this.__parser.parseRecord(__record);
__loadFromFields(__fields);
}

public void parse(CharSequence __record) throws RecordParser.ParseError {
if (null == this.__parser) {
this.__parser = new RecordParser(__inputDelimiters);
}
List<String> __fields = this.__parser.parseRecord(__record);
__loadFromFields(__fields);
}

public void parse(byte [] __record) throws RecordParser.ParseError {
if (null == this.__parser) {
this.__parser = new RecordParser(__inputDelimiters);
}
List<String> __fields = this.__parser.parseRecord(__record);
__loadFromFields(__fields);
}
public void parse(char [] __record) throws RecordParser.ParseError {
if (null == this.__parser) {
this.__parser = new RecordParser(__inputDelimiters);
}
List<String> __fields = this.__parser.parseRecord(__record);
__loadFromFields(__fields);
}

public void parse(ByteBuffer __record) throws RecordParser.ParseError {
if (null == this.__parser) {
this.__parser = new RecordParser(__inputDelimiters);
}
List<String> __fields = this.__parser.parseRecord(__record);
__loadFromFields(__fields);
}

public void parse(CharBuffer __record) throws RecordParser.ParseError {
if (null == this.__parser) {
this.__parser = new RecordParser(__inputDelimiters);
}
List<String> __fields = this.__parser.parseRecord(__record);
__loadFromFields(__fields);
}

private void __loadFromFields(List<String> fields) {
Iterator<String> __it = fields.listIterator();
String __cur_str = null;
try {
__cur_str = __it.next();
if (__cur_str.equals("null") || __cur_str.length() == 0) { this.id = null; } else {
this.id = Integer.valueOf(__cur_str);
}

__cur_str = __it.next();
if (__cur_str.equals("null")) { this.name = null; } else {
this.name = __cur_str;
}

__cur_str = __it.next();
if (__cur_str.equals("null")) { this.sex = null; } else {
this.sex = __cur_str;
}

__cur_str = __it.next();
if (__cur_str.equals("null") || __cur_str.length() == 0) { this.age = null; } else {
this.age = Integer.valueOf(__cur_str);
}

__cur_str = __it.next();
if (__cur_str.equals("null")) { this.profile = null; } else {
this.profile = __cur_str;
}

} catch (RuntimeException e) {    throw new RuntimeException("Can't parse input data: '" + __cur_str + "'", e);    }  }

private void __loadFromFields0(Iterator<String> __it) {
String __cur_str = null;
try {
__cur_str = __it.next();
if (__cur_str.equals("null") || __cur_str.length() == 0) { this.id = null; } else {
this.id = Integer.valueOf(__cur_str);
}

__cur_str = __it.next();
if (__cur_str.equals("null")) { this.name = null; } else {
this.name = __cur_str;
}

__cur_str = __it.next();
if (__cur_str.equals("null")) { this.sex = null; } else {
this.sex = __cur_str;
}

__cur_str = __it.next();
if (__cur_str.equals("null") || __cur_str.length() == 0) { this.age = null; } else {
this.age = Integer.valueOf(__cur_str);
}

__cur_str = __it.next();
if (__cur_str.equals("null")) { this.profile = null; } else {
this.profile = __cur_str;
}

} catch (RuntimeException e) {    throw new RuntimeException("Can't parse input data: '" + __cur_str + "'", e);    }  }

public Object clone() throws CloneNotSupportedException {
QueryResult o = (QueryResult) super.clone();
return o;
}

public void clone0(QueryResult o) throws CloneNotSupportedException {
}

public Map<String, Object> getFieldMap() {
Map<String, Object> __sqoop$field_map = new TreeMap<String, Object>();
__sqoop$field_map.put("id", this.id);
__sqoop$field_map.put("name", this.name);
__sqoop$field_map.put("sex", this.sex);
__sqoop$field_map.put("age", this.age);
__sqoop$field_map.put("profile", this.profile);
return __sqoop$field_map;
}

public void getFieldMap0(Map<String, Object> __sqoop$field_map) {
__sqoop$field_map.put("id", this.id);
__sqoop$field_map.put("name", this.name);
__sqoop$field_map.put("sex", this.sex);
__sqoop$field_map.put("age", this.age);
__sqoop$field_map.put("profile", this.profile);
}

public void setField(String __fieldName, Object __fieldVal) {
if ("id".equals(__fieldName)) {
this.id = (Integer) __fieldVal;
}
else    if ("name".equals(__fieldName)) {
this.name = (String) __fieldVal;
}
else    if ("sex".equals(__fieldName)) {
this.sex = (String) __fieldVal;
}
else    if ("age".equals(__fieldName)) {
this.age = (Integer) __fieldVal;
}
else    if ("profile".equals(__fieldName)) {
this.profile = (String) __fieldVal;
}
else {
throw new RuntimeException("No such field: " + __fieldName);
}
}
public boolean setField0(String __fieldName, Object __fieldVal) {
if ("id".equals(__fieldName)) {
this.id = (Integer) __fieldVal;
return true;
}
else    if ("name".equals(__fieldName)) {
this.name = (String) __fieldVal;
return true;
}
else    if ("sex".equals(__fieldName)) {
this.sex = (String) __fieldVal;
return true;
}
else    if ("age".equals(__fieldName)) {
this.age = (Integer) __fieldVal;
return true;
}
else    if ("profile".equals(__fieldName)) {
this.profile = (String) __fieldVal;
return true;
}
else {
return false;    }
}
}
[hadoop@djt002 sqoopRunCreate]$


[hadoop@djt002 sqoopRunCreate]$ pwd
/usr/local/sqoop/sqoopRunCreate
[hadoop@djt002 sqoopRunCreate]$ ls
djt_user_copy.java  djt_user.java  QueryResult.java
[hadoop@djt002 sqoopRunCreate]$ cat djt_user.java
// ORM class for table 'djt-user'
// WARNING: This class is AUTO-GENERATED. Modify at your own risk.
//
// Debug information:
// Generated date: Sat Mar 18 03:49:13 CST 2017
// For connector: org.apache.sqoop.manager.MySQLManager
import org.apache.hadoop.io.BytesWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.Writable;
import org.apache.hadoop.mapred.lib.db.DBWritable;
import com.cloudera.sqoop.lib.JdbcWritableBridge;
import com.cloudera.sqoop.lib.DelimiterSet;
import com.cloudera.sqoop.lib.FieldFormatter;
import com.cloudera.sqoop.lib.RecordParser;
import com.cloudera.sqoop.lib.BooleanParser;
import com.cloudera.sqoop.lib.BlobRef;
import com.cloudera.sqoop.lib.ClobRef;
import com.cloudera.sqoop.lib.LargeObjectLoader;
import com.cloudera.sqoop.lib.SqoopRecord;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

public class djt_user extends SqoopRecord  implements DBWritable, Writable {
private final int PROTOCOL_VERSION = 3;
public int getClassFormatVersion() { return PROTOCOL_VERSION; }
protected ResultSet __cur_result_set;
private Integer id;
public Integer get_id() {
return id;
}
public void set_id(Integer id) {
this.id = id;
}
public djt_user with_id(Integer id) {
this.id = id;
return this;
}
private String name;
public String get_name() {
return name;
}
public void set_name(String name) {
this.name = name;
}
public djt_user with_name(String name) {
this.name = name;
return this;
}
private org.apache.hadoop.io.BytesWritable sex;
public org.apache.hadoop.io.BytesWritable get_sex() {
return sex;
}
public void set_sex(org.apache.hadoop.io.BytesWritable sex) {
this.sex = sex;
}
public djt_user with_sex(org.apache.hadoop.io.BytesWritable sex) {
this.sex = sex;
return this;
}
private Integer age;
public Integer get_age() {
return age;
}
public void set_age(Integer age) {
this.age = age;
}
public djt_user with_age(Integer age) {
this.age = age;
return this;
}
private org.apache.hadoop.io.BytesWritable profile;
public org.apache.hadoop.io.BytesWritable get_profile() {
return profile;
}
public void set_profile(org.apache.hadoop.io.BytesWritable profile) {
this.profile = profile;
}
public djt_user with_profile(org.apache.hadoop.io.BytesWritable profile) {
this.profile = profile;
return this;
}
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof djt_user)) {
return false;
}
djt_user that = (djt_user) o;
boolean equal = true;
equal = equal && (this.id == null ? that.id == null : this.id.equals(that.id));
equal = equal && (this.name == null ? that.name == null : this.name.equals(that.name));
equal = equal && (this.sex == null ? that.sex == null : this.sex.equals(that.sex));
equal = equal && (this.age == null ? that.age == null : this.age.equals(that.age));
equal = equal && (this.profile == null ? that.profile == null : this.profile.equals(that.profile));
return equal;
}
public boolean equals0(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof djt_user)) {
return false;
}
djt_user that = (djt_user) o;
boolean equal = true;
equal = equal && (this.id == null ? that.id == null : this.id.equals(that.id));
equal = equal && (this.name == null ? that.name == null : this.name.equals(that.name));
equal = equal && (this.sex == null ? that.sex == null : this.sex.equals(that.sex));
equal = equal && (this.age == null ? that.age == null : this.age.equals(that.age));
equal = equal && (this.profile == null ? that.profile == null : this.profile.equals(that.profile));
return equal;
}
public void readFields(ResultSet __dbResults) throws SQLException {
this.__cur_result_set = __dbResults;
this.id = JdbcWritableBridge.readInteger(1, __dbResults);
this.name = JdbcWritableBridge.readString(2, __dbResults);
this.sex = JdbcWritableBridge.readBytesWritable(3, __dbResults);
this.age = JdbcWritableBridge.readInteger(4, __dbResults);
this.profile = JdbcWritableBridge.readBytesWritable(5, __dbResults);
}
public void readFields0(ResultSet __dbResults) throws SQLException {
this.id = JdbcWritableBridge.readInteger(1, __dbResults);
this.name = JdbcWritableBridge.readString(2, __dbResults);
this.sex = JdbcWritableBridge.readBytesWritable(3, __dbResults);
this.age = JdbcWritableBridge.readInteger(4, __dbResults);
this.profile = JdbcWritableBridge.readBytesWritable(5, __dbResults);
}
public void loadLargeObjects(LargeObjectLoader __loader)
throws SQLException, IOException, InterruptedException {
}
public void loadLargeObjects0(LargeObjectLoader __loader)
throws SQLException, IOException, InterruptedException {
}
public void write(PreparedStatement __dbStmt) throws SQLException {
write(__dbStmt, 0);
}

public int write(PreparedStatement __dbStmt, int __off) throws SQLException {
JdbcWritableBridge.writeInteger(id, 1 + __off, 4, __dbStmt);
JdbcWritableBridge.writeString(name, 2 + __off, 12, __dbStmt);
JdbcWritableBridge.writeBytesWritable(sex, 3 + __off, -3, __dbStmt);
JdbcWritableBridge.writeInteger(age, 4 + __off, -6, __dbStmt);
JdbcWritableBridge.writeBytesWritable(profile, 5 + __off, -3, __dbStmt);
return 5;
}
public void write0(PreparedStatement __dbStmt, int __off) throws SQLException {
JdbcWritableBridge.writeInteger(id, 1 + __off, 4, __dbStmt);
JdbcWritableBridge.writeString(name, 2 + __off, 12, __dbStmt);
JdbcWritableBridge.writeBytesWritable(sex, 3 + __off, -3, __dbStmt);
JdbcWritableBridge.writeInteger(age, 4 + __off, -6, __dbStmt);
JdbcWritableBridge.writeBytesWritable(profile, 5 + __off, -3, __dbStmt);
}
public void readFields(DataInput __dataIn) throws IOException {
this.readFields0(__dataIn);  }
public void readFields0(DataInput __dataIn) throws IOException {
if (__dataIn.readBoolean()) {
this.id = null;
} else {
this.id = Integer.valueOf(__dataIn.readInt());
}
if (__dataIn.readBoolean()) {
this.name = null;
} else {
this.name = Text.readString(__dataIn);
}
if (__dataIn.readBoolean()) {
this.sex = null;
} else {
this.sex = new BytesWritable();
this.sex.readFields(__dataIn);
}
if (__dataIn.readBoolean()) {
this.age = null;
} else {
this.age = Integer.valueOf(__dataIn.readInt());
}
if (__dataIn.readBoolean()) {
this.profile = null;
} else {
this.profile = new BytesWritable();
this.profile.readFields(__dataIn);
}
}
public void write(DataOutput __dataOut) throws IOException {
if (null == this.id) {
__dataOut.writeBoolean(true);
} else {
__dataOut.writeBoolean(false);
__dataOut.writeInt(this.id);
}
if (null == this.name) {
__dataOut.writeBoolean(true);
} else {
__dataOut.writeBoolean(false);
Text.writeString(__dataOut, name);
}
if (null == this.sex) {
__dataOut.writeBoolean(true);
} else {
__dataOut.writeBoolean(false);
this.sex.write(__dataOut);
}
if (null == this.age) {
__dataOut.writeBoolean(true);
} else {
__dataOut.writeBoolean(false);
__dataOut.writeInt(this.age);
}
if (null == this.profile) {
__dataOut.writeBoolean(true);
} else {
__dataOut.writeBoolean(false);
this.profile.write(__dataOut);
}
}
public void write0(DataOutput __dataOut) throws IOException {
if (null == this.id) {
__dataOut.writeBoolean(true);
} else {
__dataOut.writeBoolean(false);
__dataOut.writeInt(this.id);
}
if (null == this.name) {
__dataOut.writeBoolean(true);
} else {
__dataOut.writeBoolean(false);
Text.writeString(__dataOut, name);
}
if (null == this.sex) {
__dataOut.writeBoolean(true);
} else {
__dataOut.writeBoolean(false);
this.sex.write(__dataOut);
}
if (null == this.age) {
__dataOut.writeBoolean(true);
} else {
__dataOut.writeBoolean(false);
__dataOut.writeInt(this.age);
}
if (null == this.profile) {
__dataOut.writeBoolean(true);
} else {
__dataOut.writeBoolean(false);
this.profile.write(__dataOut);
}
}
private static final DelimiterSet __outputDelimiters = new DelimiterSet((char) 44, (char) 10, (char) 0, (char) 0, false);
public String toString() {
return toString(__outputDelimiters, true);
}
public String toString(DelimiterSet delimiters) {
return toString(delimiters, true);
}
public String toString(boolean useRecordDelim) {
return toString(__outputDelimiters, useRecordDelim);
}
public String toString(DelimiterSet delimiters, boolean useRecordDelim) {
StringBuilder __sb = new StringBuilder();
char fieldDelim = delimiters.getFieldsTerminatedBy();
__sb.append(FieldFormatter.escapeAndEnclose(id==null?"null":"" + id, delimiters));
__sb.append(fieldDelim);
__sb.append(FieldFormatter.escapeAndEnclose(name==null?"null":name, delimiters));
__sb.append(fieldDelim);
__sb.append(FieldFormatter.escapeAndEnclose(sex==null?"null":"" + sex, delimiters));
__sb.append(fieldDelim);
__sb.append(FieldFormatter.escapeAndEnclose(age==null?"null":"" + age, delimiters));
__sb.append(fieldDelim);
__sb.append(FieldFormatter.escapeAndEnclose(profile==null?"null":"" + profile, delimiters));
if (useRecordDelim) {
__sb.append(delimiters.getLinesTerminatedBy());
}
return __sb.toString();
}
public void toString0(DelimiterSet delimiters, StringBuilder __sb, char fieldDelim) {
__sb.append(FieldFormatter.escapeAndEnclose(id==null?"null":"" + id, delimiters));
__sb.append(fieldDelim);
__sb.append(FieldFormatter.escapeAndEnclose(name==null?"null":name, delimiters));
__sb.append(fieldDelim);
__sb.append(FieldFormatter.escapeAndEnclose(sex==null?"null":"" + sex, delimiters));
__sb.append(fieldDelim);
__sb.append(FieldFormatter.escapeAndEnclose(age==null?"null":"" + age, delimiters));
__sb.append(fieldDelim);
__sb.append(FieldFormatter.escapeAndEnclose(profile==null?"null":"" + profile, delimiters));
}
private static final DelimiterSet __inputDelimiters = new DelimiterSet((char) 44, (char) 10, (char) 0, (char) 0, false);
private RecordParser __parser;
public void parse(Text __record) throws RecordParser.ParseError {
if (null == this.__parser) {
this.__parser = new RecordParser(__inputDelimiters);
}
List<String> __fields = this.__parser.parseRecord(__record);
__loadFromFields(__fields);
}

public void parse(CharSequence __record) throws RecordParser.ParseError {
if (null == this.__parser) {
this.__parser = new RecordParser(__inputDelimiters);
}
List<String> __fields = this.__parser.parseRecord(__record);
__loadFromFields(__fields);
}
public void parse(CharBuffer __record) throws RecordParser.ParseError {
if (null == this.__parser) {
this.__parser = new RecordParser(__inputDelimiters);
}
List<String> __fields = this.__parser.parseRecord(__record);
__loadFromFields(__fields);
}

private void __loadFromFields(List<String> fields) {
Iterator<String> __it = fields.listIterator();
String __cur_str = null;
try {
__cur_str = __it.next();
if (__cur_str.equals("null") || __cur_str.length() == 0) { this.id = null; } else {
this.id = Integer.valueOf(__cur_str);
}

__cur_str = __it.next();
if (__cur_str.equals("null")) { this.name = null; } else {
this.name = __cur_str;
}

__cur_str = __it.next();
if (__cur_str.equals("null") || __cur_str.length() == 0) { this.sex = null; } else {
String[] strByteVal = __cur_str.trim().split(" ");
byte [] byteVal = new byte[strByteVal.length];
for (int i = 0; i < byteVal.length; ++i) {
byteVal[i] = (byte)Integer.parseInt(strByteVal[i], 16);
}
this.sex = new BytesWritable(byteVal);
}

__cur_str = __it.next();
if (__cur_str.equals("null") || __cur_str.length() == 0) { this.age = null; } else {
this.age = Integer.valueOf(__cur_str);
}

__cur_str = __it.next();
if (__cur_str.equals("null") || __cur_str.length() == 0) { this.profile = null; } else {
String[] strByteVal = __cur_str.trim().split(" ");
byte [] byteVal = new byte[strByteVal.length];
for (int i = 0; i < byteVal.length; ++i) {
byteVal[i] = (byte)Integer.parseInt(strByteVal[i], 16);
}
this.profile = new BytesWritable(byteVal);
}

} catch (RuntimeException e) {    throw new RuntimeException("Can't parse input data: '" + __cur_str + "'", e);    }  }

private void __loadFromFields0(Iterator<String> __it) {
String __cur_str = null;
try {
__cur_str = __it.next();
if (__cur_str.equals("null") || __cur_str.length() == 0) { this.id = null; } else {
this.id = Integer.valueOf(__cur_str);
}

__cur_str = __it.next();
if (__cur_str.equals("null")) { this.name = null; } else {
this.name = __cur_str;
}

__cur_str = __it.next();
if (__cur_str.equals("null") || __cur_str.length() == 0) { this.sex = null; } else {
String[] strByteVal = __cur_str.trim().split(" ");
byte [] byteVal = new byte[strByteVal.length];
for (int i = 0; i < byteVal.length; ++i) {
byteVal[i] = (byte)Integer.parseInt(strByteVal[i], 16);
}
this.sex = new BytesWritable(byteVal);
}

__cur_str = __it.next();
if (__cur_str.equals("null") || __cur_str.length() == 0) { this.age = null; } else {
this.age = Integer.valueOf(__cur_str);
}

__cur_str = __it.next();
if (__cur_str.equals("null") || __cur_str.length() == 0) { this.profile = null; } else {
String[] strByteVal = __cur_str.trim().split(" ");
byte [] byteVal = new byte[strByteVal.length];
for (int i = 0; i < byteVal.length; ++i) {
byteVal[i] = (byte)Integer.parseInt(strByteVal[i], 16);
}
this.profile = new BytesWritable(byteVal);
}

} catch (RuntimeException e) {    throw new RuntimeException("Can't parse input data: '" + __cur_str + "'", e);    }  }

public Object clone() throws CloneNotSupportedException {
djt_user o = (djt_user) super.clone();
o.sex = (o.sex != null) ? new BytesWritable(Arrays.copyOf(sex.getBytes(), sex.getLength())) : null;
o.profile = (o.profile != null) ? new BytesWritable(Arrays.copyOf(profile.getBytes(), profile.getLength())) : null;
return o;
}
public void clone0(djt_user o) throws CloneNotSupportedException {
o.sex = (o.sex != null) ? new BytesWritable(Arrays.copyOf(sex.getBytes(), sex.getLength())) : null;
o.profile = (o.profile != null) ? new BytesWritable(Arrays.copyOf(profile.getBytes(), profile.getLength())) : null;
}

public Map<String, Object> getFieldMap() {
Map<String, Object> __sqoop$field_map = new TreeMap<String, Object>();
__sqoop$field_map.put("id", this.id);
__sqoop$field_map.put("name", this.name);
__sqoop$field_map.put("sex", this.sex);
__sqoop$field_map.put("age", this.age);
__sqoop$field_map.put("profile", this.profile);
return __sqoop$field_map;
}

public void getFieldMap0(Map<String, Object> __sqoop$field_map) {
__sqoop$field_map.put("id", this.id);
__sqoop$field_map.put("name", this.name);
__sqoop$field_map.put("sex", this.sex);
__sqoop$field_map.put("age", this.age);
__sqoop$field_map.put("profile", this.profile);
}

public void setField(String __fieldName, Object __fieldVal) {
if ("id".equals(__fieldName)) {
this.id = (Integer) __fieldVal;
}
else    if ("name".equals(__fieldName)) {
this.name = (String) __fieldVal;
}
else    if ("sex".equals(__fieldName)) {
this.sex = (org.apache.hadoop.io.BytesWritable) __fieldVal;
}
else    if ("age".equals(__fieldName)) {
this.age = (Integer) __fieldVal;
}
else    if ("profile".equals(__fieldName)) {
this.profile = (org.apache.hadoop.io.BytesWritable) __fieldVal;
}
else {
throw new RuntimeException("No such field: " + __fieldName);
}
}
public boolean setField0(String __fieldName, Object __fieldVal) {
if ("id".equals(__fieldName)) {
this.id = (Integer) __fieldVal;
return true;
}
else    if ("name".equals(__fieldName)) {
this.name = (String) __fieldVal;
return true;
}
else    if ("sex".equals(__fieldName)) {
this.sex = (org.apache.hadoop.io.BytesWritable) __fieldVal;
return true;
}
else    if ("age".equals(__fieldName)) {
this.age = (Integer) __fieldVal;
return true;
}
else    if ("profile".equals(__fieldName)) {
this.profile = (org.apache.hadoop.io.BytesWritable) __fieldVal;
return true;
}
else {
return false;    }
}
}
[hadoop@djt002 sqoopRunCreate]$
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐