Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Pig >> mail # user >> ORDER BY a map value fails with a syntax error - pig bug?


Copy link to this message
-
RE: ORDER BY a map value fails with a syntax error - pig bug?
http://pig.apache.org/docs/r0.12.0/basic.html#order-by says
"Pig currently supports ordering on fields with simple types or by tuple designator (*). You cannot order on fields with complex types or by expressions."

I think "you cannot order ... by expressions" means the behavior you see is expected.

William F Dowling
Senior Technologist
Thomson Reuters
-----Original Message-----
From: Ruslan Al-Fakikh [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 29, 2013 2:35 PM
To: [EMAIL PROTECTED]
Subject: ORDER BY a map value fails with a syntax error - pig bug?

Hi guys,

The following script:

A = LOAD 'input' AS (M:map []);
sorted = ORDER A BY M#'key1';
dump sorted;

gives:
2013-10-29 14:31:03,611 [main] ERROR org.apache.pig.tools.grunt.Grunt -
ERROR 1200: <file script1.pig, line 2, column 20>  Syntax error, unexpected
symbol at or near 'M'

While this one:
 LOAD 'input' AS (M:map []);
named = foreach A generate *, M#'key1' as myfield;
sorted = ORDER named BY myfield;
dump sorted;

is OK

Is it a bug in Pig?

Best Regards,
Ruslan Al-Fakikh
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB