Yingyi Bu has submitted this change and it was merged.

Change subject: ASTERIXDB-1589, ASTERIXDB-1627 addition and fix.
......................................................................


ASTERIXDB-1589, ASTERIXDB-1627 addition and fix.

- Add support for proxy when using TwitterFeed.
- Fix corrupted polygon values when created from open list of doubles.
- Add regression test for ASTERIXDB-1627.

Change-Id: Ia8bdd0fbb63310212364ab9e52d34fec675a4c71
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1261
Tested-by: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Reviewed-by: Yingyi Bu <buyin...@gmail.com>
---
A 
asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/polygon-from-open-list_issue1627/polygon-from-open-list_issue1627.1.ddl.aql
A 
asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/polygon-from-open-list_issue1627/polygon-from-open-list_issue1627.2.update.aql
A 
asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/polygon-from-open-list_issue1627/polygon-from-open-list_issue1627.3.query.aql
A 
asterixdb/asterix-app/src/test/resources/runtimets/results/constructor/polygon-from-open-list_issue1627/polygon-from-open-list_issue1627.1.adm
M asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml
M 
asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataConstants.java
M 
asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/TwitterUtil.java
M 
asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/CreatePolygonDescriptor.java
8 files changed, 132 insertions(+), 13 deletions(-)

Approvals:
  Yingyi Bu: Looks good to me, approved
  Jenkins: Verified; Verified

Objections:
  Jenkins: Violations found



diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/polygon-from-open-list_issue1627/polygon-from-open-list_issue1627.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/polygon-from-open-list_issue1627/polygon-from-open-list_issue1627.1.ddl.aql
new file mode 100644
index 0000000..faf6082
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/polygon-from-open-list_issue1627/polygon-from-open-list_issue1627.1.ddl.aql
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+/*
+* Description  : Fix corrupted polygon values from open list of doubles
+* Expected Res : Success
+* Issue        : 1627
+* Date         : 07th Oct. 2016
+*/
+drop dataverse test if exists;
+create dataverse test
+use dataverse test
+
+create type StateType as {
+id: int32
+}
+
+create dataset States(StateType)
+primary key id
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/polygon-from-open-list_issue1627/polygon-from-open-list_issue1627.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/polygon-from-open-list_issue1627/polygon-from-open-list_issue1627.2.update.aql
new file mode 100644
index 0000000..5beb303
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/polygon-from-open-list_issue1627/polygon-from-open-list_issue1627.2.update.aql
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+/*
+* Description  : Fix corrupted polygon values from open list of doubles
+* Expected Res : Success
+* Issue        : 1627
+* Date         : 07th Oct. 2016
+*/
+use dataverse test
+insert into dataset States (
+{
+"id":0,
+"coordinates":[ -87.359296, 35.00118, -85.606675, 34.984749, -85.431413, 
34.124869, -85.184951, 32.859696, -85.069935, 32.580372, -84.960397, 32.421541, 
-85.004212, 32.322956, -84.889196, 32.262709, -85.058981, 32.13674, -85.053504, 
32.01077, -85.141136, 31.840985, -85.042551, 31.539753, -85.113751, 31.27686, 
-85.004212, 31.003013, -85.497137, 30.997536, -87.600282, 30.997536, 
-87.633143, 30.86609, -87.408589, 30.674397, -87.446927, 30.510088, -87.37025, 
30.427934, -87.518128, 30.280057, -87.655051, 30.247195, -87.90699, 30.411504, 
-87.934375, 30.657966, -88.011052, 30.685351, -88.10416, 30.499135, -88.137022, 
30.318396, -88.394438, 30.367688, -88.471115, 31.895754, -88.241084, 33.796253, 
-88.098683, 34.891641, -88.202745, 34.995703, -87.359296, 35.00118, -94.473842, 
36.501861, -90.152536, 36.496384, -90.064905, 36.304691, -90.218259, 36.184199, 
-90.377091, 35.997983, -89.730812, 35.997983, -89.763673, 35.811767, 
-89.911551, 35.756997, -89.944412, 35.603643, -90.130628, 35.4
 39335, -90.114197, 35.198349, -90.212782, 35.023087, -90.311367, 34.995703, 
-90.251121, 34.908072, -90.409952, 34.831394, -90.481152, 34.661609, 
-90.585214, 34.617794, -90.568783, 34.420624, -90.749522, 34.365854, 
-90.744046, 34.300131, -90.952169, 34.135823, -90.891923, 34.026284, 
-91.072662, 33.867453, -91.231493, 33.560744, -91.056231, 33.429298, 
-91.143862, 33.347144, -91.089093, 33.13902, -91.16577, 33.002096, -93.608485, 
33.018527, -94.041164, 33.018527, -94.041164, 33.54979, -94.183564, 33.593606, 
-94.380734, 33.544313, -94.484796, 33.637421, -94.430026, 35.395519, 
-94.616242, 36.501861, -94.473842, 36.501861, -109.042503, 37.000263, 
-109.04798, 31.331629, -111.074448, 31.331629, -112.246513, 31.704061, 
-114.815198, 32.492741, -114.72209, 32.717295, -114.524921, 32.755634, 
-114.470151, 32.843265, -114.524921, 33.029481, -114.661844, 33.034958, 
-114.727567, 33.40739, -114.524921, 33.54979, -114.497536, 33.697668, 
-114.535874, 33.933176, -114.415382, 34.108438, -114.256
 551, 34.174162, -114.136058, 34.305608, -114.333228, 34.448009, -114.470151, 
34.710902, -114.634459, 34.87521, -114.634459, 35.00118, -114.574213, 
35.138103, -114.596121, 35.324319, -114.678275, 35.516012, -114.738521, 
36.102045, -114.371566, 36.140383, -114.251074, 36.01989, -114.152489, 
36.025367, -114.048427, 36.195153, -114.048427, 37.000263, -110.499369, 
37.00574, -109.042503, 37.000263, -123.233256, 42.006186, -122.378853, 
42.011663, -121.037003, 41.995232, -120.001861, 41.995232, -119.996384, 
40.264519, -120.001861, 38.999346, -118.71478, 38.101128, -117.498899, 
37.21934, -116.540435, 36.501861, -115.85034, 35.970598, -114.634459, 35.00118, 
-114.634459, 34.87521, -114.470151, 34.710902, -114.333228, 34.448009, 
-114.136058, 34.305608, -114.256551, 34.174162, -114.415382, 34.108438, 
-114.535874, 33.933176, -114.497536, 33.697668, -114.524921, 33.54979, 
-114.727567, 33.40739, -114.661844, 33.034958, -114.524921, 33.029481, 
-114.470151, 32.843265, -114.524921, 32.755634, 
 -114.72209, 32.717295, -116.04751, 32.624187, -117.126467, 32.536556, 
-117.24696, 32.668003, -117.252437, 32.876127, -117.329114, 33.122589, 
-117.471515, 33.297851, -117.7837, 33.538836, -118.183517, 33.763391, 
-118.260194, 33.703145, -118.413548, 33.741483, -118.391641, 33.840068, 
-118.566903, 34.042715, -118.802411, 33.998899, -119.218659, 34.146777, 
-119.278905, 34.26727, -119.558229, 34.415147, -119.875891, 34.40967, 
-120.138784, 34.475393, -120.472878, 34.448009, -120.64814, 34.579455, 
-120.609801, 34.858779, -120.670048, 34.902595, -120.631709, 35.099764, 
-120.894602, 35.247642, -120.905556, 35.450289, -121.004141, 35.461243, 
-121.168449, 35.636505, -121.283465, 35.674843, -121.332757, 35.784382, 
-121.716143, 36.195153, -121.896882, 36.315645, -121.935221, 36.638785, 
-121.858544, 36.6114, -121.787344, 36.803093, -121.929744, 36.978355, 
-122.105006, 36.956447, -122.335038, 37.115279, -122.417192, 37.241248, 
-122.400761, 37.361741, -122.515777, 37.520572, -122.515777, 37
 .783465, -122.329561, 37.783465, -122.406238, 38.15042, -122.488392, 
38.112082, -122.504823, 37.931343, -122.701993, 37.893004, -122.937501, 
38.029928, -122.97584, 38.265436, -123.129194, 38.451652, -123.331841, 
38.566668, -123.44138, 38.698114, -123.737134, 38.95553, -123.687842, 
39.032208, -123.824765, 39.366301, -123.764519, 39.552517, -123.85215, 
39.831841, -124.109566, 40.105688, -124.361506, 40.259042, -124.410798, 
40.439781, -124.158859, 40.877937, -124.109566, 41.025814, -124.158859, 
41.14083, -124.065751, 41.442061, -124.147905, 41.715908, -124.257444, 
41.781632, -124.213628, 42.000709, -123.233256, 42.006186, -107.919731, 
41.003906, -105.728954, 40.998429, -104.053011, 41.003906, -102.053927, 
41.003906, -102.053927, 40.001626, -102.042974, 36.994786, -103.001438, 
37.000263, -104.337812, 36.994786, -106.868158, 36.994786, -107.421329, 
37.000263, -109.042503, 37.000263, -109.042503, 38.166851, -109.058934, 
38.27639, -109.053457, 39.125316, -109.04798, 40.998429, -107
 .919731, 41.003906, -73.053528, 42.039048, -71.799309, 42.022617, -71.799309, 
42.006186, -71.799309, 41.414677, -71.859555, 41.321569, -71.947186, 41.338, 
-72.385341, 41.261322, -72.905651, 41.28323, -73.130205, 41.146307, -73.371191, 
41.102491, -73.655992, 40.987475, -73.727192, 41.102491, -73.48073, 41.21203, 
-73.55193, 41.294184, -73.486206, 42.050002, -73.053528, 42.039048, -77.035264, 
38.993869, -76.909294, 38.895284, -77.040741, 38.791222, -77.117418, 38.933623, 
-77.035264, 38.993869, -75.414089, 39.804456, -75.507197, 39.683964, 
-75.611259, 39.61824, -75.589352, 39.459409, -75.441474, 39.311532, -75.403136, 
39.065069, -75.189535, 38.807653, -75.09095, 38.796699, -75.047134, 38.451652, 
-75.693413, 38.462606, -75.786521, 39.722302, -75.616736, 39.831841, 
-75.414089, 39.804456, -85.497137, 30.997536, -85.004212, 31.003013, 
-84.867289, 30.712735, -83.498053, 30.647012, -82.216449, 30.570335, 
-82.167157, 30.356734, -82.046664, 30.362211, -82.002849, 30.564858, 
-82.041187, 
 30.751074, -81.948079, 30.827751, -81.718048, 30.745597, -81.444201, 
30.707258, -81.383954, 30.27458, -81.257985, 29.787132, -80.967707, 29.14633, 
-80.524075, 28.461713, -80.589798, 28.41242, -80.56789, 28.094758, -80.381674, 
27.738757, -80.091397, 27.021277, -80.03115, 26.796723, -80.036627, 26.566691, 
-80.146166, 25.739673, -80.239274, 25.723243, -80.337859, 25.465826, 
-80.304997, 25.383672, -80.49669, 25.197456, -80.573367, 25.241272, -80.759583, 
25.164595, -81.077246, 25.120779, -81.170354, 25.224841, -81.126538, 25.378195, 
-81.351093, 25.821827, -81.526355, 25.903982, -81.679709, 25.843735, 
-81.800202, 26.090198, -81.833064, 26.292844, -82.041187, 26.517399, -82.09048, 
26.665276, -82.057618, 26.878877, -82.172634, 26.917216, -82.145249, 26.791246, 
-82.249311, 26.758384, -82.566974, 27.300601, -82.692943, 27.437525, 
-82.391711, 27.837342, -82.588881, 27.815434, -82.720328, 27.689464, 
-82.851774, 27.886634, -82.676512, 28.434328, -82.643651, 28.888914, 
-82.764143, 28.9984
 53, -82.802482, 29.14633, -82.994175, 29.179192, -83.218729, 29.420177, 
-83.399469, 29.518762, -83.410422, 29.66664, -83.536392, 29.721409, -83.640454, 
29.885717, -84.02384, 30.104795, -84.357933, 30.055502, -84.341502, 29.902148, 
-84.451041, 29.929533, -84.867289, 29.743317, -85.310921, 29.699501, 
-85.299967, 29.80904, -85.404029, 29.940487, -85.924338, 30.236241, -86.29677, 
30.362211, -86.630863, 30.395073, -86.910187, 30.373165, -87.518128, 30.280057, 
-87.37025, 30.427934, -87.446927, 30.510088, -87.408589, 30.674397, -87.633143, 
30.86609, -87.600282, 30.997536, -85.497137, 30.997536, -83.109191, 35.00118, 
-83.322791, 34.787579, -83.339222, 34.683517, -83.005129, 34.469916, 
-82.901067, 34.486347, -82.747713, 34.26727, -82.714851, 34.152254, -82.55602, 
33.94413, -82.325988, 33.81816, -82.194542, 33.631944, -81.926172, 33.462159, 
-81.937125, 33.347144, -81.761863, 33.160928, -81.493493, 33.007573, -81.42777, 
32.843265, -81.416816, 32.629664, -81.279893, 32.558464, -81.12106
 1, 32.290094, -81.115584, 32.120309, -80.885553, 32.032678, -81.132015, 
31.693108, -81.175831, 31.517845, -81.279893, 31.364491, -81.290846, 31.20566, 
-81.400385, 31.13446, -81.444201, 30.707258, -81.718048, 30.745597, -81.948079, 
30.827751, -82.041187, 30.751074, -82.002849, 30.564858, -82.046664, 30.362211, 
-82.167157, 30.356734, -82.216449, 30.570335, -83.498053, 30.647012, 
-84.867289, 30.712735, -85.004212, 31.003013, -85.113751, 31.27686, -85.042551, 
31.539753, -85.141136, 31.840985, -85.053504, 32.01077, -85.058981, 32.13674, 
-84.889196, 32.262709, -85.004212, 32.322956, -84.960397, 32.421541, 
-85.069935, 32.580372, -85.184951, 32.859696, -85.431413, 34.124869, 
-85.606675, 34.984749, -84.319594, 34.990226, -83.618546, 34.984749, 
-83.109191, 35.00118 ]}
+)
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/polygon-from-open-list_issue1627/polygon-from-open-list_issue1627.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/polygon-from-open-list_issue1627/polygon-from-open-list_issue1627.3.query.aql
new file mode 100644
index 0000000..3ae56a4
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/polygon-from-open-list_issue1627/polygon-from-open-list_issue1627.3.query.aql
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ */
+/*
+* Description  : Fix corrupted polygon values from open list of doubles
+* Expected Res : Success
+* Issue        : 1627
+* Date         : 07th Oct. 2016
+*/
+use dataverse test;
+
+for $x in dataset States
+return create-polygon($x.coordinates)
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/constructor/polygon-from-open-list_issue1627/polygon-from-open-list_issue1627.1.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/constructor/polygon-from-open-list_issue1627/polygon-from-open-list_issue1627.1.adm
new file mode 100644
index 0000000..d1d3a36
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/constructor/polygon-from-open-list_issue1627/polygon-from-open-list_issue1627.1.adm
@@ -0,0 +1 @@
+polygon("-87.359296,35.00118 -85.606675,34.984749 -85.431413,34.124869 
-85.184951,32.859696 -85.069935,32.580372 -84.960397,32.421541 
-85.004212,32.322956 -84.889196,32.262709 -85.058981,32.13674 
-85.053504,32.01077 -85.141136,31.840985 -85.042551,31.539753 
-85.113751,31.27686 -85.004212,31.003013 -85.497137,30.997536 
-87.600282,30.997536 -87.633143,30.86609 -87.408589,30.674397 
-87.446927,30.510088 -87.37025,30.427934 -87.518128,30.280057 
-87.655051,30.247195 -87.90699,30.411504 -87.934375,30.657966 
-88.011052,30.685351 -88.10416,30.499135 -88.137022,30.318396 
-88.394438,30.367688 -88.471115,31.895754 -88.241084,33.796253 
-88.098683,34.891641 -88.202745,34.995703 -87.359296,35.00118 
-94.473842,36.501861 -90.152536,36.496384 -90.064905,36.304691 
-90.218259,36.184199 -90.377091,35.997983 -89.730812,35.997983 
-89.763673,35.811767 -89.911551,35.756997 -89.944412,35.603643 
-90.130628,35.439335 -90.114197,35.198349 -90.212782,35.023087 
-90.311367,34.995703 -90.251121,34.908072 -9
 0.409952,34.831394 -90.481152,34.661609 -90.585214,34.617794 
-90.568783,34.420624 -90.749522,34.365854 -90.744046,34.300131 
-90.952169,34.135823 -90.891923,34.026284 -91.072662,33.867453 
-91.231493,33.560744 -91.056231,33.429298 -91.143862,33.347144 
-91.089093,33.13902 -91.16577,33.002096 -93.608485,33.018527 
-94.041164,33.018527 -94.041164,33.54979 -94.183564,33.593606 
-94.380734,33.544313 -94.484796,33.637421 -94.430026,35.395519 
-94.616242,36.501861 -94.473842,36.501861 -109.042503,37.000263 
-109.04798,31.331629 -111.074448,31.331629 -112.246513,31.704061 
-114.815198,32.492741 -114.72209,32.717295 -114.524921,32.755634 
-114.470151,32.843265 -114.524921,33.029481 -114.661844,33.034958 
-114.727567,33.40739 -114.524921,33.54979 -114.497536,33.697668 
-114.535874,33.933176 -114.415382,34.108438 -114.256551,34.174162 
-114.136058,34.305608 -114.333228,34.448009 -114.470151,34.710902 
-114.634459,34.87521 -114.634459,35.00118 -114.574213,35.138103 
-114.596121,35.324319 -114.678275
 ,35.516012 -114.738521,36.102045 -114.371566,36.140383 -114.251074,36.01989 
-114.152489,36.025367 -114.048427,36.195153 -114.048427,37.000263 
-110.499369,37.00574 -109.042503,37.000263 -123.233256,42.006186 
-122.378853,42.011663 -121.037003,41.995232 -120.001861,41.995232 
-119.996384,40.264519 -120.001861,38.999346 -118.71478,38.101128 
-117.498899,37.21934 -116.540435,36.501861 -115.85034,35.970598 
-114.634459,35.00118 -114.634459,34.87521 -114.470151,34.710902 
-114.333228,34.448009 -114.136058,34.305608 -114.256551,34.174162 
-114.415382,34.108438 -114.535874,33.933176 -114.497536,33.697668 
-114.524921,33.54979 -114.727567,33.40739 -114.661844,33.034958 
-114.524921,33.029481 -114.470151,32.843265 -114.524921,32.755634 
-114.72209,32.717295 -116.04751,32.624187 -117.126467,32.536556 
-117.24696,32.668003 -117.252437,32.876127 -117.329114,33.122589 
-117.471515,33.297851 -117.7837,33.538836 -118.183517,33.763391 
-118.260194,33.703145 -118.413548,33.741483 -118.391641,33.840068 -1
 18.566903,34.042715 -118.802411,33.998899 -119.218659,34.146777 
-119.278905,34.26727 -119.558229,34.415147 -119.875891,34.40967 
-120.138784,34.475393 -120.472878,34.448009 -120.64814,34.579455 
-120.609801,34.858779 -120.670048,34.902595 -120.631709,35.099764 
-120.894602,35.247642 -120.905556,35.450289 -121.004141,35.461243 
-121.168449,35.636505 -121.283465,35.674843 -121.332757,35.784382 
-121.716143,36.195153 -121.896882,36.315645 -121.935221,36.638785 
-121.858544,36.6114 -121.787344,36.803093 -121.929744,36.978355 
-122.105006,36.956447 -122.335038,37.115279 -122.417192,37.241248 
-122.400761,37.361741 -122.515777,37.520572 -122.515777,37.783465 
-122.329561,37.783465 -122.406238,38.15042 -122.488392,38.112082 
-122.504823,37.931343 -122.701993,37.893004 -122.937501,38.029928 
-122.97584,38.265436 -123.129194,38.451652 -123.331841,38.566668 
-123.44138,38.698114 -123.737134,38.95553 -123.687842,39.032208 
-123.824765,39.366301 -123.764519,39.552517 -123.85215,39.831841 -124.109566
 ,40.105688 -124.361506,40.259042 -124.410798,40.439781 -124.158859,40.877937 
-124.109566,41.025814 -124.158859,41.14083 -124.065751,41.442061 
-124.147905,41.715908 -124.257444,41.781632 -124.213628,42.000709 
-123.233256,42.006186 -107.919731,41.003906 -105.728954,40.998429 
-104.053011,41.003906 -102.053927,41.003906 -102.053927,40.001626 
-102.042974,36.994786 -103.001438,37.000263 -104.337812,36.994786 
-106.868158,36.994786 -107.421329,37.000263 -109.042503,37.000263 
-109.042503,38.166851 -109.058934,38.27639 -109.053457,39.125316 
-109.04798,40.998429 -107.919731,41.003906 -73.053528,42.039048 
-71.799309,42.022617 -71.799309,42.006186 -71.799309,41.414677 
-71.859555,41.321569 -71.947186,41.338 -72.385341,41.261322 -72.905651,41.28323 
-73.130205,41.146307 -73.371191,41.102491 -73.655992,40.987475 
-73.727192,41.102491 -73.48073,41.21203 -73.55193,41.294184 
-73.486206,42.050002 -73.053528,42.039048 -77.035264,38.993869 
-76.909294,38.895284 -77.040741,38.791222 -77.117418,38.933
 623 -77.035264,38.993869 -75.414089,39.804456 -75.507197,39.683964 
-75.611259,39.61824 -75.589352,39.459409 -75.441474,39.311532 
-75.403136,39.065069 -75.189535,38.807653 -75.09095,38.796699 
-75.047134,38.451652 -75.693413,38.462606 -75.786521,39.722302 
-75.616736,39.831841 -75.414089,39.804456 -85.497137,30.997536 
-85.004212,31.003013 -84.867289,30.712735 -83.498053,30.647012 
-82.216449,30.570335 -82.167157,30.356734 -82.046664,30.362211 
-82.002849,30.564858 -82.041187,30.751074 -81.948079,30.827751 
-81.718048,30.745597 -81.444201,30.707258 -81.383954,30.27458 
-81.257985,29.787132 -80.967707,29.14633 -80.524075,28.461713 
-80.589798,28.41242 -80.56789,28.094758 -80.381674,27.738757 
-80.091397,27.021277 -80.03115,26.796723 -80.036627,26.566691 
-80.146166,25.739673 -80.239274,25.723243 -80.337859,25.465826 
-80.304997,25.383672 -80.49669,25.197456 -80.573367,25.241272 
-80.759583,25.164595 -81.077246,25.120779 -81.170354,25.224841 
-81.126538,25.378195 -81.351093,25.821827 -81.52
 6355,25.903982 -81.679709,25.843735 -81.800202,26.090198 -81.833064,26.292844 
-82.041187,26.517399 -82.09048,26.665276 -82.057618,26.878877 
-82.172634,26.917216 -82.145249,26.791246 -82.249311,26.758384 
-82.566974,27.300601 -82.692943,27.437525 -82.391711,27.837342 
-82.588881,27.815434 -82.720328,27.689464 -82.851774,27.886634 
-82.676512,28.434328 -82.643651,28.888914 -82.764143,28.998453 
-82.802482,29.14633 -82.994175,29.179192 -83.218729,29.420177 
-83.399469,29.518762 -83.410422,29.66664 -83.536392,29.721409 
-83.640454,29.885717 -84.02384,30.104795 -84.357933,30.055502 
-84.341502,29.902148 -84.451041,29.929533 -84.867289,29.743317 
-85.310921,29.699501 -85.299967,29.80904 -85.404029,29.940487 
-85.924338,30.236241 -86.29677,30.362211 -86.630863,30.395073 
-86.910187,30.373165 -87.518128,30.280057 -87.37025,30.427934 
-87.446927,30.510088 -87.408589,30.674397 -87.633143,30.86609 
-87.600282,30.997536 -85.497137,30.997536 -83.109191,35.00118 
-83.322791,34.787579 -83.339222,34.683
 517 -83.005129,34.469916 -82.901067,34.486347 -82.747713,34.26727 
-82.714851,34.152254 -82.55602,33.94413 -82.325988,33.81816 
-82.194542,33.631944 -81.926172,33.462159 -81.937125,33.347144 
-81.761863,33.160928 -81.493493,33.007573 -81.42777,32.843265 
-81.416816,32.629664 -81.279893,32.558464 -81.121061,32.290094 
-81.115584,32.120309 -80.885553,32.032678 -81.132015,31.693108 
-81.175831,31.517845 -81.279893,31.364491 -81.290846,31.20566 
-81.400385,31.13446 -81.444201,30.707258 -81.718048,30.745597 
-81.948079,30.827751 -82.041187,30.751074 -82.002849,30.564858 
-82.046664,30.362211 -82.167157,30.356734 -82.216449,30.570335 
-83.498053,30.647012 -84.867289,30.712735 -85.004212,31.003013 
-85.113751,31.27686 -85.042551,31.539753 -85.141136,31.840985 
-85.053504,32.01077 -85.058981,32.13674 -84.889196,32.262709 
-85.004212,32.322956 -84.960397,32.421541 -85.069935,32.580372 
-85.184951,32.859696 -85.431413,34.124869 -85.606675,34.984749 
-84.319594,34.990226 -83.618546,34.984749 -83.1091
 91,35.00118")
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml 
b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml
index e90b2e7..85884f8 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml
@@ -1344,6 +1344,11 @@
       </compilation-unit>
     </test-case>
     <test-case FilePath="constructor">
+      <compilation-unit name="polygon-from-open-list_issue1627">
+        <output-dir 
compare="Text">polygon-from-open-list_issue1627</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="constructor">
       <compilation-unit name="primitive-01">
         <output-dir compare="Text">primitive-01</output-dir>
       </compilation-unit>
diff --git 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataConstants.java
 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataConstants.java
index c5167c1..7d27e45 100644
--- 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataConstants.java
+++ 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataConstants.java
@@ -103,6 +103,10 @@
     public static final String KEY_RECORD_FORMAT = "record-format";
     public static final String KEY_META_TYPE_NAME = "meta-type-name";
     public static final String READER_STREAM = "stream";
+    public static final String KEY_HTTP_PROXY_HOST = "http-proxy-host";
+    public static final String KEY_HTTP_PROXY_PORT = "http-proxy-port";
+    public static final String KEY_HTTP_PROXY_USER = "http-proxy-user";
+    public static final String KEY_HTTP_PROXY_PASSWORD = "http-proxy-password";
     /**
      * HDFS class names
      */
diff --git 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/TwitterUtil.java
 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/TwitterUtil.java
index 70d31c0..d8f375b 100644
--- 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/TwitterUtil.java
+++ 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/TwitterUtil.java
@@ -18,14 +18,6 @@
  */
 package org.apache.asterix.external.util;
 
-import org.apache.asterix.common.exceptions.AsterixException;
-import twitter4j.FilterQuery;
-import twitter4j.Twitter;
-import twitter4j.TwitterFactory;
-import twitter4j.TwitterStream;
-import twitter4j.TwitterStreamFactory;
-import twitter4j.conf.ConfigurationBuilder;
-
 import java.io.InputStream;
 import java.util.HashMap;
 import java.util.Map;
@@ -34,6 +26,15 @@
 import java.util.logging.Logger;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
+
+import org.apache.asterix.common.exceptions.AsterixException;
+
+import twitter4j.FilterQuery;
+import twitter4j.Twitter;
+import twitter4j.TwitterFactory;
+import twitter4j.TwitterStream;
+import twitter4j.TwitterStreamFactory;
+import twitter4j.conf.ConfigurationBuilder;
 
 public class TwitterUtil {
 
@@ -65,12 +66,11 @@
     /**
      * Gets more than one bounding box from a sequences of coordinates
      * (following Twitter formats) + predefined location names, as US and EU.
-     *
      * E.g., for EU and US, we would use -29.7, 79.2, 36.7, 72.0; -124.848974,
-     *      -66.885444, 24.396308, 49.384358.
+     * -66.885444, 24.396308, 49.384358.
      *
      * @param locationValue
-     *          String value of the location coordinates or names 
(comma-separated)
+     *            String value of the location coordinates or names 
(comma-separated)
      * @return
      * @throws AsterixException
      */
@@ -219,9 +219,25 @@
         cb.setOAuthConsumerSecret(oAuthConsumerSecret);
         cb.setOAuthAccessToken(oAuthAccessToken);
         cb.setOAuthAccessTokenSecret(oAuthAccessTokenSecret);
+        configureProxy(cb, configuration);
         return cb;
     }
 
+    private static void configureProxy(ConfigurationBuilder cb, Map<String, 
String> configuration) {
+        final String httpProxyHost = 
configuration.get(ExternalDataConstants.KEY_HTTP_PROXY_HOST);
+        final String httpProxyPort = 
configuration.get(ExternalDataConstants.KEY_HTTP_PROXY_PORT);
+        if (httpProxyHost != null && httpProxyPort != null) {
+            cb.setHttpProxyHost(httpProxyHost);
+            cb.setHttpProxyPort(Integer.parseInt(httpProxyPort));
+            final String httpProxyUser = 
configuration.get(ExternalDataConstants.KEY_HTTP_PROXY_USER);
+            final String httpProxyPassword = 
configuration.get(ExternalDataConstants.KEY_HTTP_PROXY_PASSWORD);
+            if (httpProxyUser != null && httpProxyPassword != null) {
+                cb.setHttpProxyUser(httpProxyUser);
+                cb.setHttpProxyPassword(httpProxyPassword);
+            }
+        }
+    }
+
     public static void initializeConfigurationWithAuthInfo(Map<String, String> 
configuration) throws AsterixException {
         String authMode = 
configuration.get(AuthenticationConstants.AUTHENTICATION_MODE);
         if (authMode == null) {
diff --git 
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/CreatePolygonDescriptor.java
 
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/CreatePolygonDescriptor.java
index 53958b4..9ba0e65 100644
--- 
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/CreatePolygonDescriptor.java
+++ 
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/CreatePolygonDescriptor.java
@@ -118,9 +118,10 @@
                                 
out.writeByte(ATypeTag.SERIALIZED_POLYGON_TYPE_TAG);
                                 out.writeShort(listAccessor.size() / 2);
 
+                                final int skipTypeTag = 
listAccessor.itemsAreSelfDescribing() ? 1 : 0;
                                 for (int i = 0; i < listAccessor.size() / 2; 
i++) {
-                                    int firstDoubleOffset = 
listAccessor.getItemOffset(i * 2);
-                                    int secondDobuleOffset = 
listAccessor.getItemOffset((i * 2) + 1);
+                                    int firstDoubleOffset = 
listAccessor.getItemOffset(i * 2) + skipTypeTag;
+                                    int secondDobuleOffset = 
listAccessor.getItemOffset((i * 2) + 1) + skipTypeTag;
 
                                     APointSerializerDeserializer.serialize(
                                             
ADoubleSerializerDeserializer.getDouble(listBytes, firstDoubleOffset),

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1261
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia8bdd0fbb63310212364ab9e52d34fec675a4c71
Gerrit-PatchSet: 4
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Wail Alkowaileet <wael....@gmail.com>
Gerrit-Reviewer: Ian Maxon <ima...@apache.org>
Gerrit-Reviewer: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Xikui Wang <xkk...@gmail.com>
Gerrit-Reviewer: Yingyi Bu <buyin...@gmail.com>

Reply via email to