mirror of
https://github.com/alibaba/DataX.git
synced 2025-05-02 23:39:37 +08:00
Merge a5a631b10c
into 0824b45c5e
This commit is contained in:
commit
7a5e6de60f
@ -92,22 +92,22 @@ public abstract class HbaseAbstractTask {
|
|||||||
Column column;
|
Column column;
|
||||||
switch (columnType) {
|
switch (columnType) {
|
||||||
case BOOLEAN:
|
case BOOLEAN:
|
||||||
column = new BoolColumn(ArrayUtils.isEmpty(byteArray) ? null : Bytes.toBoolean(byteArray));
|
column = new BoolColumn(ArrayUtils.isEmpty(byteArray) ? null : Boolean.valueOf(Bytes.toString(byteArray)));
|
||||||
break;
|
break;
|
||||||
case SHORT:
|
case SHORT:
|
||||||
column = new LongColumn(ArrayUtils.isEmpty(byteArray) ? null : String.valueOf(Bytes.toShort(byteArray)));
|
column = new LongColumn(ArrayUtils.isEmpty(byteArray) ? null : Bytes.toString(byteArray));
|
||||||
break;
|
break;
|
||||||
case INT:
|
case INT:
|
||||||
column = new LongColumn(ArrayUtils.isEmpty(byteArray) ? null : Bytes.toInt(byteArray));
|
column = new LongColumn(ArrayUtils.isEmpty(byteArray) ? null : Integer.valueOf(Bytes.toString(byteArray)));
|
||||||
break;
|
break;
|
||||||
case LONG:
|
case LONG:
|
||||||
column = new LongColumn(ArrayUtils.isEmpty(byteArray) ? null : Bytes.toLong(byteArray));
|
column = new LongColumn(ArrayUtils.isEmpty(byteArray) ? null : Long.valueOf(Bytes.toString(byteArray)));
|
||||||
break;
|
break;
|
||||||
case FLOAT:
|
case FLOAT:
|
||||||
column = new DoubleColumn(ArrayUtils.isEmpty(byteArray) ? null : Bytes.toFloat(byteArray));
|
column = new DoubleColumn(ArrayUtils.isEmpty(byteArray) ? null : Float.valueOf(Bytes.toString(byteArray)));
|
||||||
break;
|
break;
|
||||||
case DOUBLE:
|
case DOUBLE:
|
||||||
column = new DoubleColumn(ArrayUtils.isEmpty(byteArray) ? null : Bytes.toDouble(byteArray));
|
column = new DoubleColumn(ArrayUtils.isEmpty(byteArray) ? null : Double.valueOf(Bytes.toString(byteArray)));
|
||||||
break;
|
break;
|
||||||
case STRING:
|
case STRING:
|
||||||
column = new StringColumn(ArrayUtils.isEmpty(byteArray) ? null : new String(byteArray, encoding));
|
column = new StringColumn(ArrayUtils.isEmpty(byteArray) ? null : new String(byteArray, encoding));
|
||||||
|
@ -90,22 +90,22 @@ public abstract class HbaseAbstractTask {
|
|||||||
if(column.getRawData() != null){
|
if(column.getRawData() != null){
|
||||||
switch (columnType) {
|
switch (columnType) {
|
||||||
case INT:
|
case INT:
|
||||||
bytes = Bytes.toBytes(column.asLong().intValue());
|
bytes = Bytes.toBytes(String.valueOf(column.asLong().intValue()));
|
||||||
break;
|
break;
|
||||||
case LONG:
|
case LONG:
|
||||||
bytes = Bytes.toBytes(column.asLong());
|
bytes = Bytes.toBytes(String.valueOf(column.asLong()));
|
||||||
break;
|
break;
|
||||||
case DOUBLE:
|
case DOUBLE:
|
||||||
bytes = Bytes.toBytes(column.asDouble());
|
bytes = Bytes.toBytes(String.valueOf(column.asDouble()));
|
||||||
break;
|
break;
|
||||||
case FLOAT:
|
case FLOAT:
|
||||||
bytes = Bytes.toBytes(column.asDouble().floatValue());
|
bytes = Bytes.toBytes(String.valueOf(column.asDouble().floatValue()));
|
||||||
break;
|
break;
|
||||||
case SHORT:
|
case SHORT:
|
||||||
bytes = Bytes.toBytes(column.asLong().shortValue());
|
bytes = Bytes.toBytes(String.valueOf(column.asLong().shortValue()));
|
||||||
break;
|
break;
|
||||||
case BOOLEAN:
|
case BOOLEAN:
|
||||||
bytes = Bytes.toBytes(column.asBoolean());
|
bytes = Bytes.toBytes(String.valueOf(column.asBoolean()));
|
||||||
break;
|
break;
|
||||||
case STRING:
|
case STRING:
|
||||||
bytes = this.getValueByte(columnType,column.asString());
|
bytes = this.getValueByte(columnType,column.asString());
|
||||||
|
@ -194,7 +194,7 @@ OracleReader插件实现了从Oracle读取数据。在底层实现上,OracleRe
|
|||||||
|
|
||||||
* **where**
|
* **where**
|
||||||
|
|
||||||
* 描述:筛选条件,MysqlReader根据指定的column、table、where条件拼接SQL,并根据这个SQL进行数据抽取。在实际业务场景中,往往会选择当天的数据进行同步,可以将where条件指定为gmt_create > $bizdate 。注意:不可以将where条件指定为limit 10,limit不是SQL的合法where子句。<br />
|
* 描述:筛选条件,OracleReader根据指定的column、table、where条件拼接SQL,并根据这个SQL进行数据抽取。在实际业务场景中,往往会选择当天的数据进行同步,可以将where条件指定为gmt_create > $bizdate 。注意:不可以将where条件指定为limit 10,limit不是SQL的合法where子句。<br />
|
||||||
|
|
||||||
where条件可以有效地进行业务增量同步。
|
where条件可以有效地进行业务增量同步。
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user