您现在的位置是:课程教程文章
kettle postgresql 乱码怎么解决
2023-12-18 20:48课程教程文章 人已围观
-
kettle实战
kettle实战基本介绍: 本套kettle实战课程,注重实战,精讲细讲,不明白的同学私信老师... -
中国PostgreSQL认证考试中心认证初级(PC
中国PostgreSQL认证考试中心认证初级(PC为响应国家大数据战略发展的号召,进一步推动PostgreSQL开源数据库在国内的快... -
kettle 8.2 sakila数据库 ETL项目基础进阶实战
kettle 8.2 sakila数据库 ETL项目基础进阶实战课程咨询、获取课件、技术交流直接加入博学谷在线学习: 631731828 一、 课程简... -
通俗易懂的企业级ETL工具Kettle入门+案例
通俗易懂的企业级ETL工具Kettle入门+案例课程购买咨询和资料获取请加老师QQ 2020363447 ETL(Extract-Transform-Load的缩写,即数...
kettle使用文件导入到Postgresql出现如下几种问题的总结:
第一种错误,报错如ERROR: extra data after last expected column所示。或者报错为报错为0x05,多一列,extra data after last expected column。
sql查询语句定位到某个字段:
SELECT * ),'%')
解决方法,使用空替代,原因是出现特殊字符,),这种字符,导致的错误。
解决方法如下所示:
public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException { Object[] r = getRow(); if (r == null) { setOutputDone(); return false; } // It is always safest to call createOutputRow() to ensure that your output row’s Object[] is large // enough to handle any new fields you are creating in this step. r = createOutputRow(r, data.outputRowMeta.size()); String 字段名称 = get(Fields.In, "字段名称").getString(r); if(字段名称 != null) { 字段名称 = 字段名称.replaceAll(( + "", ""); } get(Fields.Out, "字段名称").setValue(r, 字段名称); // Send the row on to the next step. putRow(data.outputRowMeta, r); return true; }
第二种错误,报错如missing data for column "datastamp"。
sql查询语句定位到某个字段:
SELECT * ),'%')
或者
SELECT * ),'%')
解决方法:是字段的值出现了,换行回车,),)。)多一行,少n列,missing data column xxx。解决方法:使用字符替代,然后再替换回来。
解决方法如下所示:
public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException { Object[] r = getRow(); if (r == null) { setOutputDone(); return false; } // It is always safest to call createOutputRow() to ensure that your output row’s Object[] is large // enough to handle any new fields you are creating in this step. r = createOutputRow(r, data.outputRowMeta.size()); String 字段名称 = get(Fields.In, "字段名称").getString(r); if(字段名称 != null) { 字段名称 = 字段名称.replaceAll("\\r", "@#r;"); 字段名称 = 字段名称.replaceAll("\\n", "@#n;"); } get(Fields.Out, "字段名称").setValue(r, 字段名称); // Send the row on to the next step. putRow(data.outputRowMeta, r); return true; }
第三种错误,报错如,0x00的解决方法:
sql查询语句定位到某个字段:
SELECT * ),'%')
解决方法:
public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException { Object[] r = getRow(); if (r == null) { setOutputDone(); return false; } // It is always safest to call createOutputRow() to ensure that your output row’s Object[] is large // enough to handle any new fields you are creating in this step. r = createOutputRow(r, data.outputRowMeta.size()); // Get the value from an input field String 字段名称 = get(Fields.In, "字段名称").getString(r); if(字段名称 != null) { 字段名称= 字段名称.replaceAll("\\u0000", ""); } get(Fields.Out, "字段名称").setValue(r, 字段名称); // Send the row on to the next step. putRow(data.outputRowMeta, r); return true; }
Python学习网,大量的免费PostgreSQL入门教程,欢迎在线学习!
课程教程:kettle postgresql 乱码怎么解决下一篇:没有了