跳转至
开发版采用单机部署,无需产品 License 文件。需要多机部署或大规模性能测试? 了解企业版

腾讯云配置

本文介绍从腾讯云数据源导入数据的配置项。关于完整配置文件和配置项的信息,请参见数据导入配置。

数据源配置

下表列出了腾讯云数据源特定的配置项:

选项 描述 类型 是否必选 默认值
type 数据源的类型。设置为"oss"。 String 是 无
format 源数据的文件格式。有效值为"csv"、"json"、"orc"和"parquet"。 String 否 "csv"
region 需要访问的存储桶的区域。更多信息,请参见地域和访问域名。 String 是 无
secretId 腾讯云对象存储服务的 SecretId。 String 是 无
secretKey 腾讯云对象存储服务的 SecretKey。 String 是 无
path 腾讯云中源数据的路径。路径可以指定目录或文件,使用前缀cosn://加上绝对路径。 String 是 无
header CSV 文件是否包含表头。仅当format设置为"csv"时生效。 Bool 否 false
separator CSV 文件中使用的分隔符。仅当format设置为"csv"时生效。 String 否 ","
endpointSuffix 为腾讯云对象存储服务设置的域名后缀。更多信息,请参见设置访问域名(CDN/全球加速)。 String 否 无
credentialsProvider 获取腾讯云对象存储服务 SecretId 和 SecretKey 的方法。更多信息,请参见属性键fs.cosn.credentials.provider的配置说明。 String 否 无
useHttps 是否使用 HTTPS 作为与腾讯云对象存储服务器的协议。 Bool 否 false
clientEncryptionEnabled 是否启用客户端加密。 String 否 false
clientEncryptionPublicKeyPath 客户端公钥的路径。 String 否 无
clientEncryptionPrivateKeyPath 客户端私钥的路径。 String 否 无

通用源配置

下列配置项也可以作为全局设置在配置文件的sourcesCommon一节指定:

  • type
  • format
  • region
  • header
  • separator
  • secretId
  • secretKey
  • endpointSuffix
  • credentialsProvider
  • useHttps
  • clientEncryptionEnabled
  • clientEncryptionPublicKeyPath
  • clientEncryptionPrivateKeyPath

请注意,针对特定数据源的配置会覆盖全局设置。

数据源配置示例

腾讯云源配置
sources: [
{
      type:"oss"
      format: "csv"
      region:"ap-guangzhou"
      secretId:"xxxx"
      secretKey:"xxx"
      path: "cosn://import_movie/player.csv"
      header: true
      separator: ","
//    nodetypes: []
//    edgetypes: []
    }
] 

完整配置示例

将<current-password>替换为登录账号的当前密码。若已修改密码,请使用修改后的密码。

{
  taskType: import
  nebula: {
    graphAddr: "127.0.0.1:9669"
    graphName: "movie"
    user: "root"
    passwd: "<current-password>"
  }

  error: {
    path: "/tmp/errors"
    maxRecords: 100
  }

  checkPoint: {
    path: "/tmp/checkpoint"
    resume: false
  } 

  sourcesCommon:{
    type:"oss"
    format: "csv"
    region:"ap-guangzhou"
    secretId:"xxxx"
    secretKey:"xxx"    
    header: true
    separator: ","
  }

   writeCommon:{
    batchSize: 2000
    enableRealTimeQPSLog: true
    mode: "INSERT IGNORE"
  } 

  sources: [
    # node type Actor
    {   
      path: "cosn://import_movie/sub_actor.csv"

      pre_processes: {
          filter: ["birth_date!='\\N'"]
          concatConstant: [
            {
              field: "name"
              prefixValue: "test_"
              suffixValue: ""
            }
          ]
      }

      nodetypes: [
        {
          name: "Actor"
          sourceFields: [people_id,name,birth_date]
          nebulaFields: [id,name,birthDate]
        }
      ]
    }

    # node type Movie
    {    
      path: "cosn://import_movie/sub_movie.csv"
      nodetypes: [
        {
          name: "Movie"
          sourceFields: [movie_id,name]
          nebulaFields: [id,name]
        }
      ]
    }

   # edge type Act
    {   
      path: "cosn://import_movie/sub_actor_act_movie.csv"
      edgetypes: [
        {
          name: "Act"
          sourceKeys: [people_id]
          targetKeys: [movie_id]
          sourceFields: []
          nebulaFields: []
        }
      ]
    }

  ]
}