Comments (9)
Please provide the schema of oracle table and hive table.
from seatunnel.
hive table below,Oracle same cloumns
-- drop table if exists ghydata.ods_webcsmsgl_ecsms_visit_info_mi;
CREATE TABLE IF NOT EXISTS ghydata.ods_webcsmsgl_ecsms_visit_info_mi
(
isvisit string COMMENT '',
clwz string COMMENT '',
content string COMMENT '',
plan string COMMENT ' ',
cuser string COMMENT '创建',
cdate timestamp COMMENT '时间',
zhanbi decimal(12, 2) COMMENT ' ',
entertime timestamp COMMENT '进',
leavetime timestamp COMMENT '离'
)
COMMENT 'SFA-'
PARTITIONED BY (dt_mon string COMMENT '月快照增量表')
STORED AS PARQUET;
from seatunnel.
It's better to provide the definition of the "zhanbi" field in the Oracle table. It seems like there might be an issue with the type conversion of the Oracle connector.
from seatunnel.
But it works well on seatunnel1.5.7,so i don't what is the reason that cause this
Oralce below:
Column Name # Type Type Mod Not Null Default Comment
ZHANBI 11 NUMBER(12,2) [NULL] false [NULL] 占比
from seatunnel.
Because the scale of the field ZHANBI
is 2, the field type will set to Decimal(38, 18)
.
❯ parq ./T_836191201227964417_6d287c425d_0_1_0.parquet -s 18:45:25
# Schema
<pyarrow._parquet.ParquetSchema object at 0x7ff161507b40>
required group field_id=-1 SeaTunnelRecord {
optional fixed_len_byte_array(16) field_id=-1 f (Decimal(precision=38, scale=18));
}
You can use sql cast the field as decimal(12, 2)
. Like this:
source {
Jdbc {
result_table_name = tbl
driver = oracle.jdbc.driver.OracleDriver
url = "jdbc:oracle:thin:@localhost:49161/xe"
user = xxxxx
password = xxx
query = "select F from tbl"
properties {
database.oracle.jdbc.timezoneAsRegion = "false"
}
}
}
transform {
sql {
source_table_name = tbl
result_table_name = t_tbl
query = "select cast(F as decimal(12,2)) as F1 from tbl"
}
}
sink {
LocalFile {
source_table_name = t_tbl
path = "/tmp/hive/warehouse/test3"
file_format_type = "parquet"
}
}
from seatunnel.
This issue has been solved at #5872. If you consider upgrading, you can also use the latest version 2.3.5
, so you don't need to use sql transform.
from seatunnel.
Great, the problem is solved, which means that I can directly use decimal(38,18) or decimal(38,0) to process any precision numbers in the future.
from seatunnel.
@hailin0 please close this issue.
from seatunnel.
This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs.
from seatunnel.
Related Issues (20)
- [Bug] [Sink] java.net.UnknownHostException HOT 7
- [Feature][V2 connector] LocalFile config option datetime_format support yyyy-MM-dd HH:mm:ss.SSS
- [Feature][transform Plugin] Can transformer dynamically load plugins like Connectors
- [Feature][Zeta Engine UI] Add zeta engine UI.
- How to set the master node in seatunnel2.3.3 cluster deployment?
- [Bug] [mysql cdc] org.apache.seatunnel.connectors.seatunnel.cdc.mysql.source.MySqlDialect.getPrimaryKey< Error NullPointerException> HOT 1
- [Bug] [Hive Connector] Hive Connector Kerberos auto Failed
- SeaTunnel community meeting Topic collect HOT 5
- [Bug] [Cluster deploy] java.lang.NoSuchMethodError
- [Bug] [JDBC SQLServer] Doesn't support SQLSERVER type 'UNIQUEIDENTIFIER' on column 'RowPointer' yet
- [Bug] [FTP Sink] FTPException: Client not connected (XML -> XML)
- [Bug] [S3AFile Sink] s3aFile as sink,SeaTunnel rename file HOT 2
- [Bug] [kafka-sink] canal_json 输出格式不正确 HOT 3
- [Bug] [Connectors-v2 CDC] SQLServer CDC Don't support SqlSever type 'uniqueidentifier' yet HOT 1
- sourceSplits.isEmpty() in tdengine reader's pollNext will continue to loop. If there is no sourceSplits in a certain partition, the batch processing task will not end.
- [Feature][Zeta engine] Added the metrics information of table statistics in multi-table mode
- [Bug] [SQLServer CDC2 Doris] field uses the keyword HOT 1
- [Bug] [SQLServer CDC2Doris] Data write error
- [Bug] [SQLServer CDC2Doris] Data write error HOT 1
- [Bug] [Doris 2 Doris] Unsupported doris type: JSON HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from seatunnel.