gpt4 book ai didi

java - regexp_replace 异常

转载 作者:可可西里 更新时间:2023-11-01 16:17:31 26 4
gpt4 key购买 nike

我正在尝试在 Cloudera Hue 界面中运行一个配置单元查询,它可以很好地处理几百条记录。当我在更大的数据集上运行它时,它失败了。我试着在互联网上搜索它,但看起来有很多类似的错误,但不是我正在寻找的确切解决方案。我在我的配置单元查询中使用了 redexp_replace,我认为这不会导致任何异常(我的印象是它可以轻松处理字符串和 NULL 类型)

我得到的错误是 java.util.regex.PatternSyntaxException: Unmatched closing ')' near index 12

更新:这是导致问题的记录:

columnA:ReadData(或 ListDirectory)

B 列:列表目录)

C 列:NULL

D 列:NULL

我的查询:regexp_replace(columnA , columnB , "") 作为 columnA,B列regexp_replace(columnC , columnD , "") 作为 columnC,

请让我知道哪里出错了。

这是日志中有趣的部分...*....[记录]...

  at org.apache.hadoop.hive.ql.exec.MapOperator.process(MapOperator.java:565)
at org.apache.hadoop.hive.ql.exec.ExecMapper.map(ExecMapper.java:143)
at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:50)
at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:418)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:333)
at org.apache.hadoop.mapred.Child$4.run(Child.java:268)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1408)
at org.apache.hadoop.mapred.Child.main(Child.java:262)
Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: java.io.IOException: DFSOutputStream is closed
at org.apache.hadoop.hive.ql.exec.FileSinkOperator.processOp(FileSinkOperator.java:620)
at org.apache.hadoop.hive.ql.exec.Operator.process(Operator.java:474)
at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:800)
at org.apache.hadoop.hive.ql.exec.SelectOperator.processOp(SelectOperator.java:84)
at org.apache.hadoop.hive.ql.exec.Operator.process(Operator.java:474)
at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:800)
at org.apache.hadoop.hive.ql.exec.TableScanOperator.processOp(TableScanOperator.java:83)
at org.apache.hadoop.hive.ql.exec.Operator.process(Operator.java:474)
at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:800)
at org.apache.hadoop.hive.ql.exec.MapOperator.process(MapOperator.java:546)
... 9 more
Caused by: java.io.IOException: DFSOutputStream is closed
at org.apache.hadoop.hdfs.DFSOutputStream.isClosed(DFSOutputStream.java:1239)
at org.apache.hadoop.hdfs.DFSOutputStream.writeChunk(DFSOutputStream.java:1407)
at org.apache.hadoop.fs.FSOutputSummer.writeChecksumChunk(FSOutputSummer.java:161)
at org.apache.hadoop.fs.FSOutputSummer.write1(FSOutputSummer.java:104)
at org.apache.hadoop.fs.FSOutputSummer.write(FSOutputSummer.java:90)
at org.apache.hadoop.fs.FSDataOutputStream$PositionCache.write(FSDataOutputStream.java:54)
at java.io.DataOutputStream.write(DataOutputStream.java:90)
at org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat$1.write(HiveIgnoreKeyTextOutputFormat.java:86)
at org.apache.hadoop.hive.ql.exec.FileSinkOperator.processOp(FileSinkOperator.java:606)
... 18 more

2013-05-31 16:35:20,090 INFO org.apache.hadoop.hive.ql.exec.MapOperator: 3 finished. closing...
2013-05-31 16:35:20,090 INFO org.apache.hadoop.hive.ql.exec.MapOperator: 3 forwarded 90478 rows
2013-05-31 16:35:20,090 INFO org.apache.hadoop.hive.ql.exec.MapOperator: DESERIALIZE_ERRORS:0
2013-05-31 16:35:20,090 INFO org.apache.hadoop.hive.ql.exec.TableScanOperator: 0 finished. closing...
2013-05-31 16:35:20,090 INFO org.apache.hadoop.hive.ql.exec.TableScanOperator: 0 forwarded 90478 rows
2013-05-31 16:35:20,090 INFO org.apache.hadoop.hive.ql.exec.SelectOperator: 1 finished. closing...
2013-05-31 16:35:20,090 INFO org.apache.hadoop.hive.ql.exec.SelectOperator: 1 forwarded 90478 rows
2013-05-31 16:35:20,090 INFO org.apache.hadoop.hive.ql.exec.FileSinkOperator: 2 finished. closing...
2013-05-31 16:35:20,090 INFO org.apache.hadoop.hive.ql.exec.FileSinkOperator: 2 forwarded 0 rows
2013-05-31 16:35:20,090 INFO org.apache.hadoop.hive.ql.exec.FileSinkOperator: TABLE_ID_1_ROWCOUNT:90478
2013-05-31 16:35:20,090 INFO org.apache.hadoop.hive.ql.exec.SelectOperator: 1 Close done
2013-05-31 16:35:20,090 INFO org.apache.hadoop.hive.ql.exec.TableScanOperator: 0 Close done
2013-05-31 16:35:20,090 INFO org.apache.hadoop.hive.ql.exec.MapOperator: 3 Close done
2013-05-31 16:35:20,090 INFO ExecMapper: ExecMapper: processed 90477 rows: used memory = 10815536
2013-05-31 16:35:20,097 INFO org.apache.hadoop.mapred.TaskLogsTruncater: Initializing logs' truncater with mapRetainSize=-1 and reduceRetainSize=-1
2013-05-31 16:35:20,099 ERROR org.apache.hadoop.security.UserGroupInformation: PriviledgedActionException as:hdfs (auth:SIMPLE) cause:java.io.IOException: Filesystem closed
2013-05-31 16:35:20,099 WARN org.apache.hadoop.mapred.Child: Error running child
java.io.IOException: Filesystem closed
at org.apache.hadoop.hdfs.DFSClient.checkOpen(DFSClient.java:552)
at org.apache.hadoop.hdfs.DFSInputStream.close(DFSInputStream.java:522)
at java.io.FilterInputStream.close(FilterInputStream.java:155)
at org.apache.hadoop.util.LineReader.close(LineReader.java:149)
at org.apache.hadoop.mapred.LineRecordReader.close(LineRecordReader.java:195)
at org.apache.hadoop.hive.ql.io.CombineHiveRecordReader.doClose(CombineHiveRecordReader.java:72)
at org.apache.hadoop.hive.ql.io.HiveContextAwareRecordReader.close(HiveContextAwareRecordReader.java:96)
at org.apache.hadoop.hive.shims.HadoopShimsSecure$CombineFileRecordReader.close(HadoopShimsSecure.java:273)
at org.apache.hadoop.mapred.MapTask$TrackedRecordReader.close(MapTask.java:223)
at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:422)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:333)
at org.apache.hadoop.mapred.Child$4.run(Child.java:268)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1408)
at org.apache.hadoop.mapred.Child.main(Child.java:262)
2013-05-31 16:35:20,102 WARN org.apache.hadoop.mapred.Task: Parent died. Exiting attempt_201305300036_0011_m_000000_1

最佳答案

我不完全理解您要完成的任务,但我可以告诉您,regex_replace 的第二个参数必须是有效的正则表达式。

您传递的值不是有效的表达式。具体来说,ListDirectory) 因为 ) 是正则表达式中的保留符号。

关于java - regexp_replace 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16863207/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com