简体   繁体   English

如何在Pig脚本中注册类路径文件?

[英]How can i register classpath files in pig script?

Is there any way to add/register classpath property files (like eg: database.properties) in the pig script so that my application can read it. 有什么方法可以在Pig脚本中添加/注册类路径属性文件(例如:database.properties),以便我的应用程序可以读取它。 Note: Adding in to HADOOP/PIG_CLASSPATH is not working in my distribution. 注意:添加到HADOOP / PIG_CLASSPATH在我的发行版中不起作用。

How are you exactly executing your script and what are you needs? 您如何精确执行脚本,您需要什么? (file in frontend, backend, both,...). (文件在前端,后端,两者都...)。

Try packaging the .properties in a .jar and the registering that .jar in your pig script (this if you need .properties to be read in backend). 尝试将.properties打包到.jar中,并在Pig脚本中注册该.jar(如果需要在后端读取.properties的话)。

If you need that .properties in your frontend (executing in grunt) you will have to put your .properties in CLASSPATH. 如果您需要前端中的.properties(在grunt中执行),则必须将.properties放入CLASSPATH中。

And in you need it in frontend and backend, do both things told: .jar + CLASSPATH. 在前端和后端都需要它时,请执行以下两项操作:.jar + CLASSPATH。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM