2个星火应用程序会导致任何一致性
我有2个spark应用程序。一种是通过Hive Metastore写入数据,如下所示:
<template>
<div id="app">
<input type="text" v-model="search">
<select name="sort" v-model="sort">
<option v-for="option in options" :value="option.value" :label="option.label"></option>
</select>
<table>...</table>
</div>
</template>
<script>
import goodsList from './api/data';
export default {
name: 'app',
data() {
return {
search: '',
sort: '',
options: [
{ label: 'Default', value: 'none' },
{ label: 'Brand', value: 'brand' },
{label: 'Price', value: 'price'}
],
goods: goodsList,
}
},
computed: {
filteredList() {
let filteredGoods = this.goods.filter( item => {
return item.name.toLowerCase().includes(this.search.toLowerCase());
});
switch (this.sort) {
case 'brand':
filteredGoods.sort((a, b) => a.brand.localeCompare(b.brand));
break;
case 'price':
filteredGoods.sort((a, b) => parseInt(a.price - b.price));
break;
}
return filteredGoods;
}
},
}
</script>
其他人正在从同一张表中读取数据,如下所示:
df.write
.option("path", "adl:///test-data/hive_tables")
.mode(SaveMode.Append)
.format("json")
.partitionBy("col1")
.saveAsTable("sample")
如果两个作业并行运行,那么第二个应用程序读取的数据是否有可能不一致?如果是这样,我该如何避免