Invalid value for implementation data types - embedded

How to configure the Invalid Value for implementation data types (Especially for arrays, based on the size of the array we have to create that many array value specifications)??

For a single ImplementationDataType of category ARRAY, you just create one ArrayValueSpecification that contains as many NumericalValueSpecifications as required.

Related

jsonschema for a map stored as an array [key1, val1, key2, val2.....]

Is it possible to create a json schema for an array with undefined length (besides it always being an even number of elements) that captures a map stored as an array?
i.e. as described in title [key1, val1, key2, val2.....]
it seems that the only option for an array of an undetermined length is to have a single item "type" (though that type could conceptually be a oneOf type). However, that wouldn't enforce ordering of key/val schema restrictions. While it would validate valid uses, it would also validate invalid uses.
if I knew how long the array would be, I could just enforce it by specifying the types for all keys and values in their respective positions, but that's not the case here.
Yes, it would be nice if the api worked off a map/object instead of an array in this location, but this is an old api that I'm trying to create a json schema for, so it probably can't be changed.

DynamoDB table to Hive when some column have couple of different data types?

Hi I am trying to create external table from Dynamo in Hive and save it on s3 as parquet files. I encountered a problem with one column value that have items with different data types (sometimes string, sometimes number and sometimes array of strings/numbers). Because of that I cannot know what data type that column should be - if I set it to string items with number or array will have Null value for that attribute.
Does anyone know how can I create table that converts all these types to string? Will I have to write custom SerDe?
I suppose that you are using this Storage Handler org.apache.hadoop.hive.dynamodb.DynamoDBStorageHandler
if so, then take a look this documentation https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/EMRforDynamoDB.ExternalTableForDDB.html
In particular this section:
Note: The following DynamoDB data types are not supported by the DynamoDBStorageHandler class, so they cannot be used with dynamodb.column.mapping
Map
List
Boolean
Null
Then if you have a DynamoDB column with any of above datatypes you hive column value always will be NULL.

Keen IO mixed property values (integers as strings)

Since Keen is not strongly typed, I've noticed it is possible to send data of different types into the same property. For instance, some events may have a property whose value is a String (sent surrounded by quotes), and some whose value is an integer (sent without quotes). In the case of mathematical operations, what is the expected behavior?
Our comparator will only compute mathematical operations on numbers. If you have a property whose values are mixed, the operation will only apply to the numbers, strings will be ignored. You can see the values in your property by running a select_unique query on that property as the target_property, then (if you're using the Explorer) selecting JSON from the drop-down in the top-right. Any values you see there that are surrounded by quotes will be ignored by a mathematical query type (minimum, maximum, median, average, percentile, and sum).
If you are just starting out, and you know you want to be able to do mathematical operations on this property, we recommend making sure that you always send integers as numbers (without quotes). If you really want to keep your dataset clean, you can even start a new collection once you've made sure you are no longer sending any strings.
Yes, you're correct, Keen can accept data of different types as the value for your properties. An example of Keen's lenient data type is that a property such as VisitorID can contain both numbers (ie 14558) or strings (ie "14558").
This is article from the Keen site is useful for seeing where you can check data types: https://keen.io/docs/data-collection/data-modeling-guide-200/#check-for-data-type-mismatch

How do you handle the values of the symbols in the symbol table?

In reference to chapter 6 of your book "Language Implementation Patterns"; what is the best practice/pattern for storing and retrieving values for each symbol.
Every symbol has a name, a type and a scope. However; where do you store the actual value?
I.e. symbol "n" of type "integer" has a value of 42.
What the symbol contains and how it contains that information is entirely your choice. In an untyped language the symbol could be just an object with term name and value attributes. For typing, add type and kind attributes.
Or the symbol object could contain just name and reference attributes, where the ref points into a separate table that contains additional attributes, including a reference that might point into a heap, immutables pool, or stack that actually stores the literal value.
This answer provides an example of a scoped, name and value symbol table.

Optional (numeric) attributes without default value in Core Data - why are they discouraged?

The Apple Core Data Programming Guide says:
You can specify that an attribute is optional—that is, it is not
required to have a value. In general, however, you are discouraged
from doing so—especially for numeric values (typically you can get
better results using a mandatory attribute with a default value—in the
model—of 0). The reason for this is that SQL has special comparison
behavior for NULL that is unlike Objective-C's nil. NULL in a database
is not the same as 0, and searches for 0 will not match columns with
NULL.
But i need my attributes to have no value at all (nil) when they are created. I cannot have 0 (Zero) or any other default value, because that would result in wrong domain data.
So what problems will arise if i define my numeric Core Data attributes as optional with no default value? And can i live with them?
Say you have a numeric (int for example) optional column in your DB. If you leave it blank, there will be a NULL in the DB. Now say you subclass NSManagedObject and use primitive types in your object. That column will be mapped to an int property. When the object is loaded, what will it put in there? It can't be nil and it can't be zero.
It's discouraged, not forbidden. Just don't use primitive types in your model objects, which from what you are saying, you wouldn't use in this case anyway if you need to be able to support nils.