问题标签 [hortonworks-dataflow]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
216 浏览

hadoop - 在 HIVE SQL 中转置

我正在尝试像下面这样转置。

0 投票
2 回答
2738 浏览

apache - 如何在 Apache NiFi 中自动化 DBCPConnectionPool 控制器服务?

我是 Apache NiFi 的新手,我的基本任务是使用 Apache Nifi 将来自多个数据库源的数据摄取到 HDFS 中。我将“DBCPConnectionPool”控制器服务用于数据库连接池服务,我需要在其中提供“数据库连接 URL”、“数据库驱动程序类名称”、“数据库驱动程序位置”、“数据库用户”、“密码”等信息。现在,由于我从多个数据源中提取,所以每次源数据库更改时,我都需要手动更改所有上述信息。我正在寻找一种方法,以便我们可以自动执行此任务。例如,“DBCPConnectionPool”控制器服务应该能够动态获取“数据库连接 URL”、“数据库驱动程序类名称”

0 投票
2 回答
3155 浏览

apache-nifi - Apche NiFi 不工作

我刚开始学习 Apache NIFI。我通过在 youtube 上观看此视频安装它 - https://www.youtube.com/watch?v=DDd6KayUHt8

我盲目地听从了他的话。但是当我在浏览器上输入http://localhost:9090/nifi(如视频中所述)时。没有任何效果。

我在命令提示符下收到此错误 -

错误 我尝试在谷歌上搜索解决方案,但找不到任何解决方案。有人请帮忙。

0 投票
1 回答
1569 浏览

apache - 如何从文件中动态读取 updateAttribute 中属性的值?

我使用“+”按钮在“updateAttribute”处理器中添加了一些自定义属性。例如:我声明了一个属性“DBConnectionURL”,并将其值设为“jdbc:mysql://localhost:3306/test”。然后,在“DBCPConnectionPool”服务控制器中,我简单地将值“${DBConnectionURL}”用于“数据库连接 URL”属性。但是,我手动给出了“DBConnectionURL”属性的值。我想要一种可以从文件中动态提供值的方法,这样我只需要更改文件中的值,并且“DBConnectionURL”的值会根据动态变化关于文件中存在的值。有没有办法做到这一点?

0 投票
2 回答
1108 浏览

hadoop - 在 Nifi 中,FirstInFirstOutPrioritizer 和 OldestFlowFileFirstPrioritizer 有什么区别

用户指南https://nifi.apache.org/docs/nifi-docs/html/user-guide.html包含以下有关优先级的详细信息,请您帮助我了解它们有何不同并提供任何实时示例。

FirstInFirstOutPrioritizer:给定两个流文件,首先处理连接的流文件。

OldestFlowFileFirstPrioritizer:给定两个 FlowFile,首先处理数据流中最旧的一个。“如果没有选择优先级,这是使用的默认方案。”

0 投票
1 回答
1222 浏览

regex - 正则表达式提取逗号分隔值?

我正在尝试从 csv 文件中读取值,然后使用 ExtractText 处理器将值存储到属性中。该文件仅包含一行,其中有 5 个以逗号分隔的值。这是我的文件的内容:

我在 ExtractText 处理器中手动添加了 5 个属性:-

现在,我想要我在 ExtractText 处理器中定义的上述 5 个属性的正则表达式,以便它们获得以下值:-

你能给我上面5个属性的正则表达式吗?

0 投票
1 回答
678 浏览

minify - “DBCPConnectionPool”服务不接受存储在属性中的值

以下是我正在使用的处理器组合:-

基本上,我有一个属性文件,其中包含“DBCPConnectionPool”控制器服务建立与数据库的连接所需的 5 个逗号分隔值。这是我的属性文件的内容:-

现在,我从这个属性文件中提取值并将它们存储在手动创建的属性中。我正在使用这个正则表达式将这些值存储到使用 ExtractText 的属性中。

然后使用 updateAttribute 处理器手动添加 5 个属性并从属性文件中获取它们的值,如下所示:

所以,到目前为止,属性已经从属性文件中获取了它们的值,因此下面的值存储在它们中:

最后,这是我想要实现的目标。我正在尝试在 DBCPConnectionPool 控制器服务中使用上述 5 个属性,如下所示:

