小编emk*_*kay的帖子

我可以在Pig脚本中将参数传递给UDF吗?

我对PigScript比较陌生.我想知道是否有一种方法可以将参数传递给Pig中的Java UDF?

这是一个场景:我有一个日志文件,它有不同的列(每个列代表另一个表中的主键).我的任务是获取所选列中不同主键值的计数.我编写了一个Pig脚本,它可以获取不同的主键并计算它们.但是,我现在应该为每列编写一个新的UDF.有一个更好的方法吗?就像我可以将行号作为参数传递给UDF一样,它避免了我编写多个UDF的需要.

apache-pig

6
推荐指数
1
解决办法
3811
查看次数

如何在自定义技能中处理用户的"是"/"否"回复?

我正在尝试建立一个alexa自定义技能.我正面临一个问题,即我试图从用户那里得到是/否回答该技能要求用户提出的问题.

Alexa: Would you like to know the rules of the game?
User: <Can respond either Yes or No>
Run Code Online (Sandbox Code Playgroud)

根据用户响应,我想执行一个特定的操作.

这是我的意图架构:

{
    "intents": [
    {
        "intent": "AMAZON.StopIntent"
    },
    {
        "intent": "AMAZON.CancelIntent"
    },
    {
        "intent": "AMAZON.HelpIntent"
    },
    {
        "intent": "StartGame"
    },
    {
        "intent": "GetRules"
    }
  ]
}
Run Code Online (Sandbox Code Playgroud)

以下是我的示例话语:

StartGame Begin the game
StartGame Start the game

GetRules What are the rules
GetRules Get the rules
GetRules Tell me the rules
GetRules Tell me the rules again
Run Code Online (Sandbox Code Playgroud)

技能问用户的问题如下:

Welcome to the game. …
Run Code Online (Sandbox Code Playgroud)

alexa alexa-skill alexa-skills-kit amazon-echo alexa-slot

6
推荐指数
1
解决办法
6679
查看次数