Updated on 2025-11-17 GMT+08:00

Operating Environment and Data Preparation

Preparing the Environment

  • If you are new to DataArts Studio, register a Huawei account, buy a DataArts Studio instance, create workspaces, and make other preparations. For details, see Buying and Configuring a DataArts Studio Instance. Then you can go to the created workspace and start using DataArts Studio.

  • Create an MRS cluster that contains the Hive component on the MRS console. Metadata can be generated from the vertex and edge data sets in the cluster. When creating the MRS cluster, ensure that its network parameter settings (including the region, VPC, subnet, and security group) are consistent with those of the CDM cluster in the DataArts Studio instance so that the MRS cluster can communicate with the CDM cluster through the internal network. Otherwise, you need to manually enable the communication between the MRS cluster and the CDM cluster. In addition, ensure that the two clusters use the same enterprise project.

    During the creation of an MRS cluster, a security group is automatically created. You are advised to create an MRS security cluster first and then buy a DataArts Studio instance, selecting the same VPC and subnet as the MRS cluster and the security group (named in mrs_Cluster name_Random character format) that is automatically created. This ensures that the DataArts Studio instance can communicate with the MRS cluster by default.

    If you already have a DataArts Studio instance before creating an MRS cluster, you need to choose Access Control > Security Groups on the VPC console and add a rule to allow inbound traffic to the security group (named in mrs_Cluster name_Random character format) created by the MRS cluster. For details, see Configuring Security Group Rules.

  • Create a MySQL DB instance on the RDS console to simulate the data source. When creating the MySQL DB instance, ensure that its network parameter settings (including the region, VPC, subnet, and security group) are consistent with those of the CDM cluster in the DataArts Studio instance so that the MySQL DB instance can communicate with the CDM cluster through the internal network. Otherwise, you need to manually enable the communication between the MySQL DB instance and the CDM cluster. In addition, ensure that the MySQL DB instance and the CDM cluster use the same enterprise project.
  • Prepare an OBS bucket to store the generated metadata. The OBS bucket must be in the same region as the CDM cluster in the DataArts Studio instance, and the enterprise project of the OBS bucket must be the same as that of the CDM cluster.
  • Create a graph on the GES console to import graph data for visualized graph analysis. GES must be in the same region as the CDM cluster in the DataArts Studio instance, and the enterprise project of GES must be the same as that of the CDM cluster.

Preparing Data Sources

In this practice, the raw data includes the user table vertex_user, movie table vertex_movie, friend relationship table edge_friends, and movie rating table edge_rate. Figure 1 shows the relationships between them.

Figure 1 Graph data description

To facilitate demonstration, this practice provides some data used to simulate the original data. To integrate the source data into the cloud, you need to store the sample data in CSV files and upload them to an OBS bucket.

  1. Create CSV files (UTF-8 without BOM), name the files with the corresponding data table names, copy the sample data to different CSV files, and save the files.

    To generate a CSV file in Windows, you can perform the following steps:
    1. Use a text editor (for example, Notepad) to create a .txt document and copy the sample data to the document. Then check the total number of rows and check whether the data of rows is correctly separated. (If the sample data is copied from a PDF document, the data in a single row will be wrapped if the data is too long. In this case, you must manually adjust the data to ensure that it is in a single row.)
    2. Choose File > Save as. In the displayed dialog box, set Save as type to All files (*.*), enter the file name with the .csv suffix for File name, and select the UTF-8 encoding format (without BOM) to save the file in CSV format.

  2. Upload the CSV file to OBS.

    1. Log in to the management console and choose Storage > Object Storage Service to access the OBS console.
    2. Click Create Bucket and set parameters as prompted to create an OBS bucket named fast-demo.

      To ensure network connectivity, select the same region for OBS bucket as that for the DataArts Studio instance. If an enterprise project is required, select the enterprise project that is the same as that of the DataArts Studio instance.

      For details about how to create a bucket on the OBS console, see Creating a Bucket in Object Storage Service Console Operation Guide.

    3. Upload data to OBS bucket fast-demo.

      For details about how to upload a file on the OBS console, see Uploading a File in Object Storage Service Console Operation Guide.

This practice involves four sample data tables: user table vertex_user, movie table vertex_movie, friend relationship table edge_friends, and movie rating table edge_rate. The details are as follows:
  • User table vertex_user.csv:
    Vivian,F,25-34,artist,98133Mercedes,F,Under 18,K-12 student,10562Katherine,F,35-44,lawyer,79101Stuart,M,25-34,programmer,30316Jacob,M,25-34,artist,55408Editha,F,56+,homemaker,46911Cassandra,F,56+,artist,55113Sarah,F,18-24,other or not specified,55105Hayden,M,56+,academic/educator,30030Jeffery,M,25-34,self-employed,45242Bonnie,F,50-55,technician/engineer,19716Serena,F,35-44,programmer,44106Sidney,M,18-24,writer,85296Leander,M,50-55,doctor/health care,98237Fred,M,35-44,other or not specified,30906Roger,M,45-49,technician/engineer,73069Ella,F,25-34,other or not specified,94402Ray,M,18-24,college/grad student,90241Eric,M,18-24,college/grad student,40205Frances,F,56+,retired,1234Allison,F,18-24,sales/marketing,49505Willy,M,25-34,technician/engineer,38104Lance,M,18-24,college/grad student,6459June,F,25-34,other or not specified,13326Marshal,M,50-55,scientist,7746Max,M,35-44,executive/managerial,91107Hardy,M,35-44,academic/educator,22181Jordan,M,25-34,artist,8817Reed,M,18-24,college/grad student,89146Glendon,M,35-44,self-employed,46214Kevin,M,56+,retired,2356Evan,M,45-49,programmer,53718Clark,M,56+,academic/educator,85718Johnny,M,56+,retired,52003Caleb,M,50-55,retired,41076Janet,F,35-44,homemaker,61270Sue,F,50-55,self-employed,13207Margaret,F,45-49,academic/educator,1609Luke,M,35-44,executive/managerial,44306William,M,45-49,programmer,37914Lena,F,35-44,other or not specified,42420Solomon,M,45-49,scientist,64081-8102Cary,M,35-44,executive/managerial,55124Colin,M,25-34,executive/managerial,44115Kenny,M,25-34,college/grad student,74074Gavin,M,25-34,programmer,24060Donald,M,35-44,programmer,95864Wayne,M,18-24,scientist,94606Frank,M,18-24,college/grad student,2906Alexander,M,18-24,college/grad student,61801Isaiah,M,25-34,other or not specified,33142Josephine,F,25-34,college/grad student,78728Joshua,M,35-44,executive/managerial,54016August,M,35-44,customer service,64801Jessie,F,18-24,clerical/admin,60640Yvette,F,35-44,artist,94109Albert,M,25-34,other or not specified,40515Eugene,M,35-44,other or not specified,40504Rachel,F,35-44,doctor/health care,33314Constance,F,50-55,executive/managerial,10022Larry,M,45-49,technician/engineer,2067Mike,M,25-34,other or not specified,30606Hank,M,50-55,programmer,44286Daniel,M,45-49,technician/engineer,37923Wesley,M,25-34,executive/managerial,35244Gina,F,35-44,sales/marketing,60202Teresa,F,45-49,academic/educator,43202Terry,M,35-44,writer,80222Leo,M,50-55,academic/educator,93105Bruce,M,50-55,academic/educator,19087-3622Terence,M,25-34,writer,14450Alice,F,25-34,academic/educator,79928Benjamin,M,25-34,technician/engineer,48092Sharon,F,18-24,college/grad student,55406Ryan,M,18-24,college/grad student,26241Mason,M,25-34,technician/engineer,92584Gloria,F,56+,retired,60506Tom,M,25-34,writer,10010Melissa,F,35-44,doctor/health care,23507David,M,25-34,clerical/admin,19147Alex,M,18-24,college/grad student,10013Florence,F,35-44,academic/educator,23508Darwin,M,45-49,customer service,98502Michael,M,18-24,other or not specified,31211Brown,M,25-34,executive/managerial,90210Jimmy,M,25-34,writer,94122Jay,M,18-24,programmer,43650Gladys,F,18-24,programmer,5055Denny,M,45-49,tradesman/craftsman,2557Jack,M,50-55,other or not specified,94025Edison,M,45-49,executive/managerial,85287-2702Neil,M,35-44,scientist,48187Jennifer,F,35-44,writer,75093Caspar,M,25-34,other or not specified,3766Mickey,M,18-24,programmer,97205Arthur,M,25-34,executive/managerial,2139Christine,F,25-34,academic/educator,32303Adeline,F,Under 18,other or not specified,1036Cody,M,18-24,college/grad student,78705Hillary,F,35-44,executive/managerial,21117
  • Movie table vertex_movie.csv:
    American Beauty,1999,Comedy;DramaAirplane!,1980,ComedyRushmore,1998,ComedyPredator,1987,Action;Sci-Fi;ThrillerThere's Something About Mary,1998,ComedyThe Shawshank Redemption,1994,DramaElection,1999,ComedyClueless,1995,Comedy;RomanceThe Crying Game,1992,Drama;Romance;WarBack to the Future,1985,Comedy;Sci-FiThe Talented Mr. Ripley,1999,Drama;Mystery;ThrillerLife Is Beautiful (La vita ии bella),1997,Comedy;Drama2001: A Space Odyssey,1968,Drama;Mystery;Sci-Fi;ThrillerJaws,1975,Action;HorrorJerry Maguire,1996,Drama;RomanceThe Hunt for Red October,1990,Action;ThrillerClose Encounters of the Third Kind,1977,Drama;Sci-FiStar Wars: Episode IV - A New Hope,1977,Action;Adventure;Fantasy;Sci-FiRocky,1976,Action;DramaThe Usual Suspects,1995,Crime;ThrillerA Clockwork Orange,1971,Sci-FiPsycho,1960,Horror;ThrillerThe Godfather: Part II,1974,Action;Crime;DramaAnnie Hall,1977,Comedy;RomanceTerminator 2: Judgment Day,1991,Action;Sci-Fi;ThrillerPleasantville,1998,ComedyChinatown,1974,Film-Noir;Mystery;ThrillerIndependence Day (ID4),1996,Action;Sci-Fi;WarStar Wars: Episode V - The Empire Strikes Back,1980,Action;Adventure;Drama;Sci-Fi;WarFace/Off,1997,Action;Sci-Fi;ThrillerTotal Recall,1990,Action;Adventure;Sci-Fi;ThrillerBlade Runner,1982,Film-Noir;Sci-FiThe Terminator,1984,Action;Sci-Fi;ThrillerRobocop,1987,Action;Crime;Sci-FiThe Rock,1996,Action;Adventure;ThrillerSuperman,1978,Action;Adventure;Sci-FiThe Full Monty,1997,ComedyRaising Arizona,1987,ComedyLethal Weapon,1987,Action;Comedy;Crime;DramaPlatoon,1986,Drama;WarThe Fifth Element,1997,Action;Sci-FiThe Patriot,2000,Action;Drama;WarClerks,1994,ComedyBeing John Malkovich,1999,ComedyThe Mask,1994,Comedy;Crime;FantasyGrosse Pointe Blank,1997,Comedy;Crime
  • Friend relationship table edge_friends.csv:
    Gloria,DavidBrown,MasonTerence,KennyClark,BrownMickey,JanetMickey,MargaretHayden,ConstanceFrank,JanetLena,DarwinLeo,JimmyMercedes,GavinHillary,BruceLeo,NeilTerence,AugustSue,WayneMax,DennyMax,JosephineHillary,MichaelConstance,JanetFlorence,DonaldAlice,JacobRoger,SidneyMargaret,FrancesRoger,FredFred,DonaldMargaret,GavinFred,GavinRachel,JanetAlexander,ClarkDarwin,CassandraJordan,VivianTerry,LarryHardy,KevinTerry,RachelMercedes,MarshalMarshal,SharonJeffery,TomTerence,MaxKatherine,StuartLuke,CassandraMichael,ArthurLuke,EdithaNeil,MasonDarwin,JessieMarshal,AlexHardy,MargaretAlexander,EricMercedes,CasparBrown,ClarkRoger,KevinBenjamin,MaxJessie,AdelineMichael,LukeJimmy,GloriaIsaiah,FrancesJune,DarwinEditha,VivianCaspar,CassandraBruce,DennyCaspar,JacobIsaiah,EllaMason,RyanMercedes,EugeneRoger,JosephineWayne,AliceHayden,DennyAlexander,ColinLarry,AugustJimmy,BrownJacob,WilliamHardy,GladysJessie,CasparMason,TerenceJune,JenniferHardy,ArthurAlexander,SolomonLarry,WayneLarry,GavinElla,RayElla,EricAlice,JanetLarry,WillyIsaiah,SolomonBenjamin,LeanderIsaiah,SueCaspar,JordanElla,JordanVivian,EricMax,JayRyan,HankElla,ColinLuke,AlexanderLuke,JoshuaWayne,CasparWayne,DennyEditha,MarshalRyan,JessieMichael,CassandraSolomon,HillaryJordan,Josephine
  • Movie rating table edge_rate.csv:
    Vivian,Lethal Weapon,5,2000/12/27 23:44Mercedes,Raising Arizona,4,2000/12/27 23:51Katherine,The Rock,3,2000/12/27 20:12Stuart,The Mask,2,2000/12/27 20:00Jacob,Face/Off,4,2000/12/27 20:12Editha,There's Something About Mary,5,2000/12/27 20:06Cassandra,Superman,4,2000/12/27 20:11Sarah,American Beauty,4,2000/12/27 20:13Hayden,Lethal Weapon,3,2000/12/27 20:09Jeffery,2001: A Space Odyssey,4,2000/12/23 1:48Bonnie,A Clockwork Orange,3,2000/12/22 23:23Serena,Lethal Weapon,4,2000/12/22 23:24Sidney,Raising Arizona,4,2000/12/22 23:24Leander,Clerks,5,2000/12/12 16:58Fred,Superman,5,2000/12/18 1:17Roger,A Clockwork Orange,5,2000/12/13 23:54Ella,Robocop,5,2000/12/13 23:44Ray,The Talented Mr. Ripley,3,2000/12/14 0:24Eric,Psycho,5,2002/1/3 20:29Frances,The Godfather: Part II,2,2000/12/10 18:45Allison,Independence Day (ID4),3,2000/12/13 23:58Willy,Clerks,4,2002/1/3 20:46Lance,There's Something About Mary,5,2000/12/13 23:43June,Superman,4,2002/1/3 20:41Marshal,Being John Malkovich,5,2000/12/10 18:40Max,Predator,4,2000/12/10 18:32Hardy,Total Recall,3,2000/12/10 18:39Jordan,American Beauty,4,2000/12/13 23:57Reed,Lethal Weapon,1,2000/12/10 18:37Glendon,Airplane!,4,2000/12/13 23:46Kevin,Raising Arizona,4,2000/12/13 23:51Evan,Jerry Maguire,1,2000/12/13 23:58Clark,The Hunt for Red October,5,2000/12/13 23:46Johnny,2001: A Space Odyssey,3,2000/12/14 0:16Caleb,Clerks,4,2000/12/9 16:45Janet,Lethal Weapon,2,2000/12/9 16:16Sue,Close Encounters of the Third Kind,4,2000/12/9 16:14Margaret,Star Wars: Episode IV - A New Hope,2,2000/12/9 16:04Luke,Clueless,2,2000/12/8 19:02William,The Terminator,2,2000/12/8 19:03Lena,Robocop,5,2000/12/8 18:59Solomon,Lethal Weapon,5,2000/12/8 18:59Cary,Airplane!,5,2000/12/8 19:00Colin,The Usual Suspects,4,2000/12/5 20:59Kenny,Clueless,5,2000/12/5 20:52Gavin,A Clockwork Orange,4,2000/12/5 20:52Donald,The Talented Mr. Ripley,3,2000/12/5 20:52Wayne,Back to the Future,3,2000/12/5 20:56Frank,Being John Malkovich,4,2000/12/5 20:53Alexander,Predator,5,2000/12/5 20:52Isaiah,Jaws,4,2000/12/5 20:48Josephine,Chinatown,3,2000/12/5 20:55Joshua,The Mask,4,2000/12/5 20:54August,Platoon,4,2000/12/5 20:53Jessie,Election,4,2000/12/5 20:52Yvette,Rocky,5,2000/12/5 20:52Albert,The Fifth Element,4,2000/12/5 20:55Eugene,Clueless,4,2000/12/5 17:59Rachel,Lethal Weapon,5,2000/12/5 17:58Constance,Raising Arizona,4,2000/12/5 17:59Larry,The Usual Suspects,4,2000/12/5 15:07Mike,The Crying Game,5,2000/12/5 15:21Hank,Independence Day (ID4),4,2000/12/5 15:21Daniel,There's Something About Mary,4,2000/12/5 15:10Wesley,Lethal Weapon,5,2000/12/2 19:51Gina,The Godfather: Part II,3,2000/12/2 19:55Teresa,Total Recall,4,2000/12/2 19:44Terry,2001: A Space Odyssey,4,2000/12/2 19:53Leo,A Clockwork Orange,5,2000/11/28 23:22Bruce,The Full Monty,2,2000/11/28 23:12Terence,Predator,5,2000/11/28 23:07Alice,Jaws,5,2000/11/28 23:20Benjamin,Psycho,3,2000/11/28 23:08Sharon,Total Recall,5,2000/11/28 23:13Ryan,Election,5,2000/11/28 23:18Mason,The Fifth Element,2,2000/11/28 23:26Gloria,The Usual Suspects,5,2000/11/28 12:57Tom,Clueless,3,2000/11/28 13:09Melissa,A Clockwork Orange,3,2000/12/8 15:10David,The Talented Mr. Ripley,5,2000/12/25 13:24Alex,Independence Day (ID4),4,2000/11/28 13:14Florence,Star Wars: Episode V - The Empire Strikes Back,2,2000/12/8 15:23Darwin,The Full Monty,2,2000/11/28 13:16Michael,Being John Malkovich,4,2000/12/25 14:44Brown,Predator,5,2000/11/28 13:01Jimmy,Lethal Weapon,4,2000/12/8 15:07Jay,Jaws,4,2000/11/28 13:07Gladys,Psycho,4,2000/11/28 13:08Denny,The Godfather: Part II,3,2000/12/25 13:25Jack,Annie Hall,4,2000/12/8 15:05Edison,The Mask,3,2000/11/28 13:11Neil,Face/Off,4,2000/12/8 15:22Jennifer,There's Something About Mary,3,2000/12/25 6:17Caspar,Superman,3,2000/12/8 15:09Mickey,Total Recall,1,2000/11/28 13:14Arthur,American Beauty,3,2000/12/8 15:18Christine,Platoon,3,2000/12/2 13:21Adeline,Raising Arizona,4,2000/12/8 15:15Cody,Blade Runner,1,2000/12/8 15:22Hillary,Election,3,2000/11/28 12:57

Creating a Data Connection in Management Center

In this practice, you need to synchronize data from the MySQL database to MRS Hive, standardize the data based on the GES graph import requirements, and generate metadata using MRS Hive.

Therefore, you need to create an MRS connection in Management Center. The procedure is as follows:

  1. Log in to the DataArts Studio console by following the instructions in Accessing the DataArts Studio Instance Console.
  2. On the DataArts Studio console, locate a workspace and click Management Center.
  3. On the displayed Manage Data Connections page, click Create Data Connection.

    Figure 2 Creating a data connection

  4. On the displayed page, configure the following parameters and click Save.

    The following part describes how to create an MRS Hive connection. See Figure 3 for details.

    • Data Connection Type: MRS Hive is selected by default.
    • Name: Enter mrs_hive_link.
    • Tag: Enter a new tag name or select an existing tag from the drop-down list box. This parameter is optional.
    • Applicable Modules: Retain the default settings.
    • Connection Type: Select Proxy connection.
    • Manual: Select Cluster Name Mode. IP and Port are automatically set.
    • MRS Cluster Name: Select an existing MRS cluster.
    • KMS Key: Select a KMS key and use it to encrypt sensitive data. If no KMS key is available, click Access KMS to go to the KMS console and create one.
    • Agent: Select a DataArts Migration cluster as the connection agent. The DataArts Migration cluster and MRS cluster must be in the same region, AZ, VPC, and subnet, and the security group rule must allow communication between the two clusters. In this example, select the DataArts Migration cluster that is automatically created during DataArts Studio instance creation.

      To connect to an MRS 2.x cluster, select the DataArts Migration cluster of the 2.x version as the agent.

    • Username: Enter the Kerberos authentication user. In an MRS policy, user admin is the default management user and cannot be used as the authentication user of the cluster that uses Kerberos authentication. Therefore, to create a connection for an MRS cluster that uses Kerberos authentication, perform the following operations:
      1. Log in to MRS Manager as user admin.
      2. Choose System > Permission > Security Policy > Password Policy. Click Add Password Policy and add a policy under which the password never expires.
        • Set Password Policy Name to neverexp.
        • Set Password Validity Period (Days) to 0, indicating that the password never expires.
        • Set Password Expiration Notification (Days) to 0.
        • Retain the default values for other parameters.
      3. Choose System > Permission > User. On the page displayed, click Create to add a dedicated human-machine user as the Kerberos authentication user and set the password policy to neverexp. Select the user group superGroup for the user, and assign all roles to the user.
        • For clusters of MRS 3.1.0 or later, the user must at least have permissions of the Manager_viewer role to create data connections in Management Center. To perform database, table, and data operations on components, the user must also have user group permissions of the components.
        • For clusters earlier than MRS 3.1.0, the user must have permissions of the Manager_administrator or System_administrator role to create data connections in Management Center.
        • A user with only the Manager_tenant or Manager_auditor permission cannot create connections.
      4. Log in to Manager as the new user and change the initial password. Otherwise, the connection fails to be created.
      5. Synchronize IAM users.
        1. Log in to the MRS console.
        2. Choose Clusters > Active Clusters, select a running cluster, and click its name to go to its details page.
        3. In the Basic Information area of the Dashboard page, click Synchronize on the right side of IAM User Sync to synchronize IAM users.
          • If the status is Synchronized, skip this step.
          • When the policy of the user group to which the IAM user belongs changes from MRS ReadOnlyAccess to MRS CommonOperations, MRS FullAccess, or MRS Administrator, wait for 5 minutes until the new policy takes effect after the synchronization is complete because the SSSD (System Security Services Daemon) cache of cluster nodes needs time to be updated. Then, submit a job. Otherwise, the job may fail to be submitted.
          • When the policy of the user group to which the IAM user belongs changes from MRS CommonOperations, MRS FullAccess, or MRS Administrator to MRS ReadOnlyAccess, wait for 5 minutes until the new policy takes effect after the synchronization is complete because the SSSD cache of cluster nodes needs time to be updated.
    • Password: Enter the password of the Kerberos authentication user.
    Figure 3 Creating an MRS Hive data connection

