【问题标题】:Load CSV data from aws-s3 in dse Graph Loader在 dse Graph Loader 中从 aws-s3 加载 CSV 数据
【发布时间】:2017-03-10 23:52:15
【问题描述】:

我有关于 aws-s3 的数据(csv 格式),我想使用 Graph Loader 将这些数据加载到 dse 图中。我有搜索,但没有找到关于这个主题的内容。是否可以使用 dse graph Loader?

【问题讨论】:

    标签: datastax datastax-enterprise datastax-startup datastax-enterprise-graph


    【解决方案1】:

    以下是从 csv 读取时映射查找图形加载器的方式:

    https://docs.datastax.com/en/latest-dse/datastax_enterprise/graph/dgl/dglCSV.html

    这是一个 HDFS 示例(也包含 csv 文件),S3 应该类似(只需交换 dfs_url:

    // Configures the data loader to create the schema
    config create_schema: true, load_new: true, preparation: true
    // Define the data input sources
    // dfs_uri specifies the URI to the HDFS directory in which the files are stored.
    dfs_uri = 'hdfs://host:port/path/'
    authorInput = File.csv(dfs_uri + 'author.csv.gz').gzip().delimiter('|')
    //Specifies what data source to load using which mapper (as defined inline)
    load(authorInput).asVertices
    { label "author" key "name" }
    // graphloader call
    ./graphloader myMap.groovy -graph testHDFS -address localhost
    // start gremlin console and check the data
    bin/dse gremlin-console
    :remote config reset g testHDFS.g
    schema.config().option('graph.schema_mode').set('Development')
    g.V().hasLabel('author')
    

    【讨论】:

    猜你喜欢
    • 2019-09-19
    • 2016-12-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-11
    • 2021-11-06
    • 2015-10-13
    相关资源
    最近更新 更多