当前位置:网站首页>Common commands and basic operations of Apache Phoenix
Common commands and basic operations of Apache Phoenix
2022-07-05 12:34:00 【JKing_ one hundred and sixty-eight】
· Be careful :
1. Use Phoenix Start first HBase2. Phoenix Will automatically turn lowercase letters into uppercase , If you want to keep lowercase letters , You need to add double quotation marks outside the characters
· Linux Start in Phoenix
cd /export/server/apache-phoenix-5.0.0-HBase-2.0-bin/bin/
# Currently, the virtual machine has anaconda, therefore python The version is 3.8, The default startup uses python2
python2 sqlline.py node1.itcast.cn:2181
· Create table
create table [if not exists] Table name (
rowkey name data type primary key,
The names of the clans . Name 1 data type ,
The names of the clans . Name 2 data type ,
...
);
· View all tables
# system namespace The are phoenix establish
!table
· View table structure
!desc Table name
· See the details
explain select * from Table name limit 10;
· Delete table
drop table [if exists] Table name
· Exit terminal
!quit
· Insert data into a table ( No data is inserted , Data is update )
upsert into Table name ( Column family . Column qualifier 1, Column family . Column qualifier 2) values(xxx, yyy, zzz)
· Delete data
delete from Table name where "id" = '000001';
· Paging query
select * from ORDER_DTL limit 10 [offset 5];
· rowkey Pre partition
create table [if not exists] Table name (
rowkey name data type primary key,
The names of the clans . Name 1 data type ,
The names of the clans . Name 2 data type ,
...
)
compession='GZ' # Specify the data compression format
split on ('3','5','7'); # Divide into 4 Districts
· rowkey Salt pre zoning
create table [if not exists] Table name (
rowkey name data type primary key,
The names of the clans . Name 1 data type ,
The names of the clans . Name 2 data type ,
...
)
compession='GZ' # Specify the data compression format
salt_buckets=10; # Divide into 10 Districts
· Phoenix Create view , mapping HBase In the table
# Be careful : The view name should be consistent with the table name , View column names and hbase The names of the clans Column qualifier of bring into correspondence with
create view " The name space "." Table name "(
pk varchar primary key,
" The names of the clans ".“ Column qualifier ” data type ,
. . .
);
· Global index ( Create index tables separately , First check the index table and then return to the target table to find )
# Create a global index
create index The index name on Table name ( Name 1, Name 2...);
# Delete global index
drop index The index name on Table name ;
· Local index ( The index table will not be created separately , Modify the index fields directly in the target table )
# Create a local index
create local index The index name on Table name ( Name 1, Name 2 . . .)
# Delete local index
drop index The index name on Table name ;
· Overlay index ( Can't be used alone , Use with the above index , You don't need to go to the target table to query , Directly from the overall situation / Get data from local index )
# Create overlay index
creare [local] index The index name on Table name ( Name 1, Name 2...) include( Name 3)
# Delete overlay index , It has to be deleted together with the former index
drop index The index name on Table name ;
边栏推荐
- Handwriting blocking queue: condition + lock
- GPS data format conversion [easy to understand]
- MySQL multi table operation
- [hdu 2096] Xiaoming a+b
- Distributed cache architecture - cache avalanche & penetration & hit rate
- How can beginners learn flutter efficiently?
- Distributed solution - distributed session consistency problem
- Four operations and derivative operations of MATLAB polynomials
- MySQL trigger
- Why learn harmonyos and how to get started quickly?
猜你喜欢
What is digital existence? Digital transformation starts with digital existence
C language structure is initialized as a function parameter
How can beginners learn flutter efficiently?
Redis highly available slice cluster
Matlab label2idx function (convert the label matrix into a cell array with linear index)
Constructing expression binary tree with prefix expression
Hexadecimal conversion summary
Take you two minutes to quickly master the route and navigation of flutter
ZABBIX ODBC database monitoring
One article tells the latest and complete learning materials of flutter
随机推荐
NPM install reports an error
Two minutes will take you to quickly master the project structure, resources, dependencies and localization of flutter
Why do you always fail in automated tests?
MySQL multi table operation
什么是数字化存在?数字化转型要先从数字化存在开始
A guide to threaded and asynchronous UI development in the "quick start fluent Development Series tutorials"
语义分割实验:Unet网络/MSRC2数据集
Handwriting blocking queue: condition + lock
MySQL log module of InnoDB engine
Third party payment interface design
Get data from the database when using JMeter for database assertion
GPS data format conversion [easy to understand]
MySQL trigger
Making and using the cutting tool of TTF font library
一款新型的智能家居WiFi选择方案——SimpleWiFi在无线智能家居中的应用
Tabbar configuration at the bottom of wechat applet
MySQL data table operation DDL & data type
A new WiFi option for smart home -- the application of simplewifi in wireless smart home
How does MySQL execute an SQL statement?
Distributed solution - distributed session consistency problem