의 맵에서 값을 추출 할 수 없습니다 : @ orangeoctopus의 조언에아파치 돼지에서 나는, <code>v</code>을 간단한 관계가 아파치 돼지
dump v;
(151364,[ 'ref'#'R813','highway'#'secondary', 'name:ga'#'Lána Chairdif', 'name'#'Cardiff Lane'],(31015271, 31053762))
(151368,[ 'ref'#'N1', 'oneway'#'yes','designation'#'Buses Only', 'highway'#'trunk', 'motor_vehicle'#'designated', 'name:ga'#'Cearnóg Pharnell Thoir', 'maxspeed'#'30', 'name'#'Parnell Square East'],(389365, 540403072))
(151596,[ 'name:en'#'Liffey', 'boundary'#'administrative', 'name:ga'#'An Life','admin_level'#'8', 'name'#'Liffey', 'waterway'#'river'],(1347749, 1426049020, 1347745, 1426049019, 1347742, 900075612))
(367947,[ 'maxspeed'#'80', 'ref'#'L2223','highway'#'tertiary'],(13259933, 2384217, 335978958))
(367952,['created_by'#'YahooApplet 1.0', 'name'#'Charnwood Avenue', 'highway'#'residential'],(2384386, 25963471, 14949594, 2384385, 6146344, 2384254))
(508603,[ 'ref'#'L3018','highway'#'tertiary', 'maxspeed'#'50', 'name'#'Shelerin Road'],(2854184, 2854168, 335978984, 2853307, 2384254, 335978978, 335978975, 2655735, 2655703, 392675957, 11676198, 920037194, 244531387, 2655952, 11675077))
(727153,[ 'ref'#'N8','highway'#'trunk', 'name'#'Merchants' Quay'],(354153, 453344873))
(727157,['highway'#'unclassified', 'oneway'#'yes', 'maxspeed'#'30', 'name'#'Kyle Street'],(354168, 354167))
(727159,['highway'#'unclassified', 'oneway'#'yes', 'maxspeed'#'30', 'name'#'North Main Street'],(354178, 465226768, 354167, 413995429, 72219131, 685537307, 1232381779, 354164))
(727161,[ 'maxspeed'#'30','highway'#'pedestrian', 'name'#'Maylor Street'],(1486492976, 1515360721, 1515360722, 1515345383, 1515344226, 1515344227, 1515344228, 1515344231))
, 나는 키 이름에 대한 어떠한 '
내 데이터를 재생 시도,
grunt> describe v;
2012-01-09 22:55:34,271 [main] WARN org.apache.pig.PigServer - Encountered Warning IMPLICIT_CAST_TO_CHARARRAY 1 time(s).
v: {id: int,tags: map[ ],nodes: (null)}
,691 : V는 동일한 스키마/구조를 가지고 두 경우 모두
(151364,[ ref#'R813', name:ga#'Lána Chairdif', name#'Cardiff Lane',highway#'secondary'],(31015271, 31053762))
(151368,[ motor_vehicle#'designated', name#'Parnell Square East', highway#'trunk', oneway#'yes',designation#'Buses Only', maxspeed#'30', name:ga#'Cearnóg Pharnell Thoir', ref#'N1'],(389365, 540403072))
(151596,[ name:en#'Liffey', boundary#'administrative', waterway#'river', name:ga#'An Life',admin_level#'8', name#'Liffey'],(1347749, 1426049020, 1347745, 1426049019, 1347742, 900075612))
(367947,[highway#'tertiary', maxspeed#'80', ref#'L2223'],(13259933, 2384217, 335978958))
(367952,[ name#'Charnwood Avenue',created_by#'YahooApplet 1.0', highway#'residential'],(2384386, 25963471, 14949594, 2384385, 6146344, 2384254))
(508603,[ maxspeed#'50', ref#'L3018', name#'Shelerin Road',highway#'tertiary'],(2854184, 2854168, 335978984, 2853307, 2384254, 335978978, 335978975, 2655735, 2655703, 392675957, 11676198, 920037194, 244531387, 2655952, 11675077))
(727153,[highway#'trunk', name#'Merchants' Quay', ref#'N8'],(354153, 453344873))
(727157,[ oneway#'yes', maxspeed#'30', name#'Kyle Street',highway#'unclassified'],(354168, 354167))
(727159,[ oneway#'yes', maxspeed#'30', name#'North Main Street',highway#'unclassified' (354178, 465226768, 354167, 413995429, 72219131, 685537307, 1232381779, 354164))
(727161,[highway#'pedestrian', name#'Maylor Street', maxspeed#'30'],(1486492976, 1515360721, 1515360722, 1515345383, 1515344226, 1515344227, 1515344228, 1515344231))
: 나는이 데이터를 가지고
는 다음 나는 tags
맵에서 하나의 값을 추출하려고 :
grunt> w = foreach v generate tags#'ref';
dump w;
그러나 일부 요소가 여기에 데이터를하더라도, 나에게 빈 데이터를 제공합니다. 이전으로
()
()
()
()
()
()
()
()
()
()
내가 시도 키 (@orangeoctopus에 따라 '솔루션)
w = foreach v generate tags#'\'ref\'';
그리고 나에게 같은 준'빈 '데이터를 작동하지 않았다'를 인용 '. (나는 또한 같은 '
및 "
의 다른 조합을 시도 "'ref'"
/'"ref"'
/등.하지만 모든 '\'ref\''
제외했다 유효하지 않은 돼지 라틴어 문법) 무슨 일이야
? 태그 값 (예 : filter v by tags#'highway' != ''
)을 기반으로 필터링을 시도하면지도에서 데이터를 추출 할 수 없다는 위의 문제와 일관성이 없으며 잘못된 결과가 나옵니까?
좋은 생각 예를 들면 다음과 같습니다! 그러나 나는 당신의 인용을 시도했으나 효과가 없었습니다. 그런 다음 키가없는 상태에서 데이터를 재생성했지만 여전히 작동하지 않았습니다 (업데이트 된 질문). 어떤 아이디어? – Rory
전체 돼지 스크립트를 보여줄 수 있습니까? 그리고 원시 데이터 몇 줄을 붙여 넣기 만하면됩니다. –