Skip to content

[Bug] [hdfs] java.lang.NoSuchMethodException: com.dtstack.chunjun.connector.hdfs.source.HdfsPathFilter.<init>()  #1583

@libailin

Description

@libailin

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

读取hdfs报错:

2023-03-27 11:13:32,357 WARN  org.apache.flink.runtime.taskmanager.Task                    [] - Source: flinkx_mysql_hive_polling[1] -> Sink: sink[2] (1/1)#0 (42dd30ca27e35f6c4e6d8c187ad11b04_cbc357ccb763df2852fee8c4fc7d55f2_0_0) switched from RUNNING to FAILED with failure cause: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NoSuchMethodException: com.dtstack.chunjun.connector.hdfs.source.HdfsPathFilter.<init>()
	at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:135)
	at org.apache.hadoop.mapred.FileInputFormat.getInputPathFilter(FileInputFormat.java:170)
	at org.apache.hadoop.mapred.FileInputFormat.listStatus(FileInputFormat.java:225)
	at org.apache.hadoop.mapred.FileInputFormat.getSplits(FileInputFormat.java:325)
	at com.dtstack.chunjun.connector.hdfs.source.HdfsTextInputFormat.createHdfsSplit(HdfsTextInputFormat.java:60)
	at com.dtstack.chunjun.connector.hdfs.source.BaseHdfsInputFormat.createInputSplitsInternal(BaseHdfsInputFormat.java:87)
	at com.dtstack.chunjun.source.format.BaseRichInputFormat.createInputSplits(BaseRichInputFormat.java:128)
	at org.apache.flink.runtime.executiongraph.ExecutionJobVertex.initialize(ExecutionJobVertex.java:246)
	at org.apache.flink.runtime.executiongraph.DefaultExecutionGraph.initializeJobVertex(DefaultExecutionGraph.java:901)
	at org.apache.flink.runtime.executiongraph.DefaultExecutionGraph.initializeJobVertices(DefaultExecutionGraph.java:891)
	at org.apache.flink.runtime.executiongraph.DefaultExecutionGraph.attachJobGraph(DefaultExecutionGraph.java:848)
	at org.apache.flink.runtime.executiongraph.DefaultExecutionGraph.attachJobGraph(DefaultExecutionGraph.java:830)
	at org.apache.flink.runtime.executiongraph.DefaultExecutionGraphBuilder.buildGraph(DefaultExecutionGraphBuilder.java:203)
	at org.apache.flink.runtime.scheduler.DefaultExecutionGraphFactory.createAndRestoreExecutionGraph(DefaultExecutionGraphFactory.java:156)
	at org.apache.flink.runtime.scheduler.SchedulerBase.createAndRestoreExecutionGraph(SchedulerBase.java:361)
	at org.apache.flink.runtime.scheduler.SchedulerBase.<init>(SchedulerBase.java:206)
	at org.apache.flink.runtime.scheduler.DefaultScheduler.<init>(DefaultScheduler.java:134)
	at org.apache.flink.runtime.scheduler.DefaultSchedulerFactory.createInstance(DefaultSchedulerFactory.java:152)
	at org.apache.flink.runtime.jobmaster.DefaultSlotPoolServiceSchedulerFactory.createScheduler(DefaultSlotPoolServiceSchedulerFactory.java:119)
	at org.apache.flink.runtime.jobmaster.JobMaster.createScheduler(JobMaster.java:369)
	at org.apache.flink.runtime.jobmaster.JobMaster.<init>(JobMaster.java:346)
	at org.apache.flink.runtime.jobmaster.factories.DefaultJobMasterServiceFactory.internalCreateJobMasterService(DefaultJobMasterServiceFactory.java:123)
	at org.apache.flink.runtime.jobmaster.factories.DefaultJobMasterServiceFactory.lambda$createJobMasterService$0(DefaultJobMasterServiceFactory.java:95)
	at org.apache.flink.util.function.FunctionUtils.lambda$uncheckedSupplier$4(FunctionUtils.java:112)
	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoSuchMethodException: com.dtstack.chunjun.connector.hdfs.source.HdfsPathFilter.<init>()
	at java.lang.Class.getConstructor0(Class.java:3082)
	at java.lang.Class.getDeclaredConstructor(Class.java:2178)
	at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:129)
	... 27 more

	at com.dtstack.chunjun.source.format.BaseRichInputFormat.open(BaseRichInputFormat.java:150)
	at com.dtstack.chunjun.source.DtInputFormatSourceFunction.run(DtInputFormatSourceFunction.java:118)
	at org.apache.flink.streaming.api.operators.StreamSource.run(StreamSource.java:110)
	at org.apache.flink.streaming.api.operators.StreamSource.run(StreamSource.java:67)
	at org.apache.flink.streaming.runtime.tasks.SourceStreamTask$LegacySourceFunctionThread.run(SourceStreamTask.java:333)

What you expected to happen

--

How to reproduce


CREATE TABLE flinkx_mysql_hive_polling
(
    id        bigint
    ,user_id  bigint
    ,name     string
) WITH (
      'connector' = 'hdfs-x'
      ,'path' = 'hdfs://namenode.dfs.net:9000/home/hdp-test-test/hive/warehouse/hdp_test_test.db/flinkx_mysql_hive_polling/p_day=20220329'
      ,'default-fs' = 'hdfs://namenode.dfs.net:9000'
      ,'field-delimiter' = '\t'
      ,'encoding' = 'utf-8'
      ,'file-type' = 'text'
      ,'properties.hadoop.user.name' = 'hdp-test-test'
      ,'properties.fs.defaultFS' = 'hdfs://namenode.dfs.net:9000'
      ,'properties.dfs.client.failover.proxy.provider.ns' = 'org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider'
      ,'properties.fs.hdfs.impl.disable.cache' = 'true'
      ,'properties.fs.hdfs.impl' = 'org.apache.hadoop.hdfs.DistributedFileSystem'
      );

CREATE TABLE sink
(
    id        bigint
    ,user_id  bigint
    ,name     string
) WITH (
      'connector' = 'stream-x'
    ,'print' = 'true'
      );

insert into sink select * from flinkx_mysql_hive_polling;



Anything else

No response

Version

master

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions