BigObject is a SQL-like software. For those users who were already familiar with MySQL, this section presents some major comparison between MySQL and BigObject.

Query


Function MYSQL BigObject
Retrieving information SELECT from_columns FROM table WHERE conditions; SELECT from_columns FROM table WHERE conditions
All values SELECT * FROM table; SELECT * FROM table
Some values SELECT * FROM table WHERE rec_name = "value"; SELECT * FROM table WHERE rec_name = "value"
Multiple criteria SELECT * FROM table WHERE rec1="value1" AND rec2="value2"; SELECT * FROM table WHERE rec1="value1" AND rec2="value2"
Selecting specific columns SELECT column_name FROM table; SELECT column_name FROM table
Retrieving unique output records SELECT DISTINCT column_name FROM table; N/A 1
Sorting SELECT col1, col2 FROM table ORDER BY col2; SELECT col1, col2 FROM table ORDER BY col2
Sorting backward SELECT col1, col2 FROM table ORDER BY col2 DESC; SELECT col1, col2 FROM table ORDER BY col2 DESC
Counting rows SELECT COUNT(*) FROM table; SELECT COUNT(*) FROM table
Grouping with counting SELECT owner, COUNT(*) FROM table GROUP BY owner; SELECT owner, COUNT(*) FROM table GROUP BY owner
Maximum value SELECT MAX(col_name) AS label FROM table; SELECT MAX(col_name) AS label FROM table
Selecting from multiple tables SELECT Customer.name, Data FROM Customer, sales WHERE Customer.id=sales.cid SELECT Customer.name, Data from sales 2

[1]: Can be achieved by using "SELECT column_name FROM table GROUP BY column_name"

[2]: When creating "sales" table in BigObject, instead of using "cid" as the column name, use "Customer.id" as the column name.

MetaData


Function MYSQL BigObject
Selecting a database USE database; USE database3
Listing databases SHOW DATABASES; SHOW DATABASES
Listing tables in a database SHOW TABLES; SHOW TABLES
Describing the format of a table DESCRIBE table; DESC table
Creating a database CREATE DATABASE db_name; CREATE DATABASES db_name
Dropping a database DROP DATABASE db_name; DROP DATABASE db_name

[3]: USE database is only available through mysql protocol interface.

Data Types in BigObject


BigObject Type Description Comparable MYSQL Types
STRING encoded string ended with NULL(0) character N/A
CHAR fixed-length string CHAR
VARSTRING variable-length string; suitable for non-repeatable strings 3 VCHAR
BYTE single character(ASCII range 32-126) N/A
INT8 8-bit integer TINYINT
INT16 16-bit integer SMALLINT
INT32 32-bit integer INT
INT64 64-bit integer BIGINT
FLOAT 4-byte floating point FLOAT
DOUBLE 8-byte double precision floating point DOUBLE
DATE year, month, and day of month (4 bytes long) DATE
DATETIME32 date and time (4 bytes long) DATETIME
DATETIME64 date and time (8 bytes long)

[4] VARSTRING and CHAR cannot be used in CREATE TREE attributes and FIND statement directly.