Skip to main content
somi
Silver ⭐️
March 15, 2020
Solved

apache pig error in loading

I am facing the following error on the cmd:

 

command:

grunt> A =  LOAD 'C:\data\myfile.txt';

or 

grunt> a = load 'c:\data\myfile.txt' using PigStorage(' ') as (f1:int,f2:int, f3:int);

error:
<line 1, column 14>  Unexpected character 'D'
2020-03-15 20:56:50,153 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: <line 1, column 14>  Unexpected character 'D'
Details at logfile: C:\deploy\logs\pig_1584281243336.log

 

 

the error trace is as follows- 

Pig Stack Trace
---------------
ERROR 1200: <line 1, column 14>  Unexpected character 'D'
Failed to parse: <line 1, column 14>  Unexpected character 'D'
 at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:246)
 at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:182)
 at org.apache.pig.PigServer$Graph.validateQuery(PigServer.java:1792)
 at org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1765)
 at org.apache.pig.PigServer.registerQuery(PigServer.java:708)
 at org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:1110)
 at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:512)
 at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:230)
 at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:205)
 at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:66)
 at org.apache.pig.Main.run(Main.java:564)
 at org.apache.pig.Main.main(Main.java:175)
 
 
 
theKira
theKiraAnswer
Gold ⭐️
April 13, 2022

You should represent your data in this case: 'C:\\data\\myfile.txt'.

I had the same problem. 

3 replies

ask_bill_brooks
Platinum ⭐️
Platinum ⭐️
March 15, 2020

Hi @somi, 

Just looking at the error message alone, it seems to me like the problem is with your data file. Can you post the first few lines of the input data file myfile.txt in this thread?

 

 

Translate
Bill Brooks, Community Moderator Was your question answered? Make sure to mark the answer as the accepted solution. If you find a reply useful, say thanks by clicking on the thumbs up button.
somi
somiAuthor
Silver ⭐️
March 16, 2020

sir myfile.txt contains simply the following trial data-

 

 

1 2 3

4 5 6

Translate
theKira
theKiraAnswer
Gold ⭐️
April 13, 2022

You should represent your data in this case: 'C:\\data\\myfile.txt'.

I had the same problem. 

Translate