mirror of https://github.com/apache/cassandra
Merge branch 'cassandra-1.2' into cassandra-2.0
Conflicts: build.xml debian/changelog
This commit is contained in:
commit
cb7eb8687d
|
|
@ -0,0 +1,11 @@
|
|||
-- CqlStorage
|
||||
libdata = LOAD 'cql://libdata/libout' USING CqlStorage();
|
||||
book_by_mail = FILTER libdata BY C_OUT_TY == 'BM';
|
||||
|
||||
libdata_buildings = FILTER libdata BY SQ_FEET > 0;
|
||||
state_flat = FOREACH libdata_buildings GENERATE STABR AS State,SQ_FEET AS SquareFeet;
|
||||
state_grouped = GROUP state_flat BY State;
|
||||
state_footage = FOREACH state_grouped GENERATE group AS State, SUM(state_flat.SquareFeet) AS TotalFeet:int;
|
||||
|
||||
insert_format= FOREACH state_footage GENERATE TOTUPLE(TOTUPLE('year',2011),TOTUPLE('state',State)),TOTUPLE(TotalFeet);
|
||||
STORE insert_format INTO 'cql://libdata/libsqft?output_query=UPDATE%20libdata.libsqft%20SET%20sqft%20%3D%20%3F' USING CqlStorage;
|
||||
|
|
@ -6,16 +6,4 @@ namegroups = GROUP colnames BY (chararray) $0;
|
|||
namecounts = FOREACH namegroups GENERATE COUNT($1), group;
|
||||
orderednames = ORDER namecounts BY $0 DESC;
|
||||
topnames = LIMIT orderednames 50;
|
||||
dump topnames;
|
||||
|
||||
-- CqlStorage
|
||||
libdata = LOAD 'cql://libdata/libout' USING CqlStorage();
|
||||
book_by_mail = FILTER libdata BY C_OUT_TY == 'BM';
|
||||
|
||||
libdata_buildings = FILTER libdata BY SQ_FEET > 0;
|
||||
state_flat = FOREACH libdata_buildings GENERATE STABR AS State,SQ_FEET AS SquareFeet;
|
||||
state_grouped = GROUP state_flat BY State;
|
||||
state_footage = FOREACH state_grouped GENERATE GROUP AS State, SUM(state_flat.SquareFeet) AS TotalFeet:int;
|
||||
|
||||
insert_format= FOREACH state_footage GENERATE TOTUPLE(TOTUPLE('year',2011),TOTUPLE('state',State)),TOTUPLE(TotalFeet);
|
||||
STORE insert_format INTO 'cql://libdata/libsqft?output_query=UPDATE%20libdata.libsqft%20SET%20sqft%20%3D%20%3F' USING CqlStorage;
|
||||
dump topnames;
|
||||
|
|
@ -17,6 +17,27 @@
|
|||
* under the License.
|
||||
*/
|
||||
package org.apache.cassandra.pig;
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.CharacterCodingException;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,27 @@
|
|||
* under the License.
|
||||
*/
|
||||
package org.apache.cassandra.pig;
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.CharacterCodingException;
|
||||
|
|
|
|||
Loading…
Reference in New Issue