Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Nitschinger daschl

View GitHub Profile
@daschl
daschl / a.md
Created Jul 1, 2022
Couchbase / Reactor Classpath Issues
View a.md

Overview

The issue we are running into with the couchbase spark connector under databricks is that there seem to be classpath issues which based on my analysis and limited understandung of the underlying runtime should not happen.

I'm sharing the rough details below, if someone needs access to couchbase cloud credentials to try and reproduce please just ping me directly @daschl on twitter and I'm more than happy to provide those.

Background

The Connector uses the Couchbase Scala SDK underneath which has a direct dependency on project reactor and makes use of it quite heavily.

Looking at the classpath, it looks like there is more than one reactor version there:

View d2.rs
//! Experimental code for the touch screen display.
#![no_main]
#![cfg_attr(not(test), no_std)]
#[allow(unused_imports)]
use defmt_rtt as _;
use display_interface::DataFormat::U16BEIter;
use display_interface::WriteOnlyDataCommand;
use display_interface_spi::SPIInterfaceNoCS;
View wat.rs
#![no_main]
#![cfg_attr(not(test), no_std)]
#[allow(unused_imports)]
use defmt_rtt as _;
#[allow(unused_imports)]
use nrf52840_hal as _;
use nrf52840_hal::gpio::{Level, Output, Pin, PushPull};
use nrf52840_hal::prelude::OutputPin;
@daschl
daschl / display.rs
Last active Oct 25, 2020
display.rs
View display.rs
#![no_main]
#![no_std]
use defmt_rtt as _;
use nrf52840_hal as _; // memory layout // global logger
use embedded_hal::digital::v2::OutputPin;
use nrf52840_hal::gpio::{p0, Level, Output, Pin, PushPull};
use nrf52840_hal::pac::{Peripherals, SPIM0, TIMER0};
use nrf52840_hal::prelude::*;
View plugins.rs
//! Helps to wrap plugins into commands for direct inclusion
use nu_plugin::Plugin;
use nu_cli::{CommandArgs, CommandRegistry, OutputStream, WholeStreamCommand};
use async_trait::async_trait;
use nu_protocol::Signature;
use nu_errors::ShellError;
pub struct PluginCommand<P> {
signature: Signature,
View CouchbaseContainer.java
package org.testcontainers.couchbase;
import com.github.dockerjava.api.command.InspectContainerResponse;
import com.github.dockerjava.api.model.ContainerNetwork;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.wait.strategy.HttpWaitStrategy;
import org.testcontainers.shaded.com.fasterxml.jackson.databind.JsonNode;
import org.testcontainers.shaded.com.fasterxml.jackson.databind.ObjectMapper;
import org.testcontainers.shaded.okhttp3.Credentials;
import org.testcontainers.shaded.okhttp3.FormBody;
View BaseCouchbaseContainerTest.java
package org.testcontainers.couchbase;
import com.couchbase.client.java.Bucket;
import com.couchbase.client.java.Cluster;
import com.couchbase.client.java.CouchbaseCluster;
import com.couchbase.client.java.document.JsonDocument;
import com.couchbase.client.java.document.json.JsonObject;
import com.couchbase.client.java.env.CouchbaseEnvironment;
import com.couchbase.client.java.env.DefaultCouchbaseEnvironment;
import org.junit.ClassRule;
View gist:288150e4d48ddaa3414475e4bfe1d86c
> cbq -u Administrator -p password --script "select * from `travel-sample` limit 10" -q | from-json | get results.travel-sample | sort-by name
━━━━━━━━━━┯━━━━━━━━━━━━━━━┯━━━━━━┯━━━━━━┯━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━
callsign │ country │ iata │ icao │ id │ name │ type
──────────┼───────────────┼──────┼──────┼────┼─────────────┼─────────
MILE-AIR │ United States │ Q5 │ MLA │ 10 │ 40-Mile Air │ airline
━━━━━━━━━━┷━━━━━━━━━━━━━━━┷━━━━━━┷━━━━━━┷━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━
> cbq -u Administrator -p password --script "select * from `travel-sample` limit 10" -q | from-json | get results | get travel-sample | sort-by name
━━━┯━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━┯━━━━━━┯━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━
# │ callsign │ country │ iata │ icao │ id │ name │ type
View bla.jsx
<ul id="results-list" className="list-group">
{
this.state.responses.map((item, key) => {
if (item.success) {
<li key={key} className="list-group-item list-group-item-success">
<pre>{JSON.stringify(item, null, 2)}</pre>
</li>
} else {
<li key={key} className="list-group-item list-group-item-success">bla</li>
}
View build.gradle
plugins {
id 'scala'
id 'maven-publish'
}
repositories {
mavenCentral()
jcenter()
}