-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexport.html
1013 lines (815 loc) · 59.8 KB
/
export.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<link rel="stylesheet" href="/assets/css/just-the-docs-default.css">
<style type="text/css">
.site-nav > .nav-list:nth-child(1):not(.nav-category-list) > .nav-list-item:not(.external):nth-child(3) > .nav-list > .nav-list-item:nth-child(7) > .nav-list-link { display: block; font-weight: 600; text-decoration: none; background-image: linear-gradient(-90deg, #ebedf5 0%, rgba(235, 237, 245, 0.8) 80%, rgba(235, 237, 245, 0) 100%); }
.site-nav > .nav-list:nth-child(1):not(.nav-category-list) > .nav-list-item:not(.passive):nth-child(3) > .nav-list-expander svg, .site-nav > .nav-list:nth-child(1):not(.nav-category-list) > .nav-list-item:not(.passive):nth-child(3) > .nav-list > .nav-list-item:not(.passive):nth-child(7) > .nav-list-expander svg { transform: rotate(-90deg); }
.site-nav > .nav-list:nth-child(1):not(.nav-category-list) > .nav-list-item:not(.passive):nth-child(3) > .nav-list, .site-nav > .nav-list:nth-child(1):not(.nav-category-list) > .nav-list-item:not(.passive):nth-child(3) > .nav-list > .nav-list-item:not(.passive):nth-child(7) > .nav-list { display: block; }
.site-nav > .nav-category-list > .nav-list-item:not(.passive) > .nav-list-expander svg { transform: rotate(-90deg); }
.site-nav > .nav-category-list > .nav-list-item:not(.passive) > .nav-list { display: block; }
</style>
<script src="/assets/js/vendor/lunr.min.js"></script>
<script src="/assets/js/just-the-docs.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<!-- Begin Jekyll SEO tag v2.8.0 -->
<title>Export Data | lakeFS Documentation</title>
<meta name="generator" content="Jekyll v3.9.3" />
<meta property="og:title" content="Export Data" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="Use the lakeFS Spark client or RClone inside Docker to export a lakeFS commit to the object store." />
<meta property="og:description" content="Use the lakeFS Spark client or RClone inside Docker to export a lakeFS commit to the object store." />
<meta property="og:site_name" content="lakeFS Documentation" />
<meta property="og:image" content="https://docs.lakefs.io/assets/img/docs_logo.png" />
<meta property="og:type" content="website" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:image" content="https://docs.lakefs.io/assets/img/docs_logo.png" />
<meta property="twitter:title" content="Export Data" />
<meta name="twitter:site" content="@lakeFS" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"WebPage","description":"Use the lakeFS Spark client or RClone inside Docker to export a lakeFS commit to the object store.","headline":"Export Data","image":"https://docs.lakefs.io/assets/img/docs_logo.png","publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"/assets/logo.svg"}},"url":"/howto/export.html"}</script>
<!-- End Jekyll SEO tag -->
<!-- Google Tag Manager Head -->
<!-- type="text/plain" is intentional for cookie consent support -->
<script type="text/plain" data-category="analytics">(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-KTZBZW9');</script>
<!-- End Google Tag Manager Head -->
<meta property="og:image" content="/assets/img/lakefs-logo-with-text.png">
<link rel="preload" href="/assets/fonts/Rene Bieder - Galano Grotesque.otf" as="font" type="font/otf" crossorigin>
<link rel="preload" href="/assets/fonts/Rene Bieder - Galano Grotesque Medium.otf" as="font" type="font/otf" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/fontawesome.min.css" integrity="sha512-giQeaPns4lQTBMRpOOHsYnGw1tGVzbAIHUyHRgn7+6FmiEgGGjaG0T2LZJmAPMzRCl+Cug0ItQ2xDZpTmEc+CQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css" integrity="sha512-MV7K8+y+gLIBoVD59lQIYicR65iaqukzvf/nwasF0nqhPay5w/9lJmVM2hMDcnK1OnMGCdVK+iQrJ7lzPJQd1w==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.13.2/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.13.2/jquery-ui.min.js"></script>
<!--<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/orestbida/[email protected]/dist/cookieconsent.css">-->
<!--<link rel="stylesheet" href="/assets/css/cookieconsent.css" />-->
<!--<script type="module" src="/assets/js/cookieconsent-init.js"></script>-->
<script src="/assets/js/copy-code.js"></script>
<script>
$(function () {
$(".tabs").tabs();
});
</script>
<script src="/assets/js/feedback.js"></script>
</head>
<script src="https://unpkg.com/[email protected]/dist/mermaid.min.js"></script>
<script>
$(document).ready(function () {
mermaid.initialize({
startOnLoad:true,
theme: "default",
});
window.mermaid.init(undefined, document.querySelectorAll('.language-mermaid'));
});
</script>
<body>
<img src="/assets/img/cookies.png" style="display: none;">
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KTZBZW9"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="svg-link" viewBox="0 0 24 24">
<title>Link</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
class="feather feather-link">
<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path>
<path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path>
</svg>
</symbol>
<symbol id="svg-search" viewBox="0 0 24 24">
<title>Search</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
class="feather feather-search">
<circle cx="11" cy="11" r="8"></circle>
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
</svg>
</symbol>
<symbol id="svg-menu" viewBox="0 0 24 24">
<title>Menu</title>
<svg xmlns="http://www.w3.org/2000/svg" width="20px" height="16px" viewBox="0 0 20 16" version="1.1"
class="feather feather-menu">
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="header-/-mobile" transform="translate(-30.000000, -32.000000)" fill="#279890">
<g id="Group" transform="translate(30.000000, 32.000000)">
<path
d="M20,14 L20,16 L0,16 L0,14 L20,14 Z M20,7 L20,9 L0,9 L0,7 L20,7 Z M20,0 L20,2 L0,2 L0,0 L20,0 Z"
id="mobile-menu" />
</g>
</g>
</g>
</svg>
</symbol>
<symbol id="svg-arrow-right" viewBox="0 0 24 24">
<title>Expand</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
class="feather feather-chevron-right">
<polyline points="9 18 15 12 9 6"></polyline>
</svg>
</symbol>
<symbol id="svg-doc" viewBox="0 0 24 24">
<title>Document</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
class="feather feather-file">
<path d="M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"></path>
<polyline points="13 2 13 9 20 9"></polyline>
</svg>
</symbol>
</svg>
<div class="body-wrapper">
<div class="side-bar">
<div class="site-header">
<a href="https://lakefs.io" class="site-title lh-tight">
<div class="site-logo" role="img" aria-label="lakeFS Documentation"></div>
</a>
<a href="#" id="menu-button" class="site-button">
<svg viewBox="0 0 24 24" class="icon">
<use xlink:href="#svg-menu"></use>
</svg>
</a>
</div>
<nav role="navigation" aria-label="Main" id="site-nav" class="site-nav">
<div class="search">
<div class="search-input-wrap">
<input type="text" id="search-input" class="search-input" tabindex="0"
placeholder="Search lakeFS Documentation" aria-label="Search lakeFS Documentation"
autocomplete="off">
<label for="search-input" class="search-label"><svg viewBox="0 0 24 24" class="search-icon">
<use xlink:href="#svg-search"></use>
</svg></label>
</div>
<div id="search-results" class="search-results"></div>
</div>
<div class="nav-category nav-version">
<label for="selectversion">Version:</label>
<select id="selectversion" name="version" onchange="javascript:location.href = '/' + encodeURI(this.value);">
<option value="" selected>Latest</option>
</select>
</div>
<script async>
window.addEventListener("load", async () => {
const pathFirstLevel = location.pathname.split('/')[1];
const selectedVersion = pathFirstLevel.startsWith('v') && pathFirstLevel || '';
const selectVersionElmFirst = document.getElementById('selectversion').firstElementChild;
const response = await fetch('/versions.json');
if (!response.ok) {
return
}
const versions = await response.json();
for (let [key, value] of Object.entries(versions)) {
const el = document.createElement("option");
el.value = key;
el.textContent = value;
if (key === selectedVersion) {
el.selected = true;
}
selectVersionElmFirst.after(el);
}
});
</script>
<ul class="nav-list"><li
class="nav-list-item"><a href="/"
class="nav-list-link">Welcome to lakeFS</a></li><li
class="nav-list-item"><a href="#" class="nav-list-expander"><svg viewBox="0 0 24 24">
<use xlink:href="#svg-arrow-right"></use>
</svg></a><a href="/quickstart/"
class="nav-list-link">⭐ Quickstart</a><ul class="nav-list "><li class="nav-list-item "><a href="/quickstart/launch.html"
class="nav-list-link">1️⃣ Run lakeFS</a></li><li class="nav-list-item "><a href="/quickstart/query.html"
class="nav-list-link">2️⃣ Query the data</a></li><li class="nav-list-item "><a href="/quickstart/branch.html"
class="nav-list-link">3️⃣ Create a branch</a></li><li class="nav-list-item "><a href="/quickstart/commit-and-merge.html"
class="nav-list-link">4️⃣ Commit and Merge</a></li><li class="nav-list-item "><a href="/quickstart/rollback.html"
class="nav-list-link">5️⃣ Roll back Changes</a></li><li class="nav-list-item "><a href="/quickstart/actions-and-hooks.html"
class="nav-list-link">6️⃣ Using Actions and Hooks in lakeFS</a></li><li class="nav-list-item "><a href="/quickstart/work-with-data-locally.html"
class="nav-list-link">7️⃣ Work with lakeFS data locally</a></li><li class="nav-list-item "><a href="/quickstart/learning-more-lakefs.html"
class="nav-list-link">Learn more about lakeFS</a></li></ul></li><li
class="nav-list-item active"><a href="#" class="nav-list-expander"><svg viewBox="0 0 24 24">
<use xlink:href="#svg-arrow-right"></use>
</svg></a><a href="/howto/"
class="nav-list-link">How-To</a><ul class="nav-list "><li class="nav-list-item "><a href="#" class="nav-list-expander"><svg viewBox="0 0 24 24">
<use xlink:href="#svg-arrow-right"></use>
</svg></a><a href="/howto/deploy/"
class="nav-list-link">Install lakeFS</a><ul class="nav-list"><li class="nav-list-item ">
<a href="/howto/deploy/aws.html"
class="nav-list-link">AWS</a>
</li><li class="nav-list-item ">
<a href="/howto/deploy/azure.html"
class="nav-list-link">Azure</a>
</li><li class="nav-list-item ">
<a href="/howto/deploy/gcp.html"
class="nav-list-link">GCP</a>
</li><li class="nav-list-item ">
<a href="/howto/deploy/onprem.html"
class="nav-list-link">On-Premises</a>
</li><li class="nav-list-item ">
<a href="/howto/deploy/upgrade.html"
class="nav-list-link">Upgrade lakeFS</a>
</li></ul></li><li class="nav-list-item "><a href="#" class="nav-list-expander"><svg viewBox="0 0 24 24">
<use xlink:href="#svg-arrow-right"></use>
</svg></a><a href="/howto/hooks/"
class="nav-list-link">Actions and Hooks</a><ul class="nav-list"><li class="nav-list-item ">
<a href="/howto/hooks/airflow.html"
class="nav-list-link">Airflow Hooks</a>
</li><li class="nav-list-item ">
<a href="/howto/hooks/lua.html"
class="nav-list-link">Lua Hooks</a>
</li><li class="nav-list-item ">
<a href="/howto/hooks/webhooks.html"
class="nav-list-link">Webhooks</a>
</li></ul></li><li class="nav-list-item "><a href="/howto/backup-and-restore.html"
class="nav-list-link">Backup and Restore Repository</a></li><li class="nav-list-item "><a href="/howto/protect-branches.html"
class="nav-list-link">Branch Protection</a></li><li class="nav-list-item "><a href="/howto/copying.html"
class="nav-list-link">Copying data to/from lakeFS</a></li><li class="nav-list-item "><a href="/howto/catalog_exports.html"
class="nav-list-link">Data Catalogs Export</a></li><li class="nav-list-item active"><a href="/howto/export.html"
class="nav-list-link active">Export Data</a></li><li class="nav-list-item "><a href="#" class="nav-list-expander"><svg viewBox="0 0 24 24">
<use xlink:href="#svg-arrow-right"></use>
</svg></a><a href="/howto/garbage-collection/"
class="nav-list-link">Garbage Collection</a><ul class="nav-list"><li class="nav-list-item ">
<a href="/howto/garbage-collection/gc.html"
class="nav-list-link">Garbage Collection</a>
</li><li class="nav-list-item ">
<a href="/howto/garbage-collection/managed-gc.html"
class="nav-list-link">Managed Garbage Collection</a>
</li><li class="nav-list-item ">
<a href="/howto/garbage-collection/standalone-gc.html"
class="nav-list-link">Standalone Garbage Collection</a>
</li></ul></li><li class="nav-list-item "><a href="/howto/import.html"
class="nav-list-link">Import Data</a></li><li class="nav-list-item "><a href="/howto/migrate-away.html"
class="nav-list-link">Migrating away from lakeFS</a></li><li class="nav-list-item "><a href="/howto/mirroring.html"
class="nav-list-link">Mirroring</a></li><li class="nav-list-item "><a href="/howto/private-link.html"
class="nav-list-link">Private Link</a></li><li class="nav-list-item "><a href="/howto/pull-requests.html"
class="nav-list-link">Pull Requests</a></li><li class="nav-list-item "><a href="/howto/virtual-host-addressing.html"
class="nav-list-link">S3 Virtual-host addressing (advanced)</a></li><li class="nav-list-item "><a href="/howto/sizing-guide.html"
class="nav-list-link">Sizing Guide</a></li><li class="nav-list-item "><a href="/howto/scim.html"
class="nav-list-link">System for Cross-domain Identity Management (SCIM)</a></li><li class="nav-list-item "><a href="/howto/local-checkouts.html"
class="nav-list-link">Work with lakeFS data locally</a></li></ul></li><li
class="nav-list-item"><a href="#" class="nav-list-expander"><svg viewBox="0 0 24 24">
<use xlink:href="#svg-arrow-right"></use>
</svg></a><a href="/integrations/"
class="nav-list-link">Integrations</a><ul class="nav-list "><li class="nav-list-item "><a href="/integrations/aws_cli.html"
class="nav-list-link">AWS CLI</a></li><li class="nav-list-item "><a href="/integrations/airbyte.html"
class="nav-list-link">Airbyte</a></li><li class="nav-list-item "><a href="/integrations/athena.html"
class="nav-list-link">Amazon Athena</a></li><li class="nav-list-item "><a href="/integrations/sagemaker.html"
class="nav-list-link">Amazon SageMaker</a></li><li class="nav-list-item "><a href="/integrations/airflow.html"
class="nav-list-link">Apache Airflow</a></li><li class="nav-list-item "><a href="/integrations/hive.html"
class="nav-list-link">Apache Hive</a></li><li class="nav-list-item "><a href="/integrations/iceberg.html"
class="nav-list-link">Apache Iceberg</a></li><li class="nav-list-item "><a href="/integrations/kafka.html"
class="nav-list-link">Apache Kafka</a></li><li class="nav-list-item "><a href="/integrations/spark.html"
class="nav-list-link">Apache Spark</a></li><li class="nav-list-item "><a href="/integrations/cloudera.html"
class="nav-list-link">Cloudera</a></li><li class="nav-list-item "><a href="/integrations/databricks.html"
class="nav-list-link">Databricks</a></li><li class="nav-list-item "><a href="/integrations/delta.html"
class="nav-list-link">Delta Lake</a></li><li class="nav-list-item "><a href="/integrations/dremio.html"
class="nav-list-link">Dremio</a></li><li class="nav-list-item "><a href="/integrations/duckdb.html"
class="nav-list-link">DuckDB</a></li><li class="nav-list-item "><a href="/integrations/git.html"
class="nav-list-link">Git</a></li><li class="nav-list-item "><a href="/integrations/glue_hive_metastore.html"
class="nav-list-link">Glue / Hive metastore</a></li><li class="nav-list-item "><a href="/integrations/glue_metastore.html"
class="nav-list-link">Glue Data Catalog</a></li><li class="nav-list-item "><a href="/integrations/huggingface_datasets.html"
class="nav-list-link">HuggingFace Datasets</a></li><li class="nav-list-item "><a href="/integrations/kubeflow.html"
class="nav-list-link">Kubeflow</a></li><li class="nav-list-item "><a href="/integrations/presto_trino.html"
class="nav-list-link">Presto / Trino</a></li><li class="nav-list-item "><a href="/integrations/python.html"
class="nav-list-link">Python</a></li><li class="nav-list-item "><a href="/integrations/r.html"
class="nav-list-link">R</a></li><li class="nav-list-item "><a href="/integrations/red_hat_openshift_ai.html"
class="nav-list-link">Red Hat OpenShift AI</a></li><li class="nav-list-item "><a href="/integrations/unity-catalog.html"
class="nav-list-link">Unity Catalog</a></li><li class="nav-list-item "><a href="/integrations/vertex_ai.html"
class="nav-list-link">Vertex AI</a></li></ul></li><li
class="nav-list-item"><a href="#" class="nav-list-expander"><svg viewBox="0 0 24 24">
<use xlink:href="#svg-arrow-right"></use>
</svg></a><a href="/understand/"
class="nav-list-link">Understanding lakeFS</a><ul class="nav-list "><li class="nav-list-item "><a href="/understand/architecture.html"
class="nav-list-link">Architecture</a></li><li class="nav-list-item "><a href="/understand/model.html"
class="nav-list-link">Concepts and Model</a></li><li class="nav-list-item "><a href="#" class="nav-list-expander"><svg viewBox="0 0 24 24">
<use xlink:href="#svg-arrow-right"></use>
</svg></a><a href="/understand/data_lifecycle_management/"
class="nav-list-link">Data Lifecycle Management</a><ul class="nav-list"><li class="nav-list-item ">
<a href="/understand/data_lifecycle_management/ci.html"
class="nav-list-link">During Deployment</a>
</li><li class="nav-list-item ">
<a href="/understand/data_lifecycle_management/production.html"
class="nav-list-link">In Production</a>
</li><li class="nav-list-item ">
<a href="/understand/data_lifecycle_management/data-devenv.html"
class="nav-list-link">In Test</a>
</li></ul></li><li class="nav-list-item "><a href="/understand/data-structure.html"
class="nav-list-link">Data Structure</a></li><li class="nav-list-item "><a href="/understand/faq.html"
class="nav-list-link">FAQ</a></li><li class="nav-list-item "><a href="/understand/glossary.html"
class="nav-list-link">Glossary</a></li><li class="nav-list-item "><a href="#" class="nav-list-expander"><svg viewBox="0 0 24 24">
<use xlink:href="#svg-arrow-right"></use>
</svg></a><a href="/understand/how/"
class="nav-list-link">How lakeFS Works</a><ul class="nav-list"><li class="nav-list-item ">
<a href="/understand/how/kv.html"
class="nav-list-link">Internal database structure</a>
</li><li class="nav-list-item ">
<a href="/understand/how/merge.html"
class="nav-list-link">Merge</a>
</li><li class="nav-list-item ">
<a href="/understand/how/versioning-internals.html"
class="nav-list-link">Versioning Internals</a>
</li></ul></li><li class="nav-list-item "><a href="/understand/performance-best-practices.html"
class="nav-list-link">Performance Best Practices</a></li><li class="nav-list-item "><a href="#" class="nav-list-expander"><svg viewBox="0 0 24 24">
<use xlink:href="#svg-arrow-right"></use>
</svg></a><a href="/understand/use_cases/"
class="nav-list-link">Use Cases</a><ul class="nav-list"><li class="nav-list-item ">
<a href="/understand/use_cases/cicd_for_data.html"
class="nav-list-link">CI/CD for Data Lakes</a>
</li><li class="nav-list-item ">
<a href="/understand/use_cases/etl_testing.html"
class="nav-list-link">ETL Testing Environment</a>
</li><li class="nav-list-item ">
<a href="/understand/use_cases/reproducibility.html"
class="nav-list-link">Reproducibility</a>
</li><li class="nav-list-item ">
<a href="/understand/use_cases/rollback.html"
class="nav-list-link">Rollback</a>
</li></ul></li></ul></li><li
class="nav-list-item"><a href="#" class="nav-list-expander"><svg viewBox="0 0 24 24">
<use xlink:href="#svg-arrow-right"></use>
</svg></a><a href="/reference/"
class="nav-list-link">Reference</a><ul class="nav-list "><li class="nav-list-item "><a href="/reference/auditing.html"
class="nav-list-link">Auditing</a></li><li class="nav-list-item "><a href="/reference/monitor.html"
class="nav-list-link">Monitoring using Prometheus</a></li><li class="nav-list-item "><a href="/reference/s3.html"
class="nav-list-link">S3 Gateway API</a></li><li class="nav-list-item "><a href="/reference/spark-client.html"
class="nav-list-link">Spark Client</a></li><li class="nav-list-item "><a href="/reference/api.html"
class="nav-list-link">lakeFS API</a></li><li class="nav-list-item "><a href="/reference/configuration.html"
class="nav-list-link">lakeFS Server Configuration</a></li><li class="nav-list-item "><a href="/reference/cli.html"
class="nav-list-link">lakectl (lakeFS command-line tool)</a></li></ul></li><li
class="nav-list-item"><a href="#" class="nav-list-expander"><svg viewBox="0 0 24 24">
<use xlink:href="#svg-arrow-right"></use>
</svg></a><a href="/project/"
class="nav-list-link">The lakeFS Project</a><ul class="nav-list "><li class="nav-list-item "><a href="/project/contributing.html"
class="nav-list-link">Contributing to lakeFS</a></li><li class="nav-list-item "><a href="#" class="nav-list-expander"><svg viewBox="0 0 24 24">
<use xlink:href="#svg-arrow-right"></use>
</svg></a><a href="/project/docs/"
class="nav-list-link">Documentation</a><ul class="nav-list"><li class="nav-list-item ">
<a href="/project/docs/callouts.html"
class="nav-list-link">Callouts</a>
</li></ul></li><li class="nav-list-item "><a href="/project/code-migrate-1.0-sdk.html"
class="nav-list-link">Migrating to 1.0</a></li></ul></li><li
class="nav-list-item"><a href="/cloud/"
class="nav-list-link">lakeFS Cloud</a></li><li
class="nav-list-item"><a href="#" class="nav-list-expander"><svg viewBox="0 0 24 24">
<use xlink:href="#svg-arrow-right"></use>
</svg></a><a href="/enterprise/"
class="nav-list-link">lakeFS Enterprise</a><ul class="nav-list "><li class="nav-list-item "><a href="#" class="nav-list-expander"><svg viewBox="0 0 24 24">
<use xlink:href="#svg-arrow-right"></use>
</svg></a><a href="/enterprise/getstarted/"
class="nav-list-link">Get Started</a><ul class="nav-list"><li class="nav-list-item ">
<a href="/enterprise/getstarted/quickstart.html"
class="nav-list-link">Quickstart</a>
</li><li class="nav-list-item ">
<a href="/enterprise/getstarted/install.html"
class="nav-list-link">Install</a>
</li><li class="nav-list-item ">
<a href="/enterprise/getstarted/migrate-from-oss.html"
class="nav-list-link">Migrate from lakeFS OSS</a>
</li></ul></li><li class="nav-list-item "><a href="/enterprise/upgrade.html"
class="nav-list-link">Upgrade</a></li><li class="nav-list-item "><a href="/enterprise/troubleshooting.html"
class="nav-list-link">Troubleshooting lakeFS Enterprise</a></li><li class="nav-list-item "><a href="/enterprise/configuration.html"
class="nav-list-link">Configuration Reference</a></li><li class="nav-list-item "><a href="/enterprise/architecture.html"
class="nav-list-link">Architecture</a></li></ul></li><li
class="nav-list-item"><a href="#" class="nav-list-expander"><svg viewBox="0 0 24 24">
<use xlink:href="#svg-arrow-right"></use>
</svg></a><a href="/security/"
class="nav-list-link">Security</a><ul class="nav-list "><li class="nav-list-item "><a href="/security/access-control-lists.html"
class="nav-list-link">Access Control Lists (ACLs) -Deprecated-</a></li><li class="nav-list-item "><a href="/security/authentication.html"
class="nav-list-link">Authentication</a></li><li class="nav-list-item "><a href="/security/external-principals-aws.html"
class="nav-list-link">Login to lakeFS with AWS IAM Roles</a></li><li class="nav-list-item "><a href="/security/presigned-url.html"
class="nav-list-link">Presigned URLs</a></li><li class="nav-list-item "><a href="/security/remote-authenticator.html"
class="nav-list-link">Remote Authenticator</a></li><li class="nav-list-item "><a href="/security/rbac.html"
class="nav-list-link">Role-Based Access Control (RBAC)</a></li><li class="nav-list-item "><a href="/security/sts-login.html"
class="nav-list-link">Short-lived token (STS like) Authentication for lakeFS</a></li><li class="nav-list-item "><a href="/security/sso.html"
class="nav-list-link">Single Sign On (SSO)</a></li></ul></li></ul>
<div class="mobile-menu">
<nav aria-label="Auxiliary" class="aux-nav">
<ul class="aux-nav-list">
<li class="aux-nav-list-item">
<a href="https://docs.lakefs.io/" class="site-button" >
Docs
</a>
</li>
<li class="aux-nav-list-item">
<a href="https://lakefs.io/blog/" class="site-button" >
Blog
</a>
</li>
<li class="aux-nav-list-item">
<a href="https://lakefs.io/community/" class="site-button" >
Community
</a>
</li>
<li class="aux-nav-list-item">
<a href="https://github.com/treeverse/lakeFS" class="site-button" >
GitHub
</a>
</li>
<li class="aux-nav-list-item button">
<a href="https://lakefs.io/slack" class="site-button" >
Join us on Slack
</a>
</li>
</ul>
</nav>
</div>
</nav>
</div>
<div class="main" id="top">
<div class="feedback-container">
<div id="is-helpful-ty">
<div class="text-epsilon">Thank you for your feedback.</div>
<div class="mt-2 text-epsilon">
<a href="https://lakefs.io/slack" target="_blank">Join the community</a> to get more help.
</div>
</div>
<div class="feedback-buttons">
<span class="tooltip">
<button class="page-helpful-btn far fa-lg fa-thumbs-up" id="page-helpful-yes"></button>
<span class="tooltiptext">
This page is <b>helpful</b>
</span>
</span>
<span class="tooltip">
<button class="page-helpful-btn far fa-lg fa-thumbs-down" id="page-helpful-no"></button>
<span class="tooltiptext">
This page is <b>not helpful</b>
</span>
</span>
</div>
</div>
<div id="main-header" class="main-header">
<nav aria-label="Auxiliary" class="aux-nav">
<ul class="aux-nav-list">
<li class="aux-nav-list-item">
<a href="https://docs.lakefs.io/" class="site-button" >
Docs
</a>
</li>
<li class="aux-nav-list-item">
<a href="https://lakefs.io/blog/" class="site-button" >
Blog
</a>
</li>
<li class="aux-nav-list-item">
<a href="https://lakefs.io/community/" class="site-button" >
Community
</a>
</li>
<li class="aux-nav-list-item">
<a href="https://github.com/treeverse/lakeFS" class="site-button" >
GitHub
</a>
</li>
<li class="aux-nav-list-item button">
<a href="https://lakefs.io/slack" class="site-button" >
Join us on Slack
</a>
</li>
</ul>
</nav>
</div>
<div id="main-content-wrap" class="main-content-wrap">
<nav aria-label="Breadcrumb" class="breadcrumb-nav">
<ol class="breadcrumb-nav-list">
<li class="breadcrumb-nav-list-item"><a href="/howto/">How-To</a>
</li>
<li class="breadcrumb-nav-list-item"><span>Export Data</span></li>
</ol>
</nav>
<div id="main-content" class="main-content" role="main">
<h1 id="exporting-data">
<a href="#exporting-data" class="anchor-heading"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Exporting Data
</h1>
<p>The export operation copies all data from a given lakeFS commit to
a designated object store location.</p>
<p>For instance, the contents <code class="language-plaintext highlighter-rouge">lakefs://example/main</code> might be exported on
<code class="language-plaintext highlighter-rouge">s3://company-bucket/example/latest</code>. Clients entirely unaware of lakeFS could use that
base URL to access latest files on <code class="language-plaintext highlighter-rouge">main</code>. Clients aware of lakeFS can continue to use
the lakeFS S3 endpoint to access repository files on <code class="language-plaintext highlighter-rouge">s3://example/main</code>, as well as
other versions and uncommitted versions.</p>
<p>Possible use-cases:</p>
<ol>
<li>External consumers of data don’t have access to your lakeFS installation.</li>
<li>Some data pipelines in the organization are not fully migrated to lakeFS.</li>
<li>You want to experiment with lakeFS as a side-by-side installation first.</li>
<li>Create copies of your data lake in other regions (taking into account read pricing).</li>
</ol>
<div class="toc-block">
<h2 class="no_toc text-delta" id="table-of-contents">
<a href="#table-of-contents" class="anchor-heading"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Table of contents
</h2>
<ol id="markdown-toc">
<li><a href="#exporting-data-with-spark" id="markdown-toc-exporting-data-with-spark">Exporting Data With Spark</a></li>
<li><a href="#successfailure-indications" id="markdown-toc-successfailure-indications">Success/Failure Indications</a></li>
<li><a href="#export-rounds-spark-success-files" id="markdown-toc-export-rounds-spark-success-files">Export Rounds (Spark success files)</a></li>
<li><a href="#example" id="markdown-toc-example">Example</a></li>
<li><a href="#exporting-data-with-docker" id="markdown-toc-exporting-data-with-docker">Exporting Data with Docker</a></li>
</ol>
</div>
<h2 id="exporting-data-with-spark">
<a href="#exporting-data-with-spark" class="anchor-heading"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Exporting Data With Spark
</h2>
<h3 id="using-spark-submit">
<a href="#using-spark-submit" class="anchor-heading"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Using spark-submit
</h3>
<p>You can use the export main in three different modes:</p>
<ol>
<li>
<p>Export all the objects from branch <code class="language-plaintext highlighter-rouge">example-branch</code> on <code class="language-plaintext highlighter-rouge">example-repo</code> repository to S3 location <code class="language-plaintext highlighter-rouge">s3://example-bucket/prefix/</code>:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>.... example-repo s3://example-bucket/prefix/ <span class="nt">--branch</span><span class="o">=</span>example-branch
</code></pre></div> </div>
</li>
<li>
<p>Export all the objects from a commit <code class="language-plaintext highlighter-rouge">c805e49bafb841a0875f49cd555b397340bbd9b8</code> on <code class="language-plaintext highlighter-rouge">example-repo</code> repository to S3 location <code class="language-plaintext highlighter-rouge">s3://example-bucket/prefix/</code>:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>.... example-repo s3://example-bucket/prefix/ <span class="nt">--commit_id</span><span class="o">=</span>c805e49bafb841a0875f49cd555b397340bbd9b8
</code></pre></div> </div>
</li>
<li>
<p>Export only the diff between branch <code class="language-plaintext highlighter-rouge">example-branch</code> and commit <code class="language-plaintext highlighter-rouge">c805e49bafb841a0875f49cd555b397340bbd9b8</code>
on <code class="language-plaintext highlighter-rouge">example-repo</code> repository to S3 location <code class="language-plaintext highlighter-rouge">s3://example-bucket/prefix/</code>:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>.... example-repo s3://example-bucket/prefix/ <span class="nt">--branch</span><span class="o">=</span>example-branch <span class="nt">--prev_commit_id</span><span class="o">=</span>c805e49bafb841a0875f49cd555b397340bbd9b8
</code></pre></div> </div>
</li>
</ol>
<p>The complete <code class="language-plaintext highlighter-rouge">spark-submit</code> command would look as follows:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>spark-submit <span class="nt">--conf</span> spark.hadoop.lakefs.api.url<span class="o">=</span>https://<LAKEFS_ENDPOINT>/api/v1 <span class="se">\</span>
<span class="nt">--conf</span> spark.hadoop.lakefs.api.access_key<span class="o">=</span><LAKEFS_ACCESS_KEY_ID> <span class="se">\</span>
<span class="nt">--conf</span> spark.hadoop.lakefs.api.secret_key<span class="o">=</span><LAKEFS_SECRET_ACCESS_KEY> <span class="se">\</span>
<span class="nt">--packages</span> io.lakefs:lakefs-spark-client_2.12:0.14.1 <span class="se">\</span>
<span class="nt">--class</span> io.treeverse.clients.Main export-app example-repo s3://example-bucket/prefix <span class="se">\</span>
<span class="nt">--branch</span><span class="o">=</span>example-branch
</code></pre></div></div>
<p class="note">The command assumes that the Spark cluster has permissions to write to <code class="language-plaintext highlighter-rouge">s3://example-bucket/prefix</code>.
Otherwise, add <code class="language-plaintext highlighter-rouge">spark.hadoop.fs.s3a.access.key</code> and <code class="language-plaintext highlighter-rouge">spark.hadoop.fs.s3a.secret.key</code> with the proper credentials.</p>
<h4 id="networking">
<a href="#networking" class="anchor-heading"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Networking
</h4>
<p>Spark export communicates with the lakeFS server. Very large repositories
may require increasing a read timeout. If you run into timeout errors
during communication from the Spark job to lakeFS consider increasing these
timeouts:</p>
<ul>
<li>Add <code class="language-plaintext highlighter-rouge">-c spark.hadoop.lakefs.api.read.timeout_seconds=TIMEOUT_IN_SECONDS</code>
(default 10) to allow lakeFS more time to respond to requests.</li>
<li>Add <code class="language-plaintext highlighter-rouge">-c
spark.hadoop.lakefs.api.connection.timeout_seconds=TIMEOUT_IN_SECONDS</code>
(default 10) to wait longer for lakeFS to accept connections.</li>
</ul>
<h3 id="using-custom-code-notebookspark">
<a href="#using-custom-code-notebookspark" class="anchor-heading"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Using custom code (Notebook/Spark)
</h3>
<p>Set up lakeFS Spark metadata client with the endpoint and credentials as instructed in the previous <a href="/reference/spark-client.html">page</a>.</p>
<p>The client exposes the <code class="language-plaintext highlighter-rouge">Exporter</code> object with three export options:</p>
<ol><li>
Export *all* the objects at the HEAD of a given branch. Does not include
files that were added to that branch but were not committed.
<div class="tabs">
<ul>
<li><a href="#export-head-scala">Scala</a></li>
</ul>
<div id="export-head-scala">
<div class="language-scala highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nf">exportAllFromBranch</span><span class="o">(</span><span class="n">branch</span><span class="k">:</span> <span class="kt">String</span><span class="o">)</span>
</code></pre></div> </div>
</div>
</div>
</li>
<li>Export ALL objects from a commit:
<div class="tabs">
<ul>
<li><a href="#export-commit-scala">Scala</a></li>
</ul>
<div id="export-commit-scala">
<div class="language-scala highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nf">exportAllFromCommit</span><span class="o">(</span><span class="n">commitID</span><span class="k">:</span> <span class="kt">String</span><span class="o">)</span>
</code></pre></div> </div>
</div>
</div>
</li>
<li>Export just the diff between a commit and the HEAD of a branch.
This is an ideal option for continuous exports of a branch since it will change only the files
that have been changed since the previous commit.
<div class="tabs">
<ul>
<li><a href="#export-diffs-scala">Scala</a></li>
</ul>
<div id="export-diffs-scala">
<div class="language-scala highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nf">exportFrom</span><span class="o">(</span><span class="n">branch</span><span class="k">:</span> <span class="kt">String</span><span class="o">,</span> <span class="n">prevCommitID</span><span class="k">:</span> <span class="kt">String</span><span class="o">)</span>
</code></pre></div> </div>
</div>
</div>
</li>
</ol>
<h2 id="successfailure-indications">
<a href="#successfailure-indications" class="anchor-heading"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Success/Failure Indications
</h2>
<p>When the Spark export operation ends, an additional status file will be added to the root
object storage destination.
If all files were exported successfully, the file path will be of the form: <code class="language-plaintext highlighter-rouge">EXPORT_<commitID>_<ISO-8601-time-UTC>_SUCCESS</code>.
For failures: the form will be<code class="language-plaintext highlighter-rouge">EXPORT_<commitID>_<ISO-8601-time-UTC>_FAILURE</code>, and the file will include a log of the failed files operations.</p>
<h2 id="export-rounds-spark-success-files">
<a href="#export-rounds-spark-success-files" class="anchor-heading"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Export Rounds (Spark success files)
</h2>
<p>Some files should be exported before others, e.g., a Spark <code class="language-plaintext highlighter-rouge">_SUCCESS</code> file exported before other files under
the same prefix might send the wrong indication.</p>
<p>The export operation may contain several <em>rounds</em> within the same export.
A failing round will stop the export of all the files of the next rounds.</p>
<p>By default, lakeFS will use the <code class="language-plaintext highlighter-rouge">SparkFilter</code> and have 2 rounds for each export.
The first round will export any non-Spark <code class="language-plaintext highlighter-rouge">_SUCCESS</code> files. Second round will export all Spark’s <code class="language-plaintext highlighter-rouge">_SUCCESS</code> files.
You may override the default behavior by passing a custom <code class="language-plaintext highlighter-rouge">filter</code> to the Exporter.</p>
<h2 id="example">
<a href="#example" class="anchor-heading"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Example
</h2>
<ol><li>First configure the `Exporter` instance:
<div class="tabs">
<ul>
<li><a href="#export-custom-setup-scala">Scala</a></li>
</ul>
<div id="export-custom-setup-scala">
<div class="language-scala highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">import</span> <span class="nn">io.treeverse.clients.</span><span class="o">{</span><span class="nc">ApiClient</span><span class="o">,</span> <span class="nc">Exporter</span><span class="o">}</span>
<span class="k">import</span> <span class="nn">org.apache.spark.sql.SparkSession</span>
<span class="k">val</span> <span class="nv">endpoint</span> <span class="k">=</span> <span class="s">"http://<LAKEFS_ENDPOINT>/api/v1"</span>
<span class="k">val</span> <span class="nv">accessKey</span> <span class="k">=</span> <span class="s">"<LAKEFS_ACCESS_KEY_ID>"</span>
<span class="k">val</span> <span class="nv">secretKey</span> <span class="k">=</span> <span class="s">"<LAKEFS_SECRET_ACCESS_KEY>"</span>
<span class="k">val</span> <span class="nv">repo</span> <span class="k">=</span> <span class="s">"example-repo"</span>
<span class="k">val</span> <span class="nv">spark</span> <span class="k">=</span> <span class="nv">SparkSession</span><span class="o">.</span><span class="py">builder</span><span class="o">().</span><span class="py">appName</span><span class="o">(</span><span class="s">"I can export"</span><span class="o">).</span><span class="py">master</span><span class="o">(</span><span class="s">"local"</span><span class="o">).</span><span class="py">getOrCreate</span><span class="o">()</span>
<span class="k">val</span> <span class="nv">sc</span> <span class="k">=</span> <span class="nv">spark</span><span class="o">.</span><span class="py">sparkContext</span>
<span class="nv">sc</span><span class="o">.</span><span class="py">hadoopConfiguration</span><span class="o">.</span><span class="py">set</span><span class="o">(</span><span class="s">"lakefs.api.url"</span><span class="o">,</span> <span class="n">endpoint</span><span class="o">)</span>
<span class="nv">sc</span><span class="o">.</span><span class="py">hadoopConfiguration</span><span class="o">.</span><span class="py">set</span><span class="o">(</span><span class="s">"lakefs.api.access_key"</span><span class="o">,</span> <span class="n">accessKey</span><span class="o">)</span>
<span class="nv">sc</span><span class="o">.</span><span class="py">hadoopConfiguration</span><span class="o">.</span><span class="py">set</span><span class="o">(</span><span class="s">"lakefs.api.secret_key"</span><span class="o">,</span> <span class="n">secretKey</span><span class="o">)</span>
<span class="c1">// Add any required spark context configuration for s3</span>
<span class="k">val</span> <span class="nv">rootLocation</span> <span class="k">=</span> <span class="s">"s3://company-bucket/example/latest"</span>
<span class="k">val</span> <span class="nv">apiClient</span> <span class="k">=</span> <span class="k">new</span> <span class="nc">ApiClient</span><span class="o">(</span><span class="n">endpoint</span><span class="o">,</span> <span class="n">accessKey</span><span class="o">,</span> <span class="n">secretKey</span><span class="o">)</span>
<span class="k">val</span> <span class="nv">exporter</span> <span class="k">=</span> <span class="k">new</span> <span class="nc">Exporter</span><span class="o">(</span><span class="n">spark</span><span class="o">,</span> <span class="n">apiClient</span><span class="o">,</span> <span class="n">repo</span><span class="o">,</span> <span class="n">rootLocation</span><span class="o">)</span>
</code></pre></div> </div>
</div>
</div></li>
<li>Now you can export all objects from `main` branch to `s3://company-bucket/example/latest`:
<div class="tabs">
<ul>
<li><a href="#export-custom-branch-scala">Scala</a></li>
</ul>
<div id="export-custom-branch-scala">
<div class="language-scala highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">val</span> <span class="nv">branch</span> <span class="k">=</span> <span class="s">"main"</span>
<span class="nv">exporter</span><span class="o">.</span><span class="py">exportAllFromBranch</span><span class="o">(</span><span class="n">branch</span><span class="o">)</span>
</code></pre></div> </div>
</div>
</div></li>
<li>Assuming a previous successful export on commit `f3c450d8cd0e84ac67e7bc1c5dcde9bef82d8ba7`,
you can alternatively export just the difference between `main` branch and the commit:
<div class="tabs">
<ul>
<li><a href="#export-custom-diffs-scala">Scala</a></li>
</ul>
<div id="export-custom-diffs-scala">
<div class="language-scala highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">val</span> <span class="nv">branch</span> <span class="k">=</span> <span class="s">"main"</span>
<span class="k">val</span> <span class="nv">commit</span> <span class="k">=</span> <span class="s">"f3c450d8cd0e84ac67e7bc1c5dcde9bef82d8ba7"</span>
<span class="nv">exporter</span><span class="o">.</span><span class="py">exportFrom</span><span class="o">(</span><span class="n">branch</span><span class="o">,</span> <span class="n">commit</span><span class="o">)</span>
</code></pre></div> </div>
</div>
</div></li></ol>
<h2 id="exporting-data-with-docker">
<a href="#exporting-data-with-docker" class="anchor-heading"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Exporting Data with Docker
</h2>
<p>This option is recommended if you don’t have Spark at your tool-set.
It doesn’t support distribution across machines, therefore may have a lower performance.
Using this method, you can export data from lakeFS to S3 using the export options (in a similar way to the Spark export):</p>
<ol>
<li>
<p>Export all objects from a branch <code class="language-plaintext highlighter-rouge">example-branch</code> on <code class="language-plaintext highlighter-rouge">example-repo</code> repository to S3 location <code class="language-plaintext highlighter-rouge">s3://destination-bucket/prefix/</code>:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>.... example-repo s3://destination-bucket/prefix/ <span class="nt">--branch</span><span class="o">=</span><span class="s2">"example-branch"</span>
</code></pre></div> </div>
</li>
<li>
<p>Export all objects from a commit <code class="language-plaintext highlighter-rouge">c805e49bafb841a0875f49cd555b397340bbd9b8</code> on <code class="language-plaintext highlighter-rouge">example-repo</code> repository to S3 location <code class="language-plaintext highlighter-rouge">s3://destination-bucket/prefix/</code>:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>.... example-repo s3://destination-bucket/prefix/ <span class="nt">--commit_id</span><span class="o">=</span>c805e49bafb841a0875f49cd555b397340bbd9b8
</code></pre></div> </div>
</li>
<li>
<p>Export only the diff between branch <code class="language-plaintext highlighter-rouge">example-branch</code> and commit <code class="language-plaintext highlighter-rouge">c805e49bafb841a0875f49cd555b397340bbd9b8</code>
on <code class="language-plaintext highlighter-rouge">example-repo</code> repository to S3 location <code class="language-plaintext highlighter-rouge">s3://destination-bucket/prefix/</code>:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>.... example-repo s3://destination-bucket/prefix/ <span class="nt">--branch</span><span class="o">=</span><span class="s2">"example-branch"</span> <span class="nt">--prev_commit_id</span><span class="o">=</span>c805e49bafb841a0875f49cd555b397340bbd9b8
</code></pre></div> </div>
</li>
</ol>
<p>You will need to add the relevant environment variables.
The complete <code class="language-plaintext highlighter-rouge">docker run</code> command would look like:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker run <span class="se">\</span>
<span class="nt">-e</span> <span class="nv">LAKEFS_ACCESS_KEY_ID</span><span class="o">=</span>XXX <span class="nt">-e</span> <span class="nv">LAKEFS_SECRET_ACCESS_KEY</span><span class="o">=</span>YYY <span class="se">\</span>
<span class="nt">-e</span> <span class="nv">LAKEFS_ENDPOINT</span><span class="o">=</span>https://<LAKEFS_ENDPOINT>/ <span class="se">\</span>
<span class="nt">-e</span> <span class="nv">AWS_ACCESS_KEY_ID</span><span class="o">=</span>XXX <span class="nt">-e</span> <span class="nv">AWS_SECRET_ACCESS_KEY</span><span class="o">=</span>YYY <span class="se">\</span>
treeverse/lakefs-rclone-export:latest <span class="se">\</span>
example-repo <span class="se">\</span>
s3://destination-bucket/prefix/ <span class="se">\</span>
<span class="nt">--branch</span><span class="o">=</span><span class="s2">"example-branch"</span>
</code></pre></div></div>
<p class="note"><strong>Note:</strong> This feature uses <a href="https://rclone.org/" target="_blank">rclone</a>,
and specifically <a href="https://rclone.org/commands/rclone_sync/" target="_blank">rclone sync</a>. This can change the destination path, therefore the s3 destination location must be designated to lakeFS export.</p>
</div>
</div>
<div class="search-overlay"></div>
</div>
</div>
<footer>
<div class="footer-sidebar"></div>
<div class="footer-main">
<div class="row">
<div class="left">
<ul class="footer-links">
<li class="aux-nav-list-item">
<a href="https://docs.lakefs.io/" class="site-button" >
Docs
</a>
</li>
<li class="aux-nav-list-item">
<a href="https://lakefs.io/blog/" class="site-button" >
Blog
</a>
</li>
<li class="aux-nav-list-item">
<a href="https://github.com/treeverse/lakeFS" class="site-button" >
GitHub
</a>
</li>
<li class="aux-nav-list-item">
<a href="https://lakefs.io/community/" class="site-button" >
Community
</a>
</li>
<li class="aux-nav-list-item">
<a href="https://lakefs.io/cloud-registration/" class="site-button" >
lakeFS Cloud
</a>
</li>
<li class="aux-nav-list-item">
<a href="https://lakefs.io/contact-us/" class="site-button" >
Contact
</a>
</li>
</ul>
</div>
<div class="right">
<ul class="footer-social">
<li class="aux-nav-list-item">
<a href="https://lakefs.io/youtube" class="site-button" >
<img src="/assets/icons/youtube.svg" class="no-hover" />
<img src="/assets/icons/youtube-hover.svg" class="hover" />
</a>
</li>
<li class="aux-nav-list-item">
<a href="https://www.linkedin.com/company/treeverse" class="site-button" >
<img src="/assets/icons/linkedin.svg" class="no-hover" />
<img src="/assets/icons/linkedin-hover.svg" class="hover" />
</a>
</li>
<li class="aux-nav-list-item">
<a href="https://github.com/treeverse/lakeFS" class="site-button" >
<img src="/assets/icons/github.svg" class="no-hover" />
<img src="/assets/icons/github-hover.svg" class="hover" />
</a>
</li>
<li class="aux-nav-list-item">
<a href="https://twitter.com/lakeFS" class="site-button" >
<img src="/assets/icons/twitter.svg" class="no-hover" />
<img src="/assets/icons/twitter-hover.svg" class="hover" />
</a>
</li>
<li class="aux-nav-list-item">
<a href="https://lakefs.io/slack" class="site-button" >
<img src="/assets/icons/slack.svg" class="no-hover" />
<img src="/assets/icons/slack-hover.svg" class="hover" />
</a>
</li>
</ul>
</div>
</div>
<div class="row top-border">
<div class="left">
<a href="https://lakefs.io" class="lh-tight" style="margin-bottom: 0px;">
<div class="site-logo"></div>
</a>
</div>
<div class="right">
<ul class="bottom-footer-links">
<li class="aux-nav-list-item">
<a href="https://lakefs.io/terms-of-use/" class="site-button" >
Terms of use
</a>
</li>
<li class="aux-nav-list-item">
<a href="https://lakefs.io/privacy-policy/" class="site-button" >
Privacy Policy
</a>
</li>