为了丰富我的流数据,我将其与静态数据集连接起来。
实际上,我使用相同的数据集将输入数据集加入两次,以添加有关卖方和买方的信息。
输入:
<div id= contacts-container>
<header><h1> {{ title }} </h1></header>
<div id= "favoritesContainer">
<p>Favorite Contacts</p>
</div>
<ul>
<li *ngFor="let contact of contacts">
<div *ngIf= "!contact.isFavorite">
<img src={{contact.smallImageURL}} />
<h3><img src="../assets/Favorite Star (True)/Favorite — True.png">{{ contact.name }} </h3>
<br>
<p>{{ contact.companyName }}</p>
<hr>
</div>
</li>
</ul>
</div>
静态数据集:
+-----------+------+-----+------+
|transaction|seller|buyer|amount|
+-----------+------+-----+------+
| 1 | A | D | 100 |
| 2 | B | A | 10 |
| 3 | C | A | 20 |
+-----------+------+-----+------+
代码:
+------+-------+
|person|address|
+------+-------+
| A | @A |
| B | @B |
| C | @C |
| D | @D |
+------+-------+
输出:
iputDF.join(staticDS, iputDF("seller") <=> staticDS("person"))
.join(staticDS, iputDF("buyer") <=> staticDS("person"))
有没有最佳解决方案呢?