This needs to take NextSequenceValueParseNode, not TableName as the map key. You can reference the same sequence multiple times in a SQL statement and you need to generate unique sequence numbers for all of them. For example:

    UPSERT INTO my_table(col1,col2) VALUES (NEXT VALUE FOR foo.bar, NEXT VALUE FOR foo.bar);

This would generate different, unique values for col1 and col2.