Skip to content

Weekly Pickup

shawdan edited this page Aug 28, 2020 · 43 revisions

Weekly Pickup will select major product updates from GitHub issues and pr for you. Welcome to follow us on GitHub so that you'll be the first to know our latest updates.

Pick of the 34th week in 2020

Events of the Week

Studio v1.1.0-beta was uncovered with a major feature: supporting the LOOKUP syntax. Besides, it is also armed with these updates:

  • On Explore:
    • Supports vertex query by Index
    • Supports pre-processing data to generate a VID for a vertex query
  • On Console
    • Supports importing results of vertex query into Explore for visualized graph exploration
  • Bug fixes
    • Fixed the bug that the console cannot correctly display the result for a vertex query for a boolean property

You are more than welcome to give Studio a shot and raise issues. Here is where you can get it: https://github.com/vesoft-inc/nebula-web-docker

Nebula Graph Updates

The updates of Nebula Graph in the last week:

Pick of the 33rd week in 2020

Nebula Graph Updates

The updates of Nebula in the last week:

Pick of the 32nd week in 2020

Nebula Graph Updates

Here are some updates in the last week:

Pick of the 31st week in 2020

GO syntax supports input of the int type for graph traversal

Now you can use the GO syntax in Nebula Graph to retrieve data by passing a value of the int type. This update empowers you to traverse a graph in more scenarios and improves query performance by simplifying the query operation.

Applicable scenario

Vertex A has a property of the timestamp type for one TAG; and Vertex B uses Vertex A's timestamp property value as its VID for another TAG. With the new feature of the GO syntax, you can use the FETCH or the LOOKUP syntax to filter vertices and then pass the timestamp property values as the input of the GO statement to query the records at the specified time point.

Example

Now let's use an example to show the benefits of the new feature.

We will create an example graph and explore it in Nebula Studio. The figure below shows how the exploration result looks like. graph exploration

Follow these steps to create the example graph and to perform the query:

  1. Create a tag, t4, representing a user type. Its action_time property indicates the specified time point when a user performs an action.
CREATE TAG t4(user_name string, action_time timestamp);
  1. Create a tag, t5, representing an action type that users perform.
CREATE TAG t5(user_action string);
  1. Create an edge type representing the relationship between a user and an action and the relationship is play_games.
CREATE EDGE play_games();
create two tags and one edge type 4. Insert a vertex to represent a user. Its `VID` is set to `730`. ```nGQL INSERT VERTEX t4(user_name, action_time) VALUES 730:("xiaowang", 1596103557); ``` 5. Insert a vertex to represent an action, `play smart phone games`, and its `VID` is set to the `action_time` value of Vertex 730, representing that the user was playing smart phone games at the specified time point. ```nGQL INSERT VERTEX t5(user_action) VALUES 1596103557:("play smart phone games"); ``` 6. Insert an edge to represent the relationship of `play_games` between the user and the action. ```nGQL INSERT EDGE play_games() VALUES 730->1596103557:(); ``` insert two vertices and one edge

With this new feature, only one statement as follows is needed for query. This statement will do these tasks:

  1. querying all properties of Vertex 730 for all TAGs
  2. renaming the t4.action_time property as a variable, named timeid
  3. passing the timeid variable to the GO statement to do the reversal query on the play-games edge
  4. showing the t5.user_action property of the edge's source vertex with a new name, player_action
FETCH PROP ON * 730 YIELD t4.action_time AS timeid | GO FROM $-.timeid OVER play_games REVERSELY YIELD $^.t5.user_action AS players_action;
fetch the action_time property of both vertices for the t4 tag

Pick of the 30th week in 2020

This week, the FETCH syntax has been armed with new features that let you retrieve the properties of multiple vertices for all their tags and facilitate your query for properties of multiple vertices further.

In Nebula Graph, the FETCH syntax is used to query the properties of a vertex or an edge. Together with the variable and the pipe features, its new features make the FETCH syntax more powerful in querying the properties of vertices.

Now, let's see what the FETCH syntax is able to do.

Scenario 1: Retrieve all the properties from vertices for all their tags

For example, we have two vertices and their IDs are 21 and 20 and we want to query all the properties of both vertices for all their tags and order the result by vertex ID. We cannot do that before, because the FETCH syntax cannot be used to retrieve properties from multiple vertices for more than one tag. But now, we can use the FETCH PROP ON * 21, 20; statement to get it done, as shown in the following figure.

