drop table Orders, Salesmen, T456a;
| 메모리에서 3개의 테이블을 삭제하는 줄입니다. |
Tab1:
Load * Inline [
Customer, Items, UnitPrice
Bob, 5, 1.50
];
Tab2:
LOAD Customer, Sum( Items * UnitPrice ) as Sales
resident Tab1
group by Customer;
drop table Tab1;
| Tab2 테이블이 만들어지면 Tab1 테이블이 삭제됩니다. |
// Load mapping table of country codes:
map1:
mapping LOAD *
Inline [
CCode, Country
Sw, Sweden
Dk, Denmark
No, Norway
] ;
// Load list of salesmen, mapping country code to country
// If the country code is not in the mapping table, put Rest of the world
Salespersons:
LOAD *,
ApplyMap('map1', CCode,'Rest of the world') As Country
Inline [
CCode, Salesperson
Sw, John
Sw, Mary
Sw, Per
Dk, Preben
Dk, Olle
No, Ole
Sf, Risttu] ;
// We don't need the CCode anymore
Drop Field 'CCode';
Drop Mapping Table map1;
Metrics:
Load * Inline [
Transaction ID, Sales Amount, Sales Cost, City, Customer ID
1000012, 4509.33, 1234.22, Oslo, 250v9849
1000013, 1043.21, 180.23, Gothenburg, 195d5930
1000014, 6038.35, 1400.10, Copenhagen, 195d5930
];
| 이 예시는 Drop mapping table 변형을 사용하는 방법을 보여줍니다. 매핑 테이블 map1이(가) 생성된 다음, ApplyMap 함수와 함께 후속 LOAD 문에서 사용됩니다. 매핑 테이블이 사용된 후, 메모리에서 삭제되어 스크립트 실행의 후속 테이블에 로드될 데이터에 대한 RAM 사용량을 최적화합니다. 이 경우, 매핑 테이블에 몇 개의 행만 있는 경우 RAM 최적화는 미미할 것입니다. 하지만, 대규모 매핑 테이블의 경우 또는 루프 내에서 매핑 테이블을 생성할 때 성능을 크게 향상시킬 수 있습니다. |