Code Monkey home page Code Monkey logo

Comments (7)

pbailis avatar pbailis commented on August 16, 2024

See Spark, which uses untyped Key-Value pairs: https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/SparkConf.scala#L30

from macrobase.

viveksjain avatar viveksjain commented on August 16, 2024

IMO KV pairs seem like they would scale much better to more config flags, which is inevitable as the codebase progresses. Not sure how exactly the untyped stuff would work in Java though. And we would need to keep good, up-to-date documentation on all the config options in one file.

from macrobase.

pbailis avatar pbailis commented on August 16, 2024

Spark has a good example of typing:

Double getDouble(String param), String getString(String param)

It gets a little annoying to have a bunch of these, like List<String> getStringList(String param)

You can imagine also having:

Double getDoubleOrElse(String param, Double default)

And:

Boolean mandatoryParams(List<String> params).

from macrobase.

pbailis avatar pbailis commented on August 16, 2024

I started writing a new config class. Two things:

  1. Do we want to rename all MacroBase files to Macrobase?
  2. Spark's configuration API forces you to specify a default for each setting. The upside of this is it makes the behavior explicit. The downside is that this makes it awkward to enforce mandatory fields (e.g., targetLowMetrics). Which do we prefer?

751ae21#diff-a68be5bcbbbf7f3d53f49b90310d3e59R11

from macrobase.

deepakn94 avatar deepakn94 commented on August 16, 2024

I like the idea of defaults for the most part, since most of our parameters do have default values. For those that don't, we can have a default value like null, and then throw an exception if any argument is null.

from macrobase.

mamikonyana avatar mamikonyana commented on August 16, 2024

I like defaults too. the only thing that we require are the sql query, metrics and attributes. and those seem hard to forget :)
Also since we are moving to automating everything, we should in the end have defaults for everything, no?

from macrobase.

pbailis avatar pbailis commented on August 16, 2024

See #77.

from macrobase.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.