new feature_fetch all properties of multiple vertices

Before this update, when you used the FETCH syntax to retrieve the properties from two vertices for two tags, such as FETCH PROP ON t1, t2 20, 21; as shown in the following figure, an error was returned.

fetch the properties of two vertices for two tags

Scenario 2: Use pipe to pass vertex IDs

Now the FETCH syntax supports querying properties based on vertex IDs that were passed by the PIPE ( | ) feature. For example, run the YIELD 20 AS id | FETCH PROP ON t2 $-.id; statement to pass the id variable as the input of the FETCH statement, as shown in the following figure.

With this new feature, you can use the GO syntax and the FETCH syntax in one statement.

use pipe to pass vertex Ids

Scenario 3: Use a variable to store vertex IDs

This update enables you to store the queried vertex IDs as a variable and then retrieve the properties from the vertices for multiple tags by using the variable. For example, run the statements as follows and you will get the properties for the vertex (vid 20), as shown in the following figure.

$var = YIELD 20 AS id;
FETCH PROP ON t2, t3 $var.id;
use a variable to store vertex Ids

Pick of the 29th week in 2020

There are some time-consuming tasks running at the storage layer of Nebula Graph. For such tasks, we provide Job Manager, a management tool, for releasing, managing, and querying the jobs.

We currently provide Compact and Flush for task releasing. Compact is usually used to clear data that has been marked for deletion from the storage layer, and flush is used to write back the memfile in memory to the hard disk.

Scenario #1: Release RocksDB Compact Task To release a RocksDB compact task, you can run the SUBMIT JOB COMPACT; command and a Job ID is returned, as shown in the following figure:

29-1

To write the RocksDB memfile in the memory to the hard disk, you can run the SUBMIT JOB FLUSH; command and a Job ID is returned, as shown in the following figure:

29-2

Scenario #2: Query Tasks. In terms of task query, we support to list a single job or all jobs for task querying. To find all the jobs, you can run the SHOW JOBS; statement to do the full job query. All the job IDs are returned, as shown in the following figure:

29-3

In this job list, you can see information such as Job ID, Task ID, commands and the landing nodes.

After obtaining the specific ID of a job, you can use SHOW JOB JOB ID; to query the details. From the job details, you can get the Task ID of each task. Generally, each node for the storaged service has one Task ID, so the number of Task IDs depends on the number of nodes for the storaged service

29-4

STOP JOB ; can be used to suspend ongoing tasks.

29-5png

You can also use RECOVER JOB; to resume suspended tasks.

29-6

Pick of the 28th week in 2020

In Nebula Graph, you can add a TTL attribute to any tag or edge type so that expired data can be automatically deleted.

To use the TTL feature, you need to specify the values of start time (ttl_col) and lifespan (ttl_duration). The start time (ttl_col) uses the UNIX timestamp format and supports calling the now function to acquire the current time, and the data type is int. If the current time is greater than the start time plus the lifespan, the Tag or Edge will be discarded.

Pro Tip: The TTL function and the Index function cannot be used for a single Tag or Edge at the same time.

Below are several common use cases where TTL is used.

Scenario #1: When a vertex has multiple tags. When a vertex has multiple tags, only the one with the TTL property is discarded. The other properties of this vertex can be accessed. See the below example:

  1. CREATE TAG tag1(a timestamp) ttl_col = "a", ttl_duration = 5;
  2. CREATE TAG tag2(a string);
  3. INSERT VERTEX tag1(a),tag2(a) values 200:(now(), "hello");
  4. fetch prop on * 200;

You can see there are two tags attached to the Vertex 200 and the lifespan for property data on tag1 is five seconds:

28-1

Fetch the properties on Vertex 200 after five seconds, only tag2 is returned:

28-2png

Scenarios #2: When a vertex has only one Tag with a TTL property;

Fetch properties on Vertex 101 and the tag1 is returned:

  1. fetch prop on * 101;
28-3

Query properties on Vertex 101 again after five seconds, no result is returned because the data is expired.

28-4

