Skip to content

Conversation

@okennedy
Copy link
Member

Small edits with far-reaching effects.

The big edits are:

  1. New Type matchers
  2. TypeRegistry is now a class rather than a global
  3. There's now a distinction between BaseType (which most of the system knows how to handle) and Type (which also includes TUser, which needs TypeRegistry to handle).

Also cut out the OperatorTransform global database instance hack.

TypeRegistry
-------------

As part of adding new types, the TypeRegistry is now a class rather than a
static object.  This shows up in the Database class as db.types.  A generic
instance DefaultTypeRegistry uses hardcoded settings.  Eventually, we'll be
able to have a type registry that talks to the metadata repo.

Type -> TUser + BaseType
-------------------------

The majority of the code in this codebase is not aware of / set up to work with
Mimir's user-defined types (TUser).  That's something that's going to need to
change over time, but due to the above fix, it's clear that we need to make
the distinction more crisp.  Now, there's a new (sealed abstract) subclass of
Type called BaseType that is now the parent of all types except TUser.

- The Type object is now the BaseType object and has nothing to do with TUser
- TypeRegistry has been moved (see above)
- Code without access to an instance of Database has been rewritten to use BaseType
- Code with access to an instance of Database is uses the new TypeRegistry
- To get the BaseType of a Type, use db.types.rootType

OperatorTransforms -> Class
----------------------------

OperatorTransforms (both GProM and Spark) used a global Database instance.
Database is enough of a hack...  These have been rewritten to be classes
with canonical instances accessible as db.gpromTranslator / db.sparkTranslator.
Spark's OperatorTransforms retains several general methods in the global
object.
…idators

Mostly conflicts caused by the Type/BaseType change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants