Skip to content

Commit

Permalink
Merge pull request #191 from markhamstra/csd-2.2
Browse files Browse the repository at this point in the history
Merging Apache bugfixes
  • Loading branch information
markhamstra authored Oct 2, 2017
2 parents 56ac84c + b4c03d8 commit 3bf28b9
Show file tree
Hide file tree
Showing 31 changed files with 1,581 additions and 60 deletions.
12 changes: 5 additions & 7 deletions dev/create-release/release-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ GIT_REF=${GIT_REF:-master}
# Destination directory parent on remote server
REMOTE_PARENT_DIR=${REMOTE_PARENT_DIR:-/home/$ASF_USERNAME/public_html}

GPG="gpg --no-tty --batch"
GPG="gpg -u $GPG_KEY --no-tty --batch"
NEXUS_ROOT=https://repository.apache.org/service/local/staging
NEXUS_PROFILE=d63f592e7eac0 # Profile for Spark staging uploads
BASE_DIR=$(pwd)
Expand Down Expand Up @@ -116,7 +116,7 @@ else
echo "Please set JAVA_HOME correctly."
exit 1
else
JAVA_HOME="$JAVA_7_HOME"
export JAVA_HOME="$JAVA_7_HOME"
fi
fi
fi
Expand All @@ -131,7 +131,7 @@ DEST_DIR_NAME="spark-$SPARK_PACKAGE_VERSION"
function LFTP {
SSH="ssh -o ConnectTimeout=300 -o StrictHostKeyChecking=no -i $ASF_RSA_KEY"
COMMANDS=$(cat <<EOF
set net:max-retries 1 &&
set net:max-retries 2 &&
set sftp:connect-program $SSH &&
connect -u $ASF_USERNAME,p sftp://home.apache.org &&
$@
Expand Down Expand Up @@ -337,16 +337,14 @@ if [[ "$1" == "publish-snapshot" ]]; then
-DskipTests $PUBLISH_PROFILES clean deploy

# Clean-up Zinc nailgun process
/usr/sbin/lsof -P |grep $ZINC_PORT | grep LISTEN | awk '{ print $2; }' | xargs kill
lsof -P |grep $ZINC_PORT | grep LISTEN | awk '{ print $2; }' | xargs kill

rm $tmp_settings
cd ..
exit 0
fi

if [[ "$1" == "publish-release" ]]; then
SPARK_VERSION=$SPARK_PACKAGE_VERSION

cd spark
# Publish Spark to Maven release repo
echo "Publishing Spark checkout at '$GIT_REF' ($git_hash)"
Expand Down Expand Up @@ -377,7 +375,7 @@ if [[ "$1" == "publish-release" ]]; then
-DskipTests $PUBLISH_PROFILES clean install

# Clean-up Zinc nailgun process
/usr/sbin/lsof -P |grep $ZINC_PORT | grep LISTEN | awk '{ print $2; }' | xargs kill
lsof -P |grep $ZINC_PORT | grep LISTEN | awk '{ print $2; }' | xargs kill

./dev/change-version-to-2.10.sh

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ import org.apache.spark.metrics.source.Source

private[mesos] class MesosClusterSchedulerSource(scheduler: MesosClusterScheduler)
extends Source {
override def sourceName: String = "mesos_cluster"
override def metricRegistry: MetricRegistry = new MetricRegistry()

override val sourceName: String = "mesos_cluster"
override val metricRegistry: MetricRegistry = new MetricRegistry()

metricRegistry.register(MetricRegistry.name("waitingDrivers"), new Gauge[Int] {
override def getValue: Int = scheduler.getQueuedDriversSize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,21 @@ public void reset() {
* Cleans up memory for this column. The column is not usable after this.
* TODO: this should probably have ref-counted semantics.
*/
public abstract void close();
public void close() {
if (childColumns != null) {
for (int i = 0; i < childColumns.length; i++) {
if (childColumns[i] != null) {
childColumns[i].close();
childColumns[i] = null;
}
}
}
if (dictionaryIds != null) {
dictionaryIds.close();
dictionaryIds = null;
}
dictionary = null;
}

public void reserve(int requiredCapacity) {
if (requiredCapacity > capacity) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public long nullsNativeAddress() {

@Override
public void close() {
super.close();
Platform.freeMemory(nulls);
Platform.freeMemory(data);
Platform.freeMemory(lengthData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ public long nullsNativeAddress() {

@Override
public void close() {
super.close();
nulls = null;
byteData = null;
shortData = null;
intData = null;
longData = null;
floatData = null;
doubleData = null;
arrayLengths = null;
arrayOffsets = null;
}

//
Expand Down
70 changes: 70 additions & 0 deletions sql/core/src/test/resources/tpcds-modifiedQueries/q10.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
-- start query 10 in stream 0 using template query10.tpl
with
v1 as (
select
ws_bill_customer_sk as customer_sk
from web_sales,
date_dim
where ws_sold_date_sk = d_date_sk
and d_year = 2002
and d_moy between 4 and 4+3
union all
select
cs_ship_customer_sk as customer_sk
from catalog_sales,
date_dim
where cs_sold_date_sk = d_date_sk
and d_year = 2002
and d_moy between 4 and 4+3
),
v2 as (
select
ss_customer_sk as customer_sk
from store_sales,
date_dim
where ss_sold_date_sk = d_date_sk
and d_year = 2002
and d_moy between 4 and 4+3
)
select
cd_gender,
cd_marital_status,
cd_education_status,
count(*) cnt1,
cd_purchase_estimate,
count(*) cnt2,
cd_credit_rating,
count(*) cnt3,
cd_dep_count,
count(*) cnt4,
cd_dep_employed_count,
count(*) cnt5,
cd_dep_college_count,
count(*) cnt6
from customer c
join customer_address ca on (c.c_current_addr_sk = ca.ca_address_sk)
join customer_demographics on (cd_demo_sk = c.c_current_cdemo_sk)
left semi join v1 on (v1.customer_sk = c.c_customer_sk)
left semi join v2 on (v2.customer_sk = c.c_customer_sk)
where
ca_county in ('Walker County','Richland County','Gaines County','Douglas County','Dona Ana County')
group by
cd_gender,
cd_marital_status,
cd_education_status,
cd_purchase_estimate,
cd_credit_rating,
cd_dep_count,
cd_dep_employed_count,
cd_dep_college_count
order by
cd_gender,
cd_marital_status,
cd_education_status,
cd_purchase_estimate,
cd_credit_rating,
cd_dep_count,
cd_dep_employed_count,
cd_dep_college_count
limit 100
-- end query 10 in stream 0 using template query10.tpl
38 changes: 38 additions & 0 deletions sql/core/src/test/resources/tpcds-modifiedQueries/q19.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
-- start query 19 in stream 0 using template query19.tpl
select
i_brand_id brand_id,
i_brand brand,
i_manufact_id,
i_manufact,
sum(ss_ext_sales_price) ext_price
from
date_dim,
store_sales,
item,
customer,
customer_address,
store
where
d_date_sk = ss_sold_date_sk
and ss_item_sk = i_item_sk
and i_manager_id = 7
and d_moy = 11
and d_year = 1999
and ss_customer_sk = c_customer_sk
and c_current_addr_sk = ca_address_sk
and substr(ca_zip, 1, 5) <> substr(s_zip, 1, 5)
and ss_store_sk = s_store_sk
and ss_sold_date_sk between 2451484 and 2451513 -- partition key filter
group by
i_brand,
i_brand_id,
i_manufact_id,
i_manufact
order by
ext_price desc,
i_brand,
i_brand_id,
i_manufact_id,
i_manufact
limit 100
-- end query 19 in stream 0 using template query19.tpl
43 changes: 43 additions & 0 deletions sql/core/src/test/resources/tpcds-modifiedQueries/q27.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
-- start query 27 in stream 0 using template query27.tpl
with results as
(select i_item_id,
s_state,
ss_quantity agg1,
ss_list_price agg2,
ss_coupon_amt agg3,
ss_sales_price agg4
--0 as g_state,
--avg(ss_quantity) agg1,
--avg(ss_list_price) agg2,
--avg(ss_coupon_amt) agg3,
--avg(ss_sales_price) agg4
from store_sales, customer_demographics, date_dim, store, item
where ss_sold_date_sk = d_date_sk and
ss_sold_date_sk between 2451545 and 2451910 and
ss_item_sk = i_item_sk and
ss_store_sk = s_store_sk and
ss_cdemo_sk = cd_demo_sk and
cd_gender = 'F' and
cd_marital_status = 'D' and
cd_education_status = 'Primary' and
d_year = 2000 and
s_state in ('TN','AL', 'SD', 'SD', 'SD', 'SD')
--group by i_item_id, s_state
)

select i_item_id,
s_state, g_state, agg1, agg2, agg3, agg4
from (
select i_item_id, s_state, 0 as g_state, avg(agg1) agg1, avg(agg2) agg2, avg(agg3) agg3, avg(agg4) agg4 from results
group by i_item_id, s_state
union all
select i_item_id, NULL AS s_state, 1 AS g_state, avg(agg1) agg1, avg(agg2) agg2, avg(agg3) agg3,
avg(agg4) agg4 from results
group by i_item_id
union all
select NULL AS i_item_id, NULL as s_state, 1 as g_state, avg(agg1) agg1, avg(agg2) agg2, avg(agg3) agg3,
avg(agg4) agg4 from results
) foo
order by i_item_id, s_state
limit 100
-- end query 27 in stream 0 using template query27.tpl
Loading

0 comments on commit 3bf28b9

Please sign in to comment.