arangodb mysql_ArangoDB数据导入
目录
1.arangoimp方法
参数解析
全局配置部分(Global configuration)
--backslash-escape
use backslash as the escape character for quotes, used for csv (default: false)
--batch-size
size for individual data batches (in bytes) (default: 16777216)
--collection
collection name (default: "")
--configuration
the configuration file or 'none' (default: "")
--convert
convert the strings 'null', 'false', 'true' and strings containing numbers into non-string types (csv and tsv only) (default: true)
--create-collection
create collection if it does not yet exist (default: false)
--create-collection-type
type of collection if collection is created (edge or document). possible values: "document", "edge" (default: "document")
--file
file name ("-" for STDIN) (default: "")
--from-collection-prefix
_from collection name prefix (will be prepended to all values in '_from') (default: "")
--ignore-missing
ignore missing columns in csv input (default: false)
--on-duplicate
action to perform when a unique key constraint violation occurs. Possible values: ignore, replace, update, error. possible values: "error", "ignore", "replace", "update" (default: "error")
--overwrite
overwrite collection if it exist (WARNING: this will remove any data from the collection) (default: false)
--progress
show progress (default: true)
--quote
quote character(s), used for csv (default: """)
--remove-attribute
remove an attribute before inserting an attribute into a collection (for csv and tsv only) (default: )
--separator
field separator, used for csv and tsv (default: "")
--skip-lines
number of lines to skip for formats (csv and tsv only) (default: 0)
--threads
Number of parallel import threads. Most useful for the rocksdb engine (default: 2)
--to-collection-prefix
_to collection name prefix (will be prepended to all values in '_to') (default: "")
--translate
translate an attribute name (use as --translate "from=to", for csv and tsv only) (default: )
--type
type of import file. possible values: "auto", "csv", "json", "jsonl", "tsv" (default: "json")
--version
reports the version and exits (default: false)
Section 'log' (Configure the logging)
--log.color
use colors for TTY logging (default: true)
--log.level
the global or topic-specific log level (default: "info")
--log.output
log destination(s) (default: )
--log.role
log server role (default: false)
--log.use-local-time
use local timezone instead of UTC (default: false)
--log.use-microtime
use microtime instead (default: false)
Section 'server' (Configure a connection to the server)
--server.authentication
require authentication credentials when connecting (does not affect the server-side authentication settings) (default: true)
--server.connection-timeout
connection timeout in seconds (default: 5)
--server.database
database name to use when connecting (default: "_system")
--server.endpoint
endpoint to connect to, use 'none' to start without a server (default: "http+tcp://127.0.0.1:8529")
--server.password
password to use when connecting. If not specified and authentication is required, the user will be prompted for a password (default: "")
--server.request-timeout
request timeout in seconds (default: 1200)
--server.username
username to use when connecting (default: "root")
Section 'ssl' (Configure SSL communication)
--ssl.protocol
ssl protocol (1 = SSLv2, 2 = SSLv2 or SSLv3 (negotiated), 3 = SSLv3, 4 = TLSv1, 5 = TLSV1.2). possible values: 1, 2, 3, 4, 5 (default: 5)
Section 'temp' (Configure temporary files)
--temp.path
path for temporary files (default: "")
应用实例
导入节点集合数据
arangoimp --server.endpoint tcp://127.0.0.1:8529 --server.username root --server.password ××× --server.database _system --file test.csv --type csv --create-collection true --create-collection-type document --overwrite true --collection "test"
导入边集合数据
arangoimp --server.endpoint tcp://127.0.0.1:8529 --server.username root --server.password *** --server.database _system --file test.csv --type csv --create-collection true --create-collection-type document --overwrite true --collection "test"
python方法
单条导入
from arango import ArangoClient
# Initialize the ArangoDB client.
client = ArangoClient()
# Connect to "test" database as root user.
db = client.db('test', username='root', password='passwd')
# Get the API wrapper for "students" collection.
students = db.collection('students')
# Create some test documents to play around with.
lola = {'_key': 'lola', 'GPA': 3.5, 'first': 'Lola', 'last': 'Martin'}
# Insert a new document. This returns the document metadata.
metadata = students.insert(lola)
批量数据导入
由于每一次insert就会产生一次数据库连接,当数据规模较大时,一次次插入比较浪费网络资源,这时候就需要使用Transactions了
from arango import ArangoClient
# Initialize the ArangoDB client.
client = ArangoClient()
# Connect to "test" database as root user.
db = client.db('test', username='root', password='passwd')
# Get the API wrapper for "students" collection.
students = db.collection('students')
# Begin a transaction via context manager. This returns an instance of
# TransactionDatabase, a database-level API wrapper tailored specifically
# for executing transactions. The transaction is automatically committed
# when exiting the context. The TransactionDatabase wrapper cannot be
# reused after commit and may be discarded after.
with db.begin_transaction() as txn_db:
# Child wrappers are also tailored for transactions.
txn_col = txn_db.collection('students')
# API execution context is always set to "transaction".
assert txn_db.context == 'transaction'
assert txn_col.context == 'transaction'
# TransactionJob objects are returned instead of results.
job1 = txn_col.insert({'_key': 'Abby'})
job2 = txn_col.insert({'_key': 'John'})
job3 = txn_col.insert({'_key': 'Mary'})
# Upon exiting context, transaction is automatically committed.
assert 'Abby' in students
assert 'John' in students
assert 'Mary' in students
# Retrieve the status of each transaction job.
for job in txn_db.queued_jobs():
# Status is set to either "pending" (transaction is not committed yet
# and result is not available) or "done" (transaction is committed and
# result is available).
assert job.status() in {'pending', 'done'}
# Retrieve the job results.
metadata = job1.result()
assert metadata['_id'] == 'students/Abby'
metadata = job2.result()
assert metadata['_id'] == 'students/John'
metadata = job3.result()
assert metadata['_id'] == 'students/Mary'
# Transactions can be initiated without using a context manager.
# If return_result parameter is set to False, no jobs are returned.
txn_db = db.begin_transaction(return_result=False)
txn_db.collection('students').insert({'_key': 'Jake'})
txn_db.collection('students').insert({'_key': 'Jill'})
# The commit must be called explicitly.
txn_db.commit()
assert 'Jake' in students
assert 'Jill' in students
参考资料
ITTC数据挖掘平台介绍(五) 数据导入导出向导和报告生成
一. 前言 经过了一个多月的努力,软件系统又添加了不少新功能.这些功能包括非常实用的数据导入导出,对触摸进行优化的画布和画笔工具,以及对一些智能分析的报告生成模块等.进一步加强了平台系统级的功能. 马 ...
FineReport实现EXCEL数据导入自由报表
在制作填报报表的时候,对于空白填报表,常常导出为Excel,派发给各部门人员填写后上交.如何能避免手动输入,直接将Excel中的数据导入到填报表中提交入库呢? 这里以一个简单的员工信息填报示例进行介绍 ...
Execl数据导入sql server方法
在日常的程序开发过程中,很多情况下,用户单位给予开发人员的数据往往是execl或者是access数据,如何把这些数据转为企业级是数据库数据呢,下面就利用sqlserver自带的功能来完成此项任务. 首 ...
kettle将Excel数据导入oracle
导读 Excel数据导入Oracle数据库的方法: 1.使用PL SQL 工具附带的功能,效率比较低 可参考这篇文章的介绍:http://www.2cto.com/database/201212/17 ...
[Asp.net]常见数据导入Excel,Excel数据导入数据库解决方案,总有一款适合你!
引言 项目中常用到将数据导入Excel,将Excel中的数据导入数据库的功能,曾经也查找过相关的内容,将曾经用过的方案总结一下. 方案一 NPOI NPOI 是 POI 项目的 .NET 版本.POI ...
sqlserver 中数据导入到mysql中的方法以及注意事项
数据导入从sql server 到mysql (将数据以文本格式从sqlserver中导出,注意编码格式,再将文本文件导入mysql中): 1.若从slqserver中导出的表中不包含中文采用: bc ...
数据分析(7):pandas介绍和数据导入和导出
前言 Numpy Numpy是科学计算的基础包,对数组级的运算支持较好 pandas pandas提供了使我们能够快速便捷地处理结构化数据的大量数据结构和函数.pandas兼具Numpy高性能的数组计 ...
MySQL学习笔记十一:数据导入与导出
数据导入 1.mysqlimport命令行导入数据 在使用mysqlimport命令导入数据时,数据来源文件名要和目标表一致,不想改文件名的话,可以复制一份创建临时文件,示例如下. 建立一个文本use ...
geotrellis使用(十二)再记录一次惨痛的伪BUG调试经历(数据导入以及读取瓦片)
Geotrellis系列文章链接地址http://www.cnblogs.com/shoufengwei/p/5619419.html 目录 前言 BUG还原 查找BUG 解决方案 总结 后记 一.前 ...
随机推荐
常用的Jquery插件
0.模块化前端框架(http://www.layui.com) 1.拖拽滑动验证码(http://www.geetest.com/,https://github.com/dyh1995/jquery. ...
cocos2d-x android项目引用so库编译
项目接了几十个渠道平台,每个平台都建了一个Android工程,引用Classes,由于才用java接口类来抽象出平台接口方法,所以每个工程的Android.mk是完全一致的,也就是说libgame.s ...
Acdream1157---Segments (CDQ分治)
陈丹琦分治~~~其实一些数据小的时候可以用二维或者多维树状数组做的,而数据大的时候就无力的题目,都可以用陈丹琦分治解决. 题目:由3钟类型操作:1)D L R(1 <= L <= R &l ...
js 获取asp:dropdownlist选中的值
var eSection = document.getElementById(""); var eSectionValu ...
C语言之计算log2
#includeint main(){int num,count=0,i=0,ret=0;scanf("%d",&num);count=num ...
js 前端有消息了 声音提示给用户
前言:工作中有需求,在数据变更有变更时采用声音提示给用户,这里记录一下.转载请注明出处:https://www.cnblogs.com/yuxiaole/p/9936180.html 网站地址:我的个 ...
RHEL7 CentOS7 的 firewall命令简单介绍
firewall 服务介绍 firewall 服务是 redhat7 和 centos7 系统默认安装好的防火墙服务,一个信任级别的概念来管理与之相关联的连接与接口.它支持 ipv4 与 ipv6,并 ...
Depth-first Search-690. Employee Importance
You are given a data structure of employee information, which includes the employee's unique id, his ...
调研ANDRIOD平台的开发环境的发展演变
在同学的推荐下,我选用学习eclipse这个软件,参考了这个网址的教程开始了一步一步的搭建之路. http://jingyan.baidu.com/article/bea41d437a41b6b4c5 ...
arangodb mysql_ArangoDB数据导入相关推荐
- arangodb mysql_ArangoDB数据库入门
一.ArangoDB介绍 ArangoDB是一个开源NoSQL数据库,官网:www.ArangoDB.org/可以灵活的使用键值对.文档.图及其组合构建你的数据模型. 2)查询便利 ArangoDB有 ...
- Python:数据导入、爬虫:csv,excel,sql,html,txt
''' 来源:天善智能韦玮老师课堂笔记 作者:Dust 数据导入 ·导入csv数据csv是一种常见的数据存储格式,基本上我们遇到的数据都可以转为这种存储格式.在Python数据分析中,我们可以使用pa ...
- matlab在曲线给命名,matlab 利用xlsread画图,怎么将一组excel数据导入,通过matlab作图...
Matlab 循环 for 语句 xlsread EXCEL表格数据导入 画图 Matlab的 xlsread() 函数可以将Excel数据到matlab工作空间,然后就可以根据读入据作图.下面给出操 ...
- Rocksdb 通过ingestfile 来支持高效的离线数据导入
文章目录 前言 使用方式 实现原理 总结 前言 很多时候,我们使用数据库时会有离线向数据库导入数据的需求.比如大量用户在本地的一些离线数据,想要将这一些数据导入到已有的数据库中:或者说NewSQL场景 ...
- sql server 2008数据导入Oracle方法
试了几种sql server数据导入Oracle的方法,发现还是sql server 的导入导出工具最好使.使用方法很简单,照着向导做就可以.不过使用中需要注意以下几点: 系统盘需要足够大.因为SSI ...
- 将excel中是数据导入数据库
2019独角兽企业重金招聘Python工程师标准>>> 将excel中是数据导入数据库 1.利用excel生成sql语句: 列如: 1).insert: =CONCATENATE(& ...
- eplise怎么连接数据库_基于手机信令的大数据分析教程(一)数据导入数据库
前言 该套教程以一个初学大数据的菜鸟视角,编写数据分析处理的整套流程.写得较为详(luo)细(suo),希望适用于任何城乡规划大数据的初学者.持续更新中,若有错误,望指正! 1.任务总纲 (1)职住数 ...
- SQLServer怎样把本地数据导入到远程服务器上(转载)
平常用到mssql时间比较少,总是过一段时间就忘记应该怎么操作了.当要做mssq把本地数据导入到远程服务器的时候,就去网上搜索很久都没有图解的,所以今天自己收集一下免得下次又到处去找.希望对自己,同时 ...
- c#直接调用ssis包实现Sql Server的数据导入功能
调用ssis包实现Sql Server的数据导入功能网上已经有很多人讨论过,自己参考后也动手实现了一下,上一次笔者的项目中还用了一下这个功能.思前想后,决定还是贴一下增强记忆,高手请54. 1.直接调 ...
最新文章
- PHP实现上一篇、下一篇
- 基于Linux系统中进程调度分析
- 3.在slave1机器下载3个安装包解压后,复制给master机器
- 学习 SQL 语句 - Select(7): 分组统计之 Avg()、Sum()、Max()、Min()、Count()
- 现代CIO的关键是需要建立 IT/OT之间的桥梁
- 读过的最好的epoll讲解
- 领域应用 | 人工智能+知识图谱:如何规整海量金融大数据?
- oracle10g中获得可更新的(修改、增加等) ResultSet
- ssms win10_10个SSMS技巧和窍门可提高您的生产力
- c语言中缀表达式求值_[源码和文档分享]基于C++的表达式计算求值
- 标识符——Python
- Idea2020版本设置编码格式
- 用户控件中复杂属性的设计时支持
- 计算机图片处理器,光学图像处理器
- 华为手机怎么把计算机放到桌面,将华为手机投影到计算机屏幕
- 高并发与高可用知识总结
- 前端“智能”静态资源管理 - Onebox - 博客园
- 浙大毕业演讲 --- 马一浮
- 根据出生日期判断星座
- 英语底子薄的人,怎样高效复习考博英语?