但我无法建立连接,并且收到错误“无法创建 PoolableConnectionFactory”。控制器服务似乎无法从属性中读取值。如何将流文件属性传递给控制器​​服务?

0 投票
1 回答
268 浏览

apache - Why the ExpressionLanguageScope in DBCPConnectionPool service is limited to only 'VARIABLE_REGISTRY' and not ' FLOWFILE_ATTRIBUTES'?

The DBCPConnectionPool Service requires 5 connection parameters to establish connection to a database as shown in the picture below [Marked Yellow] enter image description here

I used UpdateAttribute Processor to manually add these 5 connection parameters and gave them their respective values as shown in the picture below [Marked Yellow] enter image description here

Now, when I was trying to read the values for the connection parameters in DBCPConnectionPool Service through these attributes (Shown in picture below) , I was unable to read them. enter image description here

To know the reason why the DBCPConnectionPool Service was unable to read the Flowfile attributes, I went ahead to check the source code for both DBCPConnectionPool Service and UpdateAttribute Processor.

https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/src/main/java/org/apache/nifi/dbcp/DBCPConnectionPool.java

https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-processor/src/main/java/org/apache/nifi/processors/attributes/UpdateAttribute.java

Souce code for DBCPConnectionPool Service : enter image description here

Souce code for UpdateAttribute Processor : enter image description here

Thus, I came to know the reason why it was unable to read the values from FlowFile attributes. This is because the ExpressionLanguageScope is limited to VARIABLE_REGISTRY and not FLOWFILE_ATTRIBUTES.

Now, My Question is that why the ExpressionLanguageScope for DBCPConnectionPool Service is limited to VARIABLE_REGISTRY. What is the reason for this limitation? The reason why I am asking this question is because I want to read the values for the connection parameters through FlowFile attributes.

0 投票
1 回答
2272 浏览

apache - 如何创建自定义 NiFi 控制器服务?

我正在尝试学习如何创建自定义 NiFi 控制器服务。一开始,我想DBCPConnectionPool通过简单地复制服务的原始源代码来模仿控制器DBCPConnectionPool服务。为了实现同样的功能,我从“nifi- service -bundle-archetype”生成了一个 maven 原型,并得到了以下项目结构 在此处输入图像描述

但是,当我从 'nifi - processor -bundle -archetype 生成原型时,我得到了以下结构: - 在此处输入图像描述

我知道在处理器的情况下,我只需要在MyProceesor.java当前nifi-ListDbTableDemo-processors文件夹下编写我的代码,然后从中创建一个 nar 文件。但在控制器服务的情况下,我生成了 4 个文件夹。我可以看到两个java文件,即

  1. StandardMyService.java出现在nifi-DbcpServiceDemo文件夹下

  2. MyService.java出现在nifi-DbcpServiceDemo-api文件夹下

现在,为什么在自定义控制器服务的情况下会生成两个java文件,而在自定义处理器的情况下只生成一个java文件。另外,由于我试图模仿DBCPConnectionPool服务,我应该在其中的两个 java 文件中复制服务的原始源代码DBCPConnectionPool

请从头开始指导我,创建与服务等效的自定义服务需要遵循的步骤DBCPConnectionPool

0 投票
1 回答
3102 浏览

xml - NiFi: get all elements of the same tag in XML using EvaluateXpath processor

Trying to parse the xml below in NiFi and would like to parse all the ids out and make multiple web service calls for each id.

Is there a way to parse out all the id inside Id tags? Either as an array ( 69E32281-0484, 3002AFCD-B494.............) or as a string (69E32281-0484 3002AFCD-B4942C9E17AC-9D97...............) using the Evaluate-XPath or Evaluate-xQuery Processors?

As the number of Ids are going to be dynamic. It is not possible to hard code the counter value like [0], [1], [2]........ to get the value of each id.

PS: There are many other ways to get this done in NiFi. But would like to know if there is a way to read XML with EvaluateXpath processor and get all the id tag values as an array or as a text.

Related links

1) https://community.hortonworks.com/questions/101922/how-to-use-evaluatexpath-to-get-xml-roots-attribut.html

2)https://community.hortonworks.com/questions/140605/evaluatexpath-cant-return-multiple-node-values.html