You can delete the TTL property of a Tag or Edge by setting ttl_col to null or deleting this field. Setting ttl_col to null means the data will not expire. See the example code below:

  1. ALTER TAG tag1 ttl_col = "";
  2. INSERT VERTEX tag1(a),tag2(a) values 202:(now(), "hello");
  3. fetch prop on * 202;
28-5

Delete the ttl_col field, the data does not expired.

  1. ALTER TAG tag1 DROP (a);
  2. INSERT VERTEX tag1(a),tag2(a) values 203:(now(), "hello");
  3. fetch prop on * 203;
28-6

When ttl_duration is set to 0, the TTL function exists, but all data does not expired.

  1. ALTER TAG tag1 ttl_duration = 0;
  2. INSERT VERTEX tag1(a),tag2(a) values 204:(now(), "hello");
  3. fetch prop on * 204;
28-7

Pick of the 27th Week in 2020

After creating or rebuilding the index, you can use LOOKUP to query data. The biggest advantage of using an index is not only the speed but also querying without the VID.

The LOOKUP query returns the basic information of vertices or edges by default. You can specify the returned data by using the YIELD statement, such as the properties of the point or edge.

Note: WHERE clause does not support the following operations in LOOKUP:

  1. $- and $^
  2. In relational expressions, expressions with field-names on both sides of the operator are not currently supported, such as (tagName.column1> tagName.column2)
  3. Nested AliasProp expressions in operation expressions and function expressions are not supported at this time.

Now let's try some queries using an index.

# Lookup player whose name is Marco Belinelli
(user@nebula) [nba]>  LOOKUP ON player WHERE player.name == "Marco Belinelli";
============
| VertexID |
============
| 104      |
------------
# Lookup player whose name is Marco Belinelli or whose age is greater than 40
(user@nebula) [nba]>  LOOKUP ON player WHERE player.name == "Marco Belinelli" OR player.age > 40;
============
| VertexID |
============
| 140      |
------------
| 100      |
------------
| 136      |
------------
| 125      |
------------
| 148      |
------------
| 141      |
------------
| 104      |
------------
| 144      |
------------
| 127      |
------------

Display the above vertices in Nebula Graph Studio.

studio
# Lookup player whose name is Marco Belinelli. And starting from it, traverse along edge serve to find his team.
(user@nebula) [nba]> LOOKUP ON player WHERE player.name == "Marco Belinelli" YIELD player.name AS name | GO FROM $-.VertexID OVER serve YIELD $-.name, serve.start_year, serve.end_year, $$.team.name;
======================================================================
| $-.name         | serve.start_year | serve.end_year | $$.team.name |
======================================================================
| Marco Belinelli | 2007             | 2009           | Warriors     |
----------------------------------------------------------------------
| Marco Belinelli | 2015             | 2016           | Kings        |
----------------------------------------------------------------------
| Marco Belinelli | 2009             | 2010           | Raptors      |
----------------------------------------------------------------------
| Marco Belinelli | 2018             | 2018           | 76ers        |
----------------------------------------------------------------------
| Marco Belinelli | 2012             | 2013           | Bulls        |
----------------------------------------------------------------------
| Marco Belinelli | 2017             | 2018           | Hawks        |
----------------------------------------------------------------------
| Marco Belinelli | 2018             | 2019           | Spurs        |
----------------------------------------------------------------------
| Marco Belinelli | 2010             | 2012           | Hornets      |
----------------------------------------------------------------------
| Marco Belinelli | 2013             | 2015           | Spurs        |
----------------------------------------------------------------------
| Marco Belinelli | 2016             | 2017           | Hornets      |
----------------------------------------------------------------------
# The following example returns edges whose degree is 90.

(user@nebula) [nba]> LOOKUP ON follow WHERE follow.degree == 90;
=============================
| SrcVID | DstVID | Ranking |
=============================
| 142    | 117    | 0       |
-----------------------------
| 118    | 120    | 0       |
-----------------------------
| 128    | 116    | 0       |
-----------------------------
| 138    | 115    | 0       |
-----------------------------
| 140    | 114    | 0       |
-----------------------------
| 133    | 114    | 0       |
-----------------------------
| 143    | 150    | 0       |
-----------------------------
| 136    | 117    | 0       |
-----------------------------
| 129    | 116    | 0       |
-----------------------------
| 121    | 116    | 0       |
-----------------------------
| 114    | 103    | 0       |
-----------------------------
| 127    | 114    | 0       |
-----------------------------
| 147    | 136    | 0       |
-----------------------------

