I have multiple tables with a combination of A, B, C entities as part of partition keys.
Table 1: columns A, B, C, D, E, F, G, H
Primary key ((A, B, C, Date), D, E)
rows-> A1, B1, C1, 07-09-2020, D1, E1 ....
A1, B1, C1, 07-10-2020, D1, E1 ....
A1, B2, C1, 07-10-2020, D2, E1 ....
.....
Table 2: columns A, B, C, D, E, F, G, H
Primary key ((B, C, Created_timestamp, A), D, E)
rows-> B1, C1, 07-09-2020 05:02:01Z, A1, D1, E1 ....
B1, C1, 07-10-2020 02:02:01Z, A1, D1, E1 ....
B2, C1, 07-10-2020 06:02:01Z, A1, D2, E1 ....
.....
Table 3: columns A, B, C, D, E, F, G, H
Primary Key ((B, A), C)
rows -> B1, A1, C1 ...
B2, A1, C2 ...
....
Table 4: columns A, B, C, D, E, F, G, H
Primary Key ((F, C), A)
rows -> F1, C1, A1 ...
F1, C2, A1 ...
....
Now let's say if A1 is to be deleted in the system then all rows corresponding to A1 in all the tables should be marked as deleted (no TTL is to be used).
P.S - By pointing to above tables all I wanted to show was the position of A varies in the partition key and as well as in the primary key as a whole.
When deleting record for Table 1, at least the values of column A,B,C are known. So I think you need another 2 look up tables to achieve it
Lookup Table for Table 2
Columns - A, B, C,D, E, Created_timestamp
Primary key - ((A, B, C), Created_timestamp, D, E)
Lookup Table for Table 4
Columns - F, C, A
Primary key - ((A, C), F)
Once you have fetched the primary keys for table 2 and table 4, you have the primary keys for them to delete it,
Related
Cell a1 has letters a, b, c, d, e. I want to output in cell a2 yes or no based on what is identified in cell a1.
I can do: output yes if a, and b, and C are found in a1 by:
=IF(AND(ISNUMBER(SEARCH("*a*",A1)),ISNUMBER(SEARCH("*b*",A1)),ISNUMBER(SEARCH("*c*",A1))),"yes","no")
But I cannot do: output yes if a, and (b or C), and D are found in a1...
What formulae modification should I make?
Consider:
=IF(AND(ISNUMBER(SEARCH("a",A1)),ISNUMBER(SEARCH("b",A1)),OR(ISNUMBER(SEARCH("c",A1)),ISNUMBER(SEARCH("d",A1)))),"yes","no")
You can use and() and or() too.
=IF(AND(ISNUMBER(SEARCH("a", A1)),
OR(ISNUMBER(SEARCH("b", A1)), ISNUMBER(SEARCH("c", A1))),
ISNUMBER(SEARCH("d", A1))), "yes", "no")
I'm pulling my hair out trying to solve what I feel is an extremely simple problem, but I'm not sure if there's some spark voodoo occurring as well.
I have two tables, which are both very small. Table A has about 90K rows and Table B has about 2K rows.
Table A
A B C D
===========
a1 b1 c1 d1
a1 b1 c2 d2
a1 b1 c3 d3
a2 b2 c1 d1
a2 b2 c2 d2
.
.
.
Table B
A B E F
===========
a1 b1 e1 f1
a2 b2 e2 f2
I want a table that looks like
Result Table
A B C D E F
=================
a1 b1 c1 d1 e1 f1
a1 b1 c2 d2 e1 f1
a2 b2 c1 d1 e2 f2
.
.
.
I was a little loose, but the idea is I want to join the table with fewer rows on the table with more rows and it's okay to have multiple associated values in the final table.
This should be really simple:
table_a.join(table_b, table_a.a == table_b.a, table_a.b == table_b.b).select(..stuff..)
HOWEVER, for almost all of the resulting values in the Result Table (which should have about 90K rows since Table A has about 90K rows), I get null values in columns E and F.
When I save the result of just Table B, I see all the columns and values.
When I save the result of just Table A, I see all the columns and values.
(i.e I could do a paper and pencil join)
The weird thing is that even though ~89K rows have null values in columns E and F in the Result Table, there are a few values that do randomly join.
Does anyone know what's going on or how I can diagnose this?
Have you tried <=> instead of == in your join?
I've got four columns of data that I'm interested in. A, with names, B with values, C with names, and D with values. I'd like to generate three more columns E, F, G. E will have the overlap in names between A and C, F will have the associated value in B and G will have the associated value from D. Any luck?
This may be too basic, but if you put these three formulas in you should get the desired result, assuming you dont have duplicates in A or C. These IF statements will return a blank when there is no result (no match in A and C) and you can double click to copy them down the whole sheet.
Column E =IF(A2=C2,A2,"")
Column F =IF(E2=A2,B2,"")
Column G =IF(E2=C2,D2,"")
Could someone help me out with this UML diagram?
Given this UML diagram, suppose that at runtime, we have created objects a1 and a2 from class A, b1 and b2 from class B, c1 and c2 from class C, d1 and d2 from class D, e1 and e2 from class E. Which one of these situations could happen at runtime?
a. e1 contains d1, and d1 contains e2, and e2 contains b2
b. a1 contains c1, and c1 contains d1
c. b1 contains d1, and d1 contains e2
d. c1 contains a1, and a1 contains b1
I haven't been able to solve this, as I tend to think that both b) and d) are possible.
a) is the correct answer.
b) is false, as a1 can't contain anything
c) is false, because b1 can't contain anything
d) is false, a1 can't contain anything
Description: C and it's children (D,E) can contain any class of this hierarchy as it can contain children of A
I have two sheets with three columns each. I need a third sheet in which I have all rows that are in sheet two but not in sheet one. Is there a formula to do this?
Here are the formulas in separate columns (for clarity). You may combine them, of course.
I used columns in a worksheet instead of separate worksheets, but the concept carries over.
Column A Column B
a d
b e
c f
d g
e h
These are A1:B6. Your data under examination are A2:A6 and B2:B6.
If I understand your question, you are looking for "f, g, h" Those are the rows in column B that are not in column A.
In C2, I place the formula =MATCH(B2,$A$2:$A$6,0). The $A$2:$A$6 means use the absolute column and row and does not change when I copy the formula down to C6. The 0 means I want an exact match.
This will put a 4 and 5 in cells C2 and C3, but #N/A in C4, C5, and C6, because there is no match.
In D2, I place the formula =IF(ISERROR(C2),B2,""). Also copy this formula to column D6. If there is a number in C2, then the a match was found, and it prints a blank. If there is a #N/A in C2, then it prints the letter in column B.
In my small example, it prints f, g, and h.
Column C Column D
4
5
#N/A f
#N/A g
#N/A h