Creating Data Tables

To facilitate demonstration, you need to import the sample data in CSV format to the MySQL database using DataArts Migration. Then, the MySQL database functions as the data source. You need to create raw data tables in the MySQL database before importing data.

In the formal service process, the source data of the MySQL database needs to be imported to the OBS database as the vertex and edge data sets. In that case, you do not need to create tables in advance. However, before importing source data from the MySQL database to MRS Hive, you need to create standard data tables in the MRS Hive database in advance.

Therefore, in this practice, you need to create raw data tables in the MySQL database and standard data tables in the MRS Hive database. This section describes how to create tables using SQL statements.

  1. Create a raw data table in the MySQL database. Run the following SQL statements in the MySQL database to create four raw data tables based on the raw data structure in Preparing Data Sources:

    DROP TABLE IF EXISTS `edge_friends`;CREATE TABLE `edge_friends` (    `user1` varchar(32) DEFAULT NULL,    `user2` varchar(32) DEFAULT NULL);DROP TABLE IF EXISTS `edge_rate`;CREATE TABLE `edge_rate` (    `user` varchar(32) DEFAULT NULL,    `movie` varchar(64) DEFAULT NULL,    `score` int(11) unsigned DEFAULT NULL,    `datatime` varchar(32) DEFAULT NULL);DROP TABLE IF EXISTS `vertex_movie`;CREATE TABLE `vertex_movie` (    `movie` varchar(64) DEFAULT NULL,    `year` varchar(32) DEFAULT NULL,    `genres` varchar(64) DEFAULT NULL);DROP TABLE IF EXISTS `vertex_user`;CREATE TABLE `vertex_user` (    `user` varchar(32) DEFAULT NULL,    `gender` varchar(32) DEFAULT NULL,    `age` varchar(32) DEFAULT NULL,    `occupation` varchar(32) DEFAULT NULL,    `zip-code` varchar(32) DEFAULT NULL);

  2. Create standard data tables in the MRS Hive database.

    Standardize the raw data structure based on the GES graph import requirements, that is, add labels to the second columns of vertex tables vertex_user and vertex_movie, and add labels to the third columns of edge tables edge_rate and edge_friends.

    The vertex and edge data sets must comply with the data format requirements of GES graphs. The graph data format requirements are briefed as follows. For details, see Graph Data Formats.
    • The vertex data set contains the data of each vertex. Each row is the data of a vertex. The format is as follows. id is the unique identifier of vertex data.
      id,label,property 1,property 2,property 3,...
    • The edge data set contains the data of each edge. Each row is the data of an edge. Graph specifications in GES are defined based on the edge quantity, for example, one million edges. The format is as follows. id 1 and id 2 are the IDs of the two endpoints of an edge.
      id 1, id 2, label, property 1, property 2,...

    On the DataArts Factory console, you can select the MRS Hive connection created in Creating a Data Connection in Management Center, select a database, and run the following SQL statement to create a standard data table in the MRS Hive database.

    Figure 4 Creating a standard data table in the MRS Hive database

    DROP TABLE IF EXISTS `edge_friends`;CREATE TABLE test_ges.`edge_friends` (    `user1` STRING COMMENT '',    `user2` STRING COMMENT '',    `label` STRING COMMENT '');DROP TABLE IF EXISTS `edge_rate`;CREATE TABLE test_ges.`edge_rate` (    `user` STRING COMMENT '',    `movie` STRING COMMENT '',    `label` STRING COMMENT '',    `score` INT COMMENT '',    `datatime` STRING COMMENT '');DROP TABLE IF EXISTS `vertex_movie`;CREATE TABLE test_ges.`vertex_movie` (    `movie` STRING COMMENT '',    `label` STRING COMMENT '',    `year` STRING COMMENT '',    `genres` STRING COMMENT '');DROP TABLE IF EXISTS `vertex_user`;CREATE TABLE test_ges.`vertex_user` (    `user` STRING COMMENT '',    `label` STRING COMMENT '',    `gender` STRING COMMENT '',    `age` STRING COMMENT '',    `occupation` STRING COMMENT '',    `zip-code` STRING COMMENT '');