Pick of the 25th Week in 2020

Indexes are built to fast process graph queries. Nebula Graph supports indexing, too. Different from relational databases, whose index is based on columns, Nebula graph indexes the properties of the tags or edge types.

It the data is written after index creation, Nebula graph will automatically generate the index information. If data is written before index creation, you need to create the index for the original data with the REBUILD statement.

In general, to ensure index utilization, we recommend creating a single property index, which is more flexible. However, for a certain business scenario, a composite index is more efficient.

Create Index

Create a Single Property Index

(user@nebula) [nba]> CREATE TAG INDEX player_index_0 on player(name);
Execution succeeded (Time spent: 1.00587/1.00693 s)

Create a Composite Index

(user@nebula) [nba]> CREATE TAG INDEX player_index_1 on player(name,age);
Execution succeeded (Time spent: 3.085/3.977 ms)

Show Indexes

(user@nebula) [nba]> SHOW TAG INDEXES;
=============================
| Index ID | Index Name     |
=============================
| 34       | player_index_0 |
-----------------------------
| 35       | player_index_1 |
-----------------------------
Got 2 rows (Time spent: 868/1704 us)

Describe Index

(user@nebula) [nba]> DESCRIBE TAG INDEX player_index_0;
==================
| Field | Type   |
==================
| name  | string |
------------------
Got 1 rows (Time spent: 771/1550 us)

Drop Index

(user@nebula) [nba]> DROP TAG INDEX player_index_1;
Execution succeeded (Time spent: 2.09/2.768 ms)

Confirm the Previous Step

(user@nebula) [nba]> SHOW TAG INDEXES;
=============================
| Index ID | Index Name     |
=============================
| 34       | player_index_0 |
-----------------------------
Got 1 rows (Time spent: 575/1279 us)

Rebuild Index

(user@nebula) [nba]> REBUILD TAG INDEX player_index_0 OFFLINE;
Execution succeeded (Time spent: 3.193/5.055 ms)

Pick of the 24th Week in 2020

UPSERT is a combination of INSERT and UPDATE.

If the vertex or edge does not exist, a new one will be created. The property columns not specified by the SET statement use the default values of the columns, if there are no default values, an error will be returned; If the vertex or edge exists and the WHEN condition is met, the vertex or edge will be updated. Otherwise, nothing will be done.

UPSERT simplifies the validation of the existence of a vertex or edge before inserting new data. The performance of UPSERT is much lower than that of INSERT, so it is not suitable for large concurrent write scenarios.

Following are some examples

  • In this example, we use tag player, no default values are specified for the tag.
nebula> SHOW CREATE TAG player;
==========================================================================================
| Tag    | Create Tag                                                                    |
==========================================================================================
| player | CREATE TAG player (
  name string,
  age int
) ttl_duration = 0, ttl_col = "" |
------------------------------------------------------------------------------------------
Got 1 rows (Time spent: 1.024/1.973 ms)
  • Insert vertex 100, then update its name and age property.
nebula> INSERT VERTEX player(name, age) VALUES 100:("Ben Simmons", 22);
Execution succeeded (Time spent: 1.039/1.711 ms)

nebula> UPSERT VERTEX 100 SET player.name = "Dwight Howard", player.age = $^.player.age + 11 WHEN $^.player.name == "Ben Simmons" && $^.player.age > 20 YIELD $^.player.name AS Name, $^.player.age AS Age;
=======================
| Name          | Age |
=======================
| Dwight Howard | 33  |
-----------------------
Got 1 rows (Time spent: 2.834/3.612 ms)
  • Vertex 400 does not exist. When updating its age property with INSERT, an error is thrown for there is no default value for the age property.
nebula> FETCH PROP ON * 400;
Execution succeeded (Time spent: 5.038/5.875 ms)

nebula> UPSERT VERTEX 400 SET player.age = $^.player.age + 1;
[ERROR (-8)]: Maybe vertex does not exist, part: 1, error code: -100!

Pick of the 23rd Week in 2020

