svn commit: r1609071 - /phoenix/site/source/src/site/markdown/array_type.md
Author: ramkrishna Date: Wed Jul 9 09:52:14 2014 New Revision: 1609071 URL: http://svn.apache.org/r1609071 Log: Phoenix-1067 Add documentation for ANY/ALL support with arrays (Ram) Modified: phoenix/site/source/src/site/markdown/array_type.md Modified: phoenix/site/source/src/site/markdown/array_type.md URL: http://svn.apache.org/viewvc/phoenix/site/source/src/site/markdown/array_type.md?rev=1609071r1=1609070r2=1609071view=diff == --- phoenix/site/source/src/site/markdown/array_type.md (original) +++ phoenix/site/source/src/site/markdown/array_type.md Wed Jul 9 09:52:14 2014 @@ -46,10 +46,24 @@ The length of the array grows dynamicall Attempts to access an array element beyond the current length will evaluate to codenull/code. +For searching in an array, built-in functions like ANY and ALL are provided. For example, + +SELECT region_name FROM regions WHERE '94030' = ANY(zip); +SELECT region_name FROM regions WHERE '94030' = ALL(zip); + +The built-in function ANY checks if any of the element in the array satisfies the condition and it is equivalent to OR condition: + +SELECT region_name FROM regions WHERE zip[1] = '94030' OR zip[2] = '94030' OR zip[3] = '94030'; + +The built-in function ALL checks if all the elements in the array satisfies the condition and it is equivalent to AND condition: + +SELECT region_name FROM regions WHERE zip[1] = '94030' AND zip[2] = '94030' AND zip[3] = '94030'; + + + ###Limitations * Only one dimensional arrays are currently supported * For an array of fixed width types, null elements occurring in the middle of an array are not tracked. * The declaration of an array length at DDL time is not enforced currently, but maybe in the future. Note that it is persisted with the table metadata. * An array may only be used as the last column in a primary key constraint. * Partial update of an array is currently not possible. Instead, the array may be manipulated on the client-side and then upserted back in its entirety. -* No support currently exists for searching in an array through the ALL or ANY built-in functions, but we welcome community contributions.
svn commit: r1609131 - /phoenix/site/publish/array_type.html
Author: ramkrishna Date: Wed Jul 9 12:30:08 2014 New Revision: 1609131 URL: http://svn.apache.org/r1609131 Log: Phoenix-1067 Add documentation for ANY/ALL support with arrays (Ram) Modified: phoenix/site/publish/array_type.html Modified: phoenix/site/publish/array_type.html URL: http://svn.apache.org/viewvc/phoenix/site/publish/array_type.html?rev=1609131r1=1609130r2=1609131view=diff == --- phoenix/site/publish/array_type.html (original) +++ phoenix/site/publish/array_type.html Wed Jul 9 12:30:08 2014 @@ -1,370 +1,385 @@ - -!DOCTYPE html -!-- - Generated by Apache Maven Doxia at 2014-06-03 - Rendered using Reflow Maven Skin 1.1.0 (http://andriusvelykis.github.io/reflow-maven-skin) --- -html xml:lang=en lang=en - - head - meta charset=UTF-8 / - titleARRAY Type | Apache Phoenix/title - meta name=viewport content=width=device-width, initial-scale=1.0 / - meta name=description content= / - meta http-equiv=content-language content=en / - - link href=http://netdna.bootstrapcdn.com/bootswatch/2.3.2/united/bootstrap.min.css; rel=stylesheet / - link href=http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-responsive.min.css; rel=stylesheet / - link href=./css/bootswatch.css rel=stylesheet / - link href=./css/reflow-skin.css rel=stylesheet / - - link href=http://yandex.st/highlightjs/7.5/styles/default.min.css; rel=stylesheet / - - link href=./css/lightbox.css rel=stylesheet / - - link href=./css/site.css rel=stylesheet / - link href=./css/print.css rel=stylesheet media=print / - - !-- Le HTML5 shim, for IE6-8 support of HTML5 elements -- - !--[if lt IE 9] - script src=http://html5shim.googlecode.com/svn/trunk/html5.js;/script - ![endif]-- - - - - /head - - body class=page-array_type project-phoenix-site data-spy=scroll data-offset=60 data-target=#toc-scroll-target - - div class=navbar navbar-fixed-top - div class=navbar-inner - div class=container - a class=btn btn-navbar data-toggle=collapse data-target=#top-nav-collapse - span class=icon-bar/span - span class=icon-bar/span - span class=icon-bar/span - /a - a class=brand href=index.htmldiv class=xtoplogo/div/a - div class=nav-collapse collapse id=top-nav-collapse - ul class=nav pull-right - li class=dropdown - a href=# class=dropdown-toggle data-toggle=dropdownAbout b class=caret/b/a - ul class=dropdown-menu - li a href=index.html title=OverviewOverview/a/li - li a href=recent.html title=New FeaturesNew Features/a/li - li a href=roadmap.html title=RoadmapRoadmap/a/li - li a href=performance.html title=PerformancePerformance/a/li - li a href=team.html title=TeamTeam/a/li - li a href=contributing.html title=ContributingContributing/a/li - li a href=resources.html title=ResourcesResources/a/li - li a href=mailing_list.html title=Mailing ListsMailing Lists/a/li - li a href=source.html title=Source RepositorySource Repository/a/li - li a href=issues.html title=Issue TrackingIssue Tracking/a/li - li a href=download.html title=DownloadDownload/a/li - li class=divider/ - li a href=http://www.apache.org/licenses/; title=License class=externalLinkLicense/a/li -
git commit: PHOENIX-1072: Fast fail sqlline.py when pass wrong quorum string or hbase cluster hasnt' started yet
Repository: phoenix Updated Branches: refs/heads/master 9bb0b01f6 - 013e96c02 PHOENIX-1072: Fast fail sqlline.py when pass wrong quorum string or hbase cluster hasnt' started yet Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/013e96c0 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/013e96c0 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/013e96c0 Branch: refs/heads/master Commit: 013e96c02b50f767e8e1e17d37c4cceef018d3eb Parents: 9bb0b01 Author: Jeffrey Zhong jeffr...@apache.org Authored: Wed Jul 9 17:43:54 2014 -0700 Committer: Jeffrey Zhong jeffr...@apache.org Committed: Wed Jul 9 17:43:54 2014 -0700 -- bin/log4j.properties | 4 +++- .../org/apache/phoenix/query/ConnectionQueryServicesImpl.java | 7 +++ 2 files changed, 10 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/013e96c0/bin/log4j.properties -- diff --git a/bin/log4j.properties b/bin/log4j.properties index 30119bc..47d45e8 100644 --- a/bin/log4j.properties +++ b/bin/log4j.properties @@ -65,5 +65,7 @@ log4j.appender.console.layout=org.apache.log4j.PatternLayout log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n # Custom Logging levels -log4j.logger.org.apache.zookeeper=WARN +log4j.logger.org.apache.zookeeper=ERROR +log4j.logger.org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper=ERROR +log4j.logger.org.apache.hadoop.hbase.zookeeper.ZKUtil=ERROR log4j.logger.org.apache.hadoop.hbase.HBaseConfiguration=ERROR http://git-wip-us.apache.org/repos/asf/phoenix/blob/013e96c0/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java index 5eb5314..04e65e7 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java @@ -1457,6 +1457,8 @@ public class ConnectionQueryServicesImpl extends DelegateQueryServices implement SQLException sqlE = null; PhoenixConnection metaConnection = null; +int origClientRetries = ConnectionQueryServicesImpl.this.config.getInt( +HConstants.HBASE_CLIENT_RETRIES_NUMBER, HConstants.DEFAULT_HBASE_CLIENT_RETRIES_NUMBER); try { openConnection(); Properties scnProps = PropertiesUtil.deepCopy(props); @@ -1464,6 +1466,9 @@ public class ConnectionQueryServicesImpl extends DelegateQueryServices implement PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(MetaDataProtocol.MIN_SYSTEM_TABLE_TIMESTAMP)); scnProps.remove(PhoenixRuntime.TENANT_ID_ATTRIB); +// during initialization fast fail when connection has issues +ConnectionQueryServicesImpl.this.config.setInt( +HConstants.HBASE_CLIENT_RETRIES_NUMBER, Math.min(2,origClientRetries)); metaConnection = new PhoenixConnection( ConnectionQueryServicesImpl.this, url, scnProps, newEmptyMetaData()); try { @@ -1482,6 +1487,8 @@ public class ConnectionQueryServicesImpl extends DelegateQueryServices implement } catch (SQLException e) { sqlE = e; } finally { +ConnectionQueryServicesImpl.this.config.setInt( +HConstants.HBASE_CLIENT_RETRIES_NUMBER, origClientRetries); try { if (metaConnection != null) metaConnection.close(); } catch (SQLException e) {
git commit: PHOENIX-1072: Fast fail sqlline.py when pass wrong quorum string or hbase cluster hasnt' started yet
Repository: phoenix Updated Branches: refs/heads/4.0 8dfda14ae - 46b445bef PHOENIX-1072: Fast fail sqlline.py when pass wrong quorum string or hbase cluster hasnt' started yet Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/46b445be Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/46b445be Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/46b445be Branch: refs/heads/4.0 Commit: 46b445befb43e6257bb085c01a0a26e30ee68366 Parents: 8dfda14 Author: Jeffrey Zhong jeffr...@apache.org Authored: Wed Jul 9 17:43:54 2014 -0700 Committer: Jeffrey Zhong jeffr...@apache.org Committed: Wed Jul 9 17:49:05 2014 -0700 -- bin/log4j.properties | 4 +++- .../org/apache/phoenix/query/ConnectionQueryServicesImpl.java | 7 +++ 2 files changed, 10 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/46b445be/bin/log4j.properties -- diff --git a/bin/log4j.properties b/bin/log4j.properties index 30119bc..47d45e8 100644 --- a/bin/log4j.properties +++ b/bin/log4j.properties @@ -65,5 +65,7 @@ log4j.appender.console.layout=org.apache.log4j.PatternLayout log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n # Custom Logging levels -log4j.logger.org.apache.zookeeper=WARN +log4j.logger.org.apache.zookeeper=ERROR +log4j.logger.org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper=ERROR +log4j.logger.org.apache.hadoop.hbase.zookeeper.ZKUtil=ERROR log4j.logger.org.apache.hadoop.hbase.HBaseConfiguration=ERROR http://git-wip-us.apache.org/repos/asf/phoenix/blob/46b445be/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java index a83a0c9..be0ac7a 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java @@ -1457,6 +1457,8 @@ public class ConnectionQueryServicesImpl extends DelegateQueryServices implement SQLException sqlE = null; PhoenixConnection metaConnection = null; +int origClientRetries = ConnectionQueryServicesImpl.this.config.getInt( +HConstants.HBASE_CLIENT_RETRIES_NUMBER, HConstants.DEFAULT_HBASE_CLIENT_RETRIES_NUMBER); try { openConnection(); Properties scnProps = PropertiesUtil.deepCopy(props); @@ -1464,6 +1466,9 @@ public class ConnectionQueryServicesImpl extends DelegateQueryServices implement PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(MetaDataProtocol.MIN_SYSTEM_TABLE_TIMESTAMP)); scnProps.remove(PhoenixRuntime.TENANT_ID_ATTRIB); +// during initialization fast fail when connection has issues +ConnectionQueryServicesImpl.this.config.setInt( +HConstants.HBASE_CLIENT_RETRIES_NUMBER, Math.min(2,origClientRetries)); metaConnection = new PhoenixConnection( ConnectionQueryServicesImpl.this, url, scnProps, newEmptyMetaData()); try { @@ -1482,6 +1487,8 @@ public class ConnectionQueryServicesImpl extends DelegateQueryServices implement } catch (SQLException e) { sqlE = e; } finally { +ConnectionQueryServicesImpl.this.config.setInt( +HConstants.HBASE_CLIENT_RETRIES_NUMBER, origClientRetries); try { if (metaConnection != null) metaConnection.close(); } catch (SQLException e) {