git commit: PHOENIX-788 Support cast from/to DATE/TIME/TIMESTAMP to/from LONG/UNSIGNED_LONG
Repository: phoenix Updated Branches: refs/heads/3.0 3640902c3 - 9c85887af PHOENIX-788 Support cast from/to DATE/TIME/TIMESTAMP to/from LONG/UNSIGNED_LONG Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/9c85887a Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/9c85887a Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/9c85887a Branch: refs/heads/3.0 Commit: 9c85887af4d48a7bac45171ddd2a33fbd310a440 Parents: 3640902 Author: James Taylor jtay...@salesforce.com Authored: Mon Jul 28 11:48:51 2014 -0700 Committer: James Taylor jtay...@salesforce.com Committed: Mon Jul 28 11:48:51 2014 -0700 -- .../org/apache/phoenix/end2end/BaseQueryIT.java | 196 +++ .../apache/phoenix/end2end/CaseStatementIT.java | 2 +- .../apache/phoenix/end2end/CastAndCoerceIT.java | 98 +- .../end2end/ClientTimeArithmeticQueryIT.java| 2 +- .../org/apache/phoenix/end2end/GroupByIT.java | 2 +- .../org/apache/phoenix/end2end/NotQueryIT.java | 2 +- .../org/apache/phoenix/end2end/QueryIT.java | 149 +- .../org/apache/phoenix/end2end/ScanQueryIT.java | 2 +- .../function/CeilDecimalExpression.java | 17 +- .../function/FloorDecimalExpression.java| 17 +- .../function/RoundDecimalExpression.java| 24 ++- .../org/apache/phoenix/parse/CastParseNode.java | 18 +- .../org/apache/phoenix/parse/CeilParseNode.java | 2 +- .../apache/phoenix/parse/FloorParseNode.java| 2 +- .../apache/phoenix/parse/RoundParseNode.java| 6 +- .../org/apache/phoenix/schema/PDataType.java| 15 ++ .../RoundFloorCeilExpressionsUnitTests.java | 5 +- 17 files changed, 383 insertions(+), 176 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/9c85887a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryIT.java new file mode 100644 index 000..f87e86c --- /dev/null +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryIT.java @@ -0,0 +1,196 @@ +/* + * 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. + */ +package org.apache.phoenix.end2end; + +import static org.apache.phoenix.util.TestUtil.TEST_PROPERTIES; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.sql.Connection; +import java.sql.Date; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.concurrent.atomic.AtomicInteger; + +import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; +import org.apache.hadoop.hbase.io.ImmutableBytesWritable; +import org.apache.hadoop.hbase.util.Bytes; +import org.apache.phoenix.hbase.index.write.IndexWriterUtils; +import org.apache.phoenix.query.QueryServices; +import org.apache.phoenix.util.ByteUtil; +import org.apache.phoenix.util.PhoenixRuntime; +import org.apache.phoenix.util.PropertiesUtil; +import org.apache.phoenix.util.ReadOnlyProps; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.experimental.categories.Category; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameters; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; + + + +/** + * + * Basic tests for Phoenix JDBC implementation + * + * + * @since 0.1 + */ + +@Category(ClientManagedTimeTest.class) +@RunWith(Parameterized.class) +public abstract class BaseQueryIT extends BaseClientManagedTimeIT { +protected static final String tenantId = getOrganizationId(); +protected static final String
git commit: PHOENIX-788 Support cast from/to DATE/TIME/TIMESTAMP to/from LONG/UNSIGNED_LONG
Repository: phoenix Updated Branches: refs/heads/4.0 e8def027a - d372c6591 PHOENIX-788 Support cast from/to DATE/TIME/TIMESTAMP to/from LONG/UNSIGNED_LONG Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/d372c659 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/d372c659 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/d372c659 Branch: refs/heads/4.0 Commit: d372c6591d22e7240ef900cd14160be80ef2f73b Parents: e8def02 Author: James Taylor jtay...@salesforce.com Authored: Mon Jul 28 11:48:51 2014 -0700 Committer: James Taylor jtay...@salesforce.com Committed: Mon Jul 28 12:41:40 2014 -0700 -- .../org/apache/phoenix/end2end/BaseQueryIT.java | 138 +++ .../apache/phoenix/end2end/CaseStatementIT.java | 2 +- .../apache/phoenix/end2end/CastAndCoerceIT.java | 98 - .../end2end/ClientTimeArithmeticQueryIT.java| 2 +- .../org/apache/phoenix/end2end/GroupByIT.java | 2 +- .../org/apache/phoenix/end2end/NotQueryIT.java | 2 +- .../org/apache/phoenix/end2end/QueryIT.java | 96 + .../org/apache/phoenix/end2end/ScanQueryIT.java | 2 +- .../function/CeilDecimalExpression.java | 17 ++- .../function/FloorDecimalExpression.java| 17 ++- .../function/RoundDecimalExpression.java| 24 +++- .../org/apache/phoenix/parse/CastParseNode.java | 18 ++- .../org/apache/phoenix/parse/CeilParseNode.java | 2 +- .../apache/phoenix/parse/FloorParseNode.java| 2 +- .../apache/phoenix/parse/RoundParseNode.java| 6 +- .../org/apache/phoenix/schema/PDataType.java| 15 ++ .../RoundFloorCeilExpressionsUnitTests.java | 5 +- 17 files changed, 325 insertions(+), 123 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/d372c659/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryIT.java new file mode 100644 index 000..d736612 --- /dev/null +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryIT.java @@ -0,0 +1,138 @@ +/* + * 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. + */ +package org.apache.phoenix.end2end; + +import static org.apache.phoenix.util.TestUtil.TEST_PROPERTIES; + +import java.sql.Connection; +import java.sql.Date; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.concurrent.atomic.AtomicInteger; + +import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; +import org.apache.hadoop.hbase.io.ImmutableBytesWritable; +import org.apache.hadoop.hbase.util.Bytes; +import org.apache.phoenix.hbase.index.write.IndexWriterUtils; +import org.apache.phoenix.query.QueryServices; +import org.apache.phoenix.util.ByteUtil; +import org.apache.phoenix.util.PhoenixRuntime; +import org.apache.phoenix.util.PropertiesUtil; +import org.apache.phoenix.util.ReadOnlyProps; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.experimental.categories.Category; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameters; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; + + + +/** + * + * Basic tests for Phoenix JDBC implementation + * + * + * @since 0.1 + */ + +@Category(ClientManagedTimeTest.class) +@RunWith(Parameterized.class) +public abstract class BaseQueryIT extends BaseClientManagedTimeIT { +protected static final String tenantId = getOrganizationId(); +protected static final String ATABLE_INDEX_NAME = ATABLE_IDX; +protected static final long BATCH_SIZE = 3; + +@BeforeClass +@Shadower(classBeingShadowed = BaseClientManagedTimeIT.class) +public static void