По умолчанию свиньи будут ожидать карту/программу уменьшения. Однако hasoop поставляется с реализацией по умолчанию для картператора/редуктора; который используется Pig - когда класс снижения карты не идентифицирован.
Далее Pig использует свойства Hadoop вместе со своими конкретными свойствами. Попробуйте установить, ниже свойств в скрипте свиньи, его также следует выбрать с помощью Pig.
SET mapred.mapper.class="<fully qualified classname for mapper>"
SET mapred.reducer.class="<fully qualified classname for reducer>"
То же самое можно установить с помощью опции -Dmapred.mapper.class
. Всесторонний список here на основе вашей установки Hadoop, свойство может быть также:
mapreduce.map.class
mapreduce.reduce.class
Просто FYI ...
hadoop.mapred устарели. Версии до 0.20.1 используются для обозначения. Версии после этого использование mapreduce.
Кроме того свинья имеет свой собственный набор свойств, которые можно просмотреть с помощью команды pig -help properties
e.g. in my pig installation, below are the properties:
The following properties are supported:
Logging:
verbose=true|false; default is false. This property is the same as -v switch
brief=true|false; default is false. This property is the same as -b switch
debug=OFF|ERROR|WARN|INFO|DEBUG; default is INFO. This property is the same as -d switch
aggregate.warning=true|false; default is true. If true, prints count of warnings
of each type rather than logging each warning.
Performance tuning:
pig.cachedbag.memusage=<mem fraction>; default is 0.2 (20% of all memory).
Note that this memory is shared across all large bags used by the application.
pig.skewedjoin.reduce.memusagea=<mem fraction>; default is 0.3 (30% of all memory).
Specifies the fraction of heap available for the reducer to perform the join.
pig.exec.nocombiner=true|false; default is false.
Only disable combiner as a temporary workaround for problems.
opt.multiquery=true|false; multiquery is on by default.
Only disable multiquery as a temporary workaround for problems.
opt.fetch=true|false; fetch is on by default.
Scripts containing Filter, Foreach, Limit, Stream, and Union can be dumped without MR jobs.
pig.tmpfilecompression=true|false; compression is off by default.
Determines whether output of intermediate jobs is compressed.
pig.tmpfilecompression.codec=lzo|gzip; default is gzip.
Used in conjunction with pig.tmpfilecompression. Defines compression type.
pig.noSplitCombination=true|false. Split combination is on by default.
Determines if multiple small files are combined into a single map.
pig.exec.mapPartAgg=true|false. Default is false.
Determines if partial aggregation is done within map phase,
before records are sent to combiner.
pig.exec.mapPartAgg.minReduction=<min aggregation factor>. Default is 10.
If the in-map partial aggregation does not reduce the output num records
by this factor, it gets disabled.
Miscellaneous:
exectype=mapreduce|local; default is mapreduce. This property is the same as -x switch
pig.additional.jars.uris=<comma seperated list of jars>. Used in place of register command.
udf.import.list=<comma seperated list of imports>. Used to avoid package names in UDF.
stop.on.failure=true|false; default is false. Set to true to terminate on the first error.
pig.datetime.default.tz=<UTC time offset>. e.g. +08:00. Default is the default timezone of the host.
Determines the timezone used to handle datetime datatype and UDFs. Additionally, any Hadoop property can be specified.
Привет @fred, Там проблема, я был в состоянии выполнить работу MR, НО БОЛЬШОЙ БОЛЬШОЙ проблема заключалась в том, что он сначала копирует вход в папку «inputDir», и только после этого он выполняет задание MapReduce (здесь Wordcount.jar). Поэтому копирование больших данных будет трудоемким и менее эффективным. Можете ли вы предложить альтернативу не копировать данные и использовать код MapReduce? –
Я не уверен, является ли МАГАЗИН A INTO 'inputDir' обязательным. Если это не так, просто пропустите его. Если это так, просто скопируйте некоторые небольшие фиктивные данные в какое-то место, но прочитайте с реального/большого ввода в вашей программе mapreduce. – Frederic
Спасибо @Fred, это сработало для меня, хотя я не мог избежать функции Store.Удивление Если я внедрил свои собственные считыватели свиней и прочитал данные через этот загрузчик с помощью Load Command, тогда эта методика может не сработать. Если любой альтернативный способ использования Pig Loader. Поставка данных в Mapreduce можно найти, то это будет Бонус , Спасибо за помощь.!! –