The INSERT statement is an important basic function in Nebula Graph to create data records. The INSERT statement supports inserting a vertex or edge. After creating the schema, you can use the INSERT statement to insert data. The INSERT statement supports batch insertion of data through a list. When the insert operation is performed multiple times on the same vertex or edge, only the last written values can be read. Nebula Graph allows inserting empty content, but when an error occurs in the INSERT statement, no data will be written.

# Insert a vertex with no properties
nebula> INSERT VERTEX t1 () VALUES 10:();

nebula> fetch prop on * 10;
============
| VertexID |
============
| 10       |
------------
Got 1 rows (Time spent: 995/1678 us)

# Insert two vertices
nebula> INSERT VERTEX t2 (name, age) VALUES 13:("n3", 12), 14:("n4", 8);

nebula> fetch prop on t2 13,14;
===============================
| VertexID | t2.name | t2.age |
===============================
| 13       | n3      | 12     |
-------------------------------
| 14       | n4      | 8      |
-------------------------------
Got 2 rows (Time spent: 874/1507 us)

# Insert a vertex with two tags
nebula> INSERT VERTEX t1 (i1), t2(s2) VALUES 21: (321, "hello”);

nebula> fetch prop on * 21;
============================
| VertexID | t1.i1 | t2.s2 |
============================
| 21       | 321   | hello |
----------------------------
Got 1 rows (Time spent: 820/1489 us)
# Insert an edge with no properties
nebula> CREATE EDGE e1 ();
Execution succeeded (Time spent: 16.544/17.903 ms)

nebula> INSERT EDGE e1() VALUES 10->11:()
Execution succeeded (Time spent: 1.434/2.161 ms)

nebula> fetch prop on e1 10->11;
================================
| e1._src | e1._dst | e1._rank |
================================
| 10      | 11      | 0        |
--------------------------------
Got 1 rows (Time spent: 9.65/11.269 ms)

# Insert two edges
nebula> INSERT EDGE e2 (name, age) VALUES 12->13:("n1", 1), 13->14:("n2", 2);

nebula> fetch prop on e2 12 -> 13,13 -> 14;
===================================================
| e2._src | e2._dst | e2._rank | e2.name | e2.age |
===================================================
| 13      | 14      | 0        | n2      | 2      |
---------------------------------------------------
| 12      | 13      | 0        | n1      | 1      |
---------------------------------------------------
Got 2 rows (Time spent: 916/1579 us)

Pick of the 22nd Week in 2020

Graph traversal is an important function in the graph database and you can traverse vertices with direct or indirect relationships. In Nebula Graph, we use the GO statement to traverse a graph.

Based on the GO N STEPS, the newly added GO M TO N STEPS traverses from M to N hops. Same as GO N STEPS, GO M TO N STEPS supports reverse traversal, bi-direct traversal, and traversing from multiple vertices along multiple edges.

When M is equal to N, GO M TO N STEPS is equivalent to GO N STEPS. The GO M TO N STEPS function simplifies the graph traversal operation that needs to be performed multiple times to a single command, which improves the efficiency of large-scale vertices filtering.

Here are some examples:

  • Starting from 101, traverse along with all the edge types, return 3 to 5 hops.
nebula> GO 3 TO 5 STEPS FROM 101 OVER *
================================================
| follow._dst | serve._dst | e1._dst | e2._dst |
================================================
| 100         | 0          | 0       | 0       |
------------------------------------------------
| 101         | 0          | 0       | 0       |
------------------------------------------------
| 105         | 0          | 0       | 0       |
------------------------------------------------
| 0           | 200        | 0       | 0       |
------------------------------------------------
| 0           | 208        | 0       | 0       |
------------------------------------------------
| 0           | 218        | 0       | 0       |
------------------------------------------------
| 0           | 219        | 0       | 0       |
------------------------------------------------
| 0           | 221        | 0       | 0       |
------------------------------------------------
| 0           | 222        | 0       | 0       |
------------------------------------------------
| 0           | 204        | 0       | 0       |
------------------------------------------------
  • Traversing from 100 reversely along edge type follow, return 2 to 4 hops.
nebula> GO 2 TO 4 STEPS FROM 100 OVER follow REVERSELY YIELD DISTINCT follow._dst;
===============
| follow._dst |
===============
| 133         |
---------------
| 105         |
---------------
| 140         |
---------------
  • Traversing from 101 bi-directly along edge type follow, return 4 to 5 hops.
nebula> GO 4 TO 5 STEPS FROM 101 OVER follow BIDIRECT YIELD DISTINCT follow._dst;
===============
| follow._dst |
===============
| 100         |
---------------
| 102         |
---------------
| 104         |
---------------
| 105         |
---------------
| 107         |
---------------
| 113         |
---------------
| 121         |
---------------

Pick of the 21st Week in 2020

  • Introduction to Pipe

Nebula Graph supports the pipe operation to nest sub-queries to form a statement. This marks one of the major differences between nGQL and SQL. On the left of | is the input, on the right of | is the output. Together with YIELD, you can specify the returned results.

nebula> GO FROM 100 OVER follow YIELD follow._dst AS dstid, \
        $$.player.name AS name | GO FROM $-.dstid OVER follow \
        YIELD follow._dst, follow.degree, $-.name;

$- is the input. The output (i.e. the dstid and Name in the above example) of the previous query is the input (i.e. $-.dstid) of the next query. The alias name mentioned right after placeholder $- must be defined in the previous YIELD statement, such as the dstid or Name in the above example.

Pick of the 20th Week in 2020

  • Time-consuming task management The job here refers to the long tasks running at the storage layer. For example, compact and flush. The manager means to manage the jobs. For example, you can run, show, stop and recover jobs. We use the Job Manager to handle time-consuming tasks on the storage layer, such as compact and flush. You can use Job Manager to submit, stop, recover and show jobs. By listing the job statuses, you can enable or disenable jobs to improve efficiency and avoid resource occupancy of large jobs during peak hours. Moreover, you can count job information to perform more reasonable storage-related operations.

    # Submit Jobs
    ## Submit Compact Jobs
    nebula> SUBMIT JOB COMPACT;
    ==============
    | New Job Id |
    ==============
    | 40         |
    --------------
    # Submit Flush Jobs
    nebula> SUBMIT JOB FLUSH;
    ==============
    | New Job Id |
    ==============
    | 2          |
    --------------

    If you can't submit jobs successfully, please check the availability of the storage HTTP service via curl "http://{storaged-ip}:12000/admin?space={test}&op=compact".

    # Job Management
    # List All Jobs Information
    nebula> SHOW JOBS;
    =============================================================================
    | Job Id | Command       | Status   | Start Time        | Stop Time         |
    =============================================================================
    | 22     | flush test2   | failed   | 12/06/19 14:46:22 | 12/06/19 14:46:22 |
    -----------------------------------------------------------------------------
    | 23     | compact test2 | stopped  | 12/06/19 15:07:09 | 12/06/19 15:07:33 |
    -----------------------------------------------------------------------------
    | 24     | compact test2 | stopped  | 12/06/19 15:07:11 | 12/06/19 15:07:20 |
    -----------------------------------------------------------------------------
    | 25     | compact test2 | stopped  | 12/06/19 15:07:13 | 12/06/19 15:07:24 |
    -----------------------------------------------------------------------------
    # List Single Job Information
    nebula> SHOW JOB 40;
    =====================================================================================
    | Job Id(TaskId) | Command(Dest) | Status   | Start Time        | Stop Time         |
    =====================================================================================
    | 40             | flush nba     | finished | 12/17/19 17:21:30 | 12/17/19 17:21:30 |
    -------------------------------------------------------------------------------------
    | 40-0           | 192.168.8.5   | finished | 12/17/19 17:21:30 | 12/17/19 17:21:30 |
    -------------------------------------------------------------------------------------
    # Stop Job
    nebula> STOP JOB 22;
    =========================
    | STOP Result         |
    =========================
    | stop 1 jobs 2 tasks |
    -------------------------
    # Re-Executes the Failed Jobs
    nebula> RECOVER JOB;
    =====================
    | Recovered job num |
    =====================
    | 5 job recovered   |
    ---------------------

Pick of the 17th Week in 2020

  • CONTAINS: String Comparison Functions and Operators.

    We supported string comparison operator CONTAINS now. CONTAINS performs string filtering at any position on the query results. It is case-sensitive and can be used with logical operators. CONTAINS makes the query more flexible. Combining CONTAINS and logical operators make searching in queries more accurate.

    For example, the following query traverses teams vertex 107 served, filtering team names that contain "riors".

    nebula> GO FROM 107 OVER serve WHERE $$.team.name CONTAINS "riors" YIELD $^.player.name, serve.start_year, serve.end_year, $$.team.name;
    
    =====================================================================
    | $^.player.name | serve.start_year | serve.end_year | $$.team.name |
    =====================================================================
    | Aron Baynes    | 2001             | 2009           | Warriors     |
    ---------------------------------------------------------------------
    
  • Function: Supported scientific notations. PR: https://github.com/vesoft-inc/nebula/pull/2079

  • Client: Upgraded Java client dependence Guava. PR: https://github.com/vesoft-inc/nebula-java/pull/86

  • Tools: Supported importing remote files in Nebula Importer. PR: https://github.com/vesoft-inc/nebula-importer/pull/64

Pick of the 16th Week in 2020

We separated the Chinese Forum from the English one, the original domain is English forum now. What's more, we used new classification and tags for the Chinese Forum to help you find what you want more easily.

image.png

Share your ideas about classifications or tags on our Forum. Help us improve our community to better serve all the users.

  • Doc: Added TTL example when creating tag/edgeType. For example:
nebula> CREATE EDGE marriage(location string, since timestamp)
      TTL_DURATION = 0, TTL_COL = "since"; -- negative or zero, not expire

nebula> CREATE TAG icecream(made timestamp, temperature int)
      TTL_DURATION = 100, TTL_COL = "made"; --  Data expires after TTL_DURATION

carbon (2)

  • Doc: We migrated all the docs to a new repo. Visit our repo or Doc site.

image.png

Pick of the 15th Week in 2020

Nebula Graph Studio is a visualization web application that integrates data import and graph exploration.

The Nebula Graph Studio 1.0.2-beta version supports displaying edge properties and tagging vertices in graph exploration, making the visualization more vivid.

lADPD26eMQMhyZDNAzTNBeM_1507_820 jpg_720x720g

We posted a poll on Nebula Graph forum this week: What graph QL are you using? At present, Cypher leads Gremlin. What's your opinion? Click the post to tell us.

image.png

  • Doc: Added keywords and reserved words documentation. See the doc here.
# Non-reserved keywords are permitted as identifiers without quoting. All the non-reserved keywords are automatically converted to lower case. Non-reserved keywords are case-insensitive. Reserved words are permitted as identifiers if you quote them with back quotes such as `AND`.

nebula> CREATE TAG TAG(name string);
[ERROR (-7)]: SyntaxError: syntax error near `TAG'

nebula> CREATE TAG `TAG` (name string); -- TAG is reserved.
Execution succeeded

Pick of the 14th Week in 2020

The RC4 version supports INDEX, you can query the indexed data with LOOKUP ON. RC4 provides space-based access control and ACL authentication. For maintenance, we supported the monitor system by connecting Nebula Stats Exporter with Grafana and Prometheus.

We redesigned our official site homepage, adding a blog column to it. We also added labels for our blogs to tag different topics. If you want a new tag, tell us on our forum.

Pick of the 13th Week in 2020

image.png

Pick of the 12th Week in 2020

carbon (2)的副本

Pick of the 11th Week in 2020

  • Reservoir Sampling

Reservoir sampling is used to deal with super vertex in graph. A super vertex is a vertex with a large number of edges. Often you just need some of the edges of such vertices. Now you can truncate with the reservoir sampling algorithm. Based on the algorithm, a certain number of edges are truncated with equal probability from the total n edges.

How to use: Set the enable_reservoir_sampling parameter in the configuration file storaged-conf to true to enable the reservoir sampling. Set the sampling number with the parameter max_edge_returned_per_vertex. PR: https://github.com/vesoft-inc/nebula/pull/1746

image.png

  • Account management: Supported account management with statements CREATE USER, GRANT ROLE and REVOKE ROLE. There are four roles currently: GOD, ADMIN, DBA and GUEST. PR: https://github.com/vesoft-inc/nebula/pull/1842

  • INDEX: Supported index rebuilding. If data is updated or newly inserted after the index creation, it is necessary to rebuild the indexes in order to ensure that the indexes contain the previously added data. PR: https://github.com/vesoft-inc/nebula/pull/1566

image.png

REBUILD {TAG | EDGE} INDEX <index_name> [OFFLINE]

image.png

Pick of the 10th Week in 2020

image.png

# syntax
GO FROM <node_list> OVER <edge_type_list> BIDIRECT WHERE (expression [ AND | OR expression ...])  
  YIELD [DISTINCT] <return_list>
# example
nebula> GO FROM 102 OVER follow BIDIRECT;
===============
| follow._dst |
===============
| 101         |
---------------
| 103         |
---------------
| 135         |
---------------

image.png

# Change rocksdb_block_cache to 1024 MB
--rocksdb_block_cache = 1024
# Stop storaged and restart
/usr/local/nebula/scripts/nebula.service stop storaged
/usr/local/nebula/scripts/nebula.service start storaged

Pick of the 9th Week in 2020

  • 2020 H1 RoadMap

We released the first half-year road map 2020 for Nebula Graph. You can see the details on our official forum Announcements section.

image.png

  • The Nebula Graph forum is officially online.

Since the first announcement two weeks ago, we have officially launched the Nebula Graph forum today. We optimized the default page, content classification during the public test to support our users. Feel free to ask your first question on our forum and our developers are there for you 7*24. In the Announcements section, you can find the latest news and road map of Nebula Graph. Keep yourself updated on the Blog section to know more about the architecture and design behind Nebula Graph. Enjoy our forum here: https://discuss.nebula-graph.io/.

image.png

Last but not least, give us your suggestions or feedback on the Site Feedback section. Your thoughts matter.

image.png

=====================================================
 src/storage/test/StorageLookupBenchmark.cpprelative  time/iter  iters/s
 =====================================================
 PreciseScan_10000                                          9.65ms   103.65
 PreciseScan_100                                            5.23ms   191.03
 PreciseScan_10                                             4.14ms   241.64
 FilterScan_10                                              1.47s  679.35m
 =====================================================
nebula> CREATE SPACE my_space_4(partition_num=10, replica_factor=1, charset = utf8, collate = utf8_bin);

Pick of the 8th Week in 2020

image

  • task scheduler: Added job manager to manage long-time running tasks. Currently flush and compact are supported. You can start/stop/list/recover job. Use the RECOVER JOB command to read the failed tasks to the execution queue. PR: https://github.com/vesoft-inc/nebula/pull/1424

image

Pick of the 7th Week in 2020

Pick of the 6th Week in 2020

Pick of the 3rd Week in 2020

nebula> FETCH PROP ON person 1016,1017,1018
=======================================================
| VertexID | person.name | person.age | person.gender |
=======================================================
| 1017     | HeNa        | 11         | female        |
-------------------------------------------------------
| 1016     | Sonya       | 11         | male          |
-------------------------------------------------------
| 1018     | Tom         | 12         | male          |
-------------------------------------------------------
nebula> FETCH PROP ON is_schoolmate 1016->1017,1016->1018
=====================================================================================================================
| is_schoolmate._src | is_schoolmate._dst | is_schoolmate._rank | is_schoolmate.start_year | is_schoolmate.end_year |
=====================================================================================================================
| 1016               | 1017               | 0                   | 2015                     | 2019                   |
---------------------------------------------------------------------------------------------------------------------
| 1016               | 1018               | 0                   | 2014                     | 2019                   |
---------------------------------------------------------------------------------------------------------------------

Pick of the 2nd Week in 2020

  • Nebula Graph UI 1.0 Under Inner Test

You can use the GUI to connect Nebula Graph services, create schema, import data and explore your graph. Try our GUI in the GitHub Repository. Please refer to GUI tutorial on details.

  • Support Creating Tag/Edge Index

Implemented index in storage and query engine so you can create index for tag/edge. Currently supported index management operations are SHOW INDEX, DESCRIBE INDEX and DROP INDEX. Please refer to code pr for details. https://github.com/vesoft-inc/nebula/pull/1360, https://github.com/vesoft-inc/nebula/pull/1459, https://github.com/vesoft-inc/nebula/pull/1598

image

Pick of the 1st Week in 2020

Pick of the 52nd Week in 2019

  • Optimization of the pushing down filters. Label: optimization. Details please refer to the PR link
  • Supporting for obtaining the metrics of the graphd. Label: Graph. Details please refer to the PR link
  • Supporting Clang compiler for Ubuntu. Label: compiling. Details please refer to the PR link
Clone